doc: regenerate INSTALL
[gnulib.git] / tests / test-select-in.sh
1 #!/bin/sh
2 # Test select() on file descriptors opened for reading.
3
4 # This test is known to fail on Solaris 2.6 and older, due to its handling
5 # of /dev/null.
6
7 tmpfiles=""
8 trap 'rm -fr $tmpfiles' 1 2 3 15
9
10 tmpfiles="$tmpfiles t-select-in.tmp"
11
12 # Regular files.
13
14 rm -f t-select-in.tmp
15 ./test-select-fd${EXEEXT} r 0 t-select-in.tmp < ./test-select-fd${EXEEXT}
16 test `cat t-select-in.tmp` = "1" || exit 1
17
18 # Pipes.
19
20 rm -f t-select-in.tmp
21 { sleep 1; echo abc; } | ./test-select-fd${EXEEXT} r 0 t-select-in.tmp
22 test `cat t-select-in.tmp` = "0" || exit 1
23
24 rm -f t-select-in.tmp
25 echo abc | { sleep 1; ./test-select-fd${EXEEXT} r 0 t-select-in.tmp; }
26 test `cat t-select-in.tmp` = "1" || exit 1
27
28 # Special files.
29 # This part of the test is known to fail on Solaris 2.6 and older.
30
31 rm -f t-select-in.tmp
32 ./test-select-fd${EXEEXT} r 0 t-select-in.tmp < /dev/null
33 test `cat t-select-in.tmp` = "1" || exit 1
34
35 rm -fr $tmpfiles
36
37 exit 0