comparison tests/test-readtokens.sh @ 40221:8c1a17df67e0

tests: Prepare for using valgrind. tests/*.sh: Invoke all test programs through ${CHECKER}. tests/*/*.sh: Likewise.
author Bruno Haible <bruno@clisp.org>
date Sun, 10 Mar 2019 11:32:11 +0100
parents dcdc513e338b
children
comparison
equal deleted inserted replaced
40220:2796695e9216 40221:8c1a17df67e0
1 #!/bin/sh 1 #!/bin/sh
2 . "${srcdir=.}/init.sh"; path_prepend_ . 2 . "${srcdir=.}/init.sh"; path_prepend_ .
3 3
4 fail=0 4 fail=0
5 5
6 test-readtokens || fail=1 6 ${CHECKER} test-readtokens || fail=1
7 7
8 # Simplest case. 8 # Simplest case.
9 echo a:b:c: > exp || fail=1 9 echo a:b:c: > exp || fail=1
10 printf a:b:c | test-readtokens : > out 2>&1 || fail=1 10 printf a:b:c | ${CHECKER} test-readtokens : > out 2>&1 || fail=1
11 compare exp out || fail=1 11 compare exp out || fail=1
12 12
13 # Use NUL as the delimiter. 13 # Use NUL as the delimiter.
14 echo a:b:c: > exp || fail=1 14 echo a:b:c: > exp || fail=1
15 printf 'a\0b\0c' | test-readtokens '\0' > out 2>&1 || fail=1 15 printf 'a\0b\0c' | ${CHECKER} test-readtokens '\0' > out 2>&1 || fail=1
16 compare exp out || fail=1 16 compare exp out || fail=1
17 17
18 # Two delimiter bytes, and adjacent delimiters in the input. 18 # Two delimiter bytes, and adjacent delimiters in the input.
19 echo a:b:c: > exp || fail=1 19 echo a:b:c: > exp || fail=1
20 printf a:-:b-:c:: | test-readtokens :- > out 2>&1 || fail=1 20 printf a:-:b-:c:: | ${CHECKER} test-readtokens :- > out 2>&1 || fail=1
21 compare exp out || fail=1 21 compare exp out || fail=1
22 22
23 Exit $fail 23 Exit $fail