Debian Codegraph @

gnulib-tests/test-select-in.sh

raw symbols SCIP
1 #!/bin/shscip-shell filesystem . . `/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 rmscip-shell system . . rm. -f t-select-in.tmp
15 ${CHECKER} ./test-select-fd${EXEEXT} r 0 t-select-in.tmp < ./test-select-fd${EXEEXT}
16 testscip-shell system . . test. `catscip-shell system . . cat. t-select-in.tmp` = "1" || exit 1
17
18 # Pipes.
19
20 rmscip-shell system . . rm. -f t-select-in.tmp
21 { sleepscip-shell system . . sleep. 1; echoscip-shell system . . echo. abc; } | \
22 { ${CHECKER} ./test-select-fd${EXEEXT} r 0 t-select-in.tmp; catscip-shell system . . cat. > /dev/nullscip-shell filesystem . . `/dev/null`.; }
23 testscip-shell system . . test. `catscip-shell system . . cat. t-select-in.tmp` = "0" || exit 1
24
25 rmscip-shell system . . rm. -f t-select-in.tmp
26 echoscip-shell system . . echo. abc | { sleepscip-shell system . . sleep. 1; ${CHECKER} ./test-select-fd${EXEEXT} r 0 t-select-in.tmp; }
27 testscip-shell system . . test. `catscip-shell system . . cat. t-select-in.tmp` = "1" || exit 1
28
29 # Special files.
30 # This part of the test is known to fail on Solaris 2.6 and older.
31
32 rmscip-shell system . . rm. -f t-select-in.tmp
33 ${CHECKER} ./test-select-fd${EXEEXT} r 0 t-select-in.tmp < /dev/nullscip-shell filesystem . . `/dev/null`.
34 testscip-shell system . . test. `catscip-shell system . . cat. t-select-in.tmp` = "1" || exit 1
35
36 rmscip-shell system . . rm. -fr $tmpfiles
37
38 exit 0