annotate tests/test-xstdopen.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 fd583bcb1e66
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
40091
fd583bcb1e66 xstdopen: Add tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1 #!/bin/sh
fd583bcb1e66 xstdopen: Add tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
2
fd583bcb1e66 xstdopen: Add tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
3 # Test with all of stdin, stdout, stderr open.
40221
8c1a17df67e0 tests: Prepare for using valgrind.
Bruno Haible <bruno@clisp.org>
parents: 40091
diff changeset
4 ${CHECKER} ./test-xstdopen${EXEEXT} || exit 1
40091
fd583bcb1e66 xstdopen: Add tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
5
fd583bcb1e66 xstdopen: Add tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
6 # The syntax for closed file descriptors in sh scripts is specified by POSIX in
fd583bcb1e66 xstdopen: Add tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
7 # section 2.7.5 of
fd583bcb1e66 xstdopen: Add tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
8 # http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html
fd583bcb1e66 xstdopen: Add tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
9
fd583bcb1e66 xstdopen: Add tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
10 # Test with stdin closed.
40221
8c1a17df67e0 tests: Prepare for using valgrind.
Bruno Haible <bruno@clisp.org>
parents: 40091
diff changeset
11 ${CHECKER} ./test-xstdopen${EXEEXT} <&- || exit 1
40091
fd583bcb1e66 xstdopen: Add tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
12
fd583bcb1e66 xstdopen: Add tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
13 # Test with stdout closed.
40221
8c1a17df67e0 tests: Prepare for using valgrind.
Bruno Haible <bruno@clisp.org>
parents: 40091
diff changeset
14 ${CHECKER} ./test-xstdopen${EXEEXT} >&- || exit 1
40091
fd583bcb1e66 xstdopen: Add tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
15
fd583bcb1e66 xstdopen: Add tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
16 # Test with stderr closed.
40221
8c1a17df67e0 tests: Prepare for using valgrind.
Bruno Haible <bruno@clisp.org>
parents: 40091
diff changeset
17 ${CHECKER} ./test-xstdopen${EXEEXT} 2>&- || exit 1
40091
fd583bcb1e66 xstdopen: Add tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
18
fd583bcb1e66 xstdopen: Add tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
19 # Test with all of stdin, stdout, stderr closed.
40221
8c1a17df67e0 tests: Prepare for using valgrind.
Bruno Haible <bruno@clisp.org>
parents: 40091
diff changeset
20 ${CHECKER} ./test-xstdopen${EXEEXT} <&- >&- 2>&- || exit 1