Mercurial > gnulib
annotate tests/test-select-in.sh @ 40186:8964917f9574
autoupdate
author | Karl Berry <karl@freefriends.org> |
---|---|
date | Mon, 18 Feb 2019 08:02:49 -0800 |
parents | 700012efeb01 |
children | 8c1a17df67e0 |
rev | line source |
---|---|
10771 | 1 #!/bin/sh |
2 # Test select() on file descriptors opened for reading. | |
3 | |
10921
bafc6771d75a
Document a select() bug on Solaris 2.6.
Bruno Haible <bruno@clisp.org>
parents:
10787
diff
changeset
|
4 # This test is known to fail on Solaris 2.6 and older, due to its handling |
bafc6771d75a
Document a select() bug on Solaris 2.6.
Bruno Haible <bruno@clisp.org>
parents:
10787
diff
changeset
|
5 # of /dev/null. |
bafc6771d75a
Document a select() bug on Solaris 2.6.
Bruno Haible <bruno@clisp.org>
parents:
10787
diff
changeset
|
6 |
10771 | 7 tmpfiles="" |
8 trap 'rm -fr $tmpfiles' 1 2 3 15 | |
9 | |
10 tmpfiles="$tmpfiles t-select-in.tmp" | |
11 | |
12 # Regular files. | |
13 | |
10787
14671fbf0b74
Don't rely on the contents of stderr of shell commands.
Bruno Haible <bruno@clisp.org>
parents:
10771
diff
changeset
|
14 rm -f t-select-in.tmp |
14671fbf0b74
Don't rely on the contents of stderr of shell commands.
Bruno Haible <bruno@clisp.org>
parents:
10771
diff
changeset
|
15 ./test-select-fd${EXEEXT} r 0 t-select-in.tmp < ./test-select-fd${EXEEXT} |
10771 | 16 test `cat t-select-in.tmp` = "1" || exit 1 |
17 | |
18 # Pipes. | |
19 | |
10787
14671fbf0b74
Don't rely on the contents of stderr of shell commands.
Bruno Haible <bruno@clisp.org>
parents:
10771
diff
changeset
|
20 rm -f t-select-in.tmp |
13251
700012efeb01
tests: be robust to ignored SIGPIPE
Eric Blake <eblake@redhat.com>
parents:
10921
diff
changeset
|
21 { sleep 1; echo abc; } | \ |
700012efeb01
tests: be robust to ignored SIGPIPE
Eric Blake <eblake@redhat.com>
parents:
10921
diff
changeset
|
22 { ./test-select-fd${EXEEXT} r 0 t-select-in.tmp; cat > /dev/null; } |
10771 | 23 test `cat t-select-in.tmp` = "0" || exit 1 |
24 | |
10787
14671fbf0b74
Don't rely on the contents of stderr of shell commands.
Bruno Haible <bruno@clisp.org>
parents:
10771
diff
changeset
|
25 rm -f t-select-in.tmp |
14671fbf0b74
Don't rely on the contents of stderr of shell commands.
Bruno Haible <bruno@clisp.org>
parents:
10771
diff
changeset
|
26 echo abc | { sleep 1; ./test-select-fd${EXEEXT} r 0 t-select-in.tmp; } |
10771 | 27 test `cat t-select-in.tmp` = "1" || exit 1 |
28 | |
29 # Special files. | |
10921
bafc6771d75a
Document a select() bug on Solaris 2.6.
Bruno Haible <bruno@clisp.org>
parents:
10787
diff
changeset
|
30 # This part of the test is known to fail on Solaris 2.6 and older. |
10771 | 31 |
10787
14671fbf0b74
Don't rely on the contents of stderr of shell commands.
Bruno Haible <bruno@clisp.org>
parents:
10771
diff
changeset
|
32 rm -f t-select-in.tmp |
14671fbf0b74
Don't rely on the contents of stderr of shell commands.
Bruno Haible <bruno@clisp.org>
parents:
10771
diff
changeset
|
33 ./test-select-fd${EXEEXT} r 0 t-select-in.tmp < /dev/null |
10771 | 34 test `cat t-select-in.tmp` = "1" || exit 1 |
35 | |
36 rm -fr $tmpfiles | |
37 | |
38 exit 0 |