source: trunk/src/grep/gnulib-tests/test-select-in.sh@ 3553

Last change on this file since 3553 was 3529, checked in by bird, 4 years ago

Imported grep 3.7 from grep-3.7.tar.gz (sha256: c22b0cf2d4f6bbe599c902387e8058990e1eee99aef333a203829e5fd3dbb342), applying minimal auto-props.

  • Property svn:executable set to *
File size: 989 bytes
Line 
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
7tmpfiles=""
8trap 'rm -fr $tmpfiles' 1 2 3 15
9
10tmpfiles="$tmpfiles t-select-in.tmp"
11
12# Regular files.
13
14rm -f t-select-in.tmp
15${CHECKER} ./test-select-fd${EXEEXT} r 0 t-select-in.tmp < ./test-select-fd${EXEEXT}
16test `cat t-select-in.tmp` = "1" || exit 1
17
18# Pipes.
19
20rm -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; }
23test `cat t-select-in.tmp` = "0" || exit 1
24
25rm -f t-select-in.tmp
26echo abc | { sleep 1; ${CHECKER} ./test-select-fd${EXEEXT} r 0 t-select-in.tmp; }
27test `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
32rm -f t-select-in.tmp
33${CHECKER} ./test-select-fd${EXEEXT} r 0 t-select-in.tmp < /dev/null
34test `cat t-select-in.tmp` = "1" || exit 1
35
36rm -fr $tmpfiles
37
38exit 0
Note: See TracBrowser for help on using the repository browser.