nstrftime, c-nstrftime tests: Avoid test failures on native Windows.
[gnulib.git] / tests / test-select-in.sh
blobad86ea252606a806314bf580ac5bc28d3163643c
1 #!/bin/sh
2 # Test select() on file descriptors opened for reading.
4 # This test is known to fail on Solaris 2.6 and older, due to its handling
5 # of /dev/null.
7 tmpfiles=""
8 trap 'rm -fr $tmpfiles' HUP INT QUIT TERM
10 tmpfiles="$tmpfiles t-select-in.tmp"
12 # Regular files.
14 rm -f t-select-in.tmp
15 ${CHECKER} ./test-select-fd${EXEEXT} r 0 t-select-in.tmp < ./test-select-fd${EXEEXT}
16 test `cat t-select-in.tmp` = "1" || exit 1
18 # Pipes.
20 rm -f t-select-in.tmp
21 { sleep 1; echo abc; } | \
22 { ${CHECKER} ./test-select-fd${EXEEXT} r 0 t-select-in.tmp; cat > /dev/null; }
23 test `cat t-select-in.tmp` = "0" || exit 1
25 rm -f t-select-in.tmp
26 echo abc | { sleep 1; ${CHECKER} ./test-select-fd${EXEEXT} r 0 t-select-in.tmp; }
27 test `cat t-select-in.tmp` = "1" || exit 1
29 # Special files.
30 # This part of the test is known to fail on Solaris 2.6 and older.
32 rm -f t-select-in.tmp
33 ${CHECKER} ./test-select-fd${EXEEXT} r 0 t-select-in.tmp < /dev/null
34 test `cat t-select-in.tmp` = "1" || exit 1
36 rm -fr $tmpfiles
38 exit 0