annotate tests/test-sigpipe.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 4380352f1dea
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
10485
5bf9ebbeac47 Tests for module 'sigpipe'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1 #!/bin/sh
5bf9ebbeac47 Tests for module 'sigpipe'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
2
5bf9ebbeac47 Tests for module 'sigpipe'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
3 tmpfiles=""
5bf9ebbeac47 Tests for module 'sigpipe'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
4 trap 'rm -fr $tmpfiles' 1 2 3 15
5bf9ebbeac47 Tests for module 'sigpipe'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
5
5bf9ebbeac47 Tests for module 'sigpipe'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
6 # Test signal's default behaviour.
5bf9ebbeac47 Tests for module 'sigpipe'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
7 tmpfiles="$tmpfiles t-sigpipeA.tmp"
40221
8c1a17df67e0 tests: Prepare for using valgrind.
Bruno Haible <bruno@clisp.org>
parents: 18380
diff changeset
8 ${CHECKER} ./test-sigpipe${EXEEXT} A 2> t-sigpipeA.tmp | head -1 > /dev/null
10485
5bf9ebbeac47 Tests for module 'sigpipe'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
9 if test -s t-sigpipeA.tmp; then
5bf9ebbeac47 Tests for module 'sigpipe'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
10 LC_ALL=C tr -d '\r' < t-sigpipeA.tmp
5bf9ebbeac47 Tests for module 'sigpipe'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
11 rm -fr $tmpfiles; exit 1
5bf9ebbeac47 Tests for module 'sigpipe'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
12 fi
5bf9ebbeac47 Tests for module 'sigpipe'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
13
5bf9ebbeac47 Tests for module 'sigpipe'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
14 # Test signal's ignored behaviour.
5bf9ebbeac47 Tests for module 'sigpipe'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
15 tmpfiles="$tmpfiles t-sigpipeB.tmp"
40221
8c1a17df67e0 tests: Prepare for using valgrind.
Bruno Haible <bruno@clisp.org>
parents: 18380
diff changeset
16 ${CHECKER} ./test-sigpipe${EXEEXT} B 2> t-sigpipeB.tmp | head -1 > /dev/null
10485
5bf9ebbeac47 Tests for module 'sigpipe'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
17 if test -s t-sigpipeB.tmp; then
5bf9ebbeac47 Tests for module 'sigpipe'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
18 LC_ALL=C tr -d '\r' < t-sigpipeB.tmp
5bf9ebbeac47 Tests for module 'sigpipe'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
19 rm -fr $tmpfiles; exit 1
5bf9ebbeac47 Tests for module 'sigpipe'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
20 fi
5bf9ebbeac47 Tests for module 'sigpipe'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
21
5bf9ebbeac47 Tests for module 'sigpipe'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
22 # Test signal's behaviour when a handler is installed.
5bf9ebbeac47 Tests for module 'sigpipe'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
23 tmpfiles="$tmpfiles t-sigpipeC.tmp"
40221
8c1a17df67e0 tests: Prepare for using valgrind.
Bruno Haible <bruno@clisp.org>
parents: 18380
diff changeset
24 ${CHECKER} ./test-sigpipe${EXEEXT} C 2> t-sigpipeC.tmp | head -1 > /dev/null
10485
5bf9ebbeac47 Tests for module 'sigpipe'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
25 if test -s t-sigpipeC.tmp; then
5bf9ebbeac47 Tests for module 'sigpipe'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
26 LC_ALL=C tr -d '\r' < t-sigpipeC.tmp
5bf9ebbeac47 Tests for module 'sigpipe'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
27 rm -fr $tmpfiles; exit 1
5bf9ebbeac47 Tests for module 'sigpipe'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
28 fi
5bf9ebbeac47 Tests for module 'sigpipe'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
29
5bf9ebbeac47 Tests for module 'sigpipe'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
30 rm -fr $tmpfiles
5bf9ebbeac47 Tests for module 'sigpipe'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
31 exit 0