source: trunk/src/sed/gnulib-tests/test-select-out.sh@ 3669

Last change on this file since 3669 was 3611, checked in by bird, 10 months ago

vendor/sed/current: GNU sed 4.9 (sed-4.9.tar.xz sha256:6e226b732e1cd739464ad6862bd1a1aba42d7982922da7a53519631d24975181)

  • Property svn:executable set to *
File size: 932 bytes
Line 
1#!/bin/sh
2# Test select() on file descriptors opened for writing.
3
4tmpfiles=""
5trap 'rm -fr $tmpfiles' 1 2 3 15
6
7tmpfiles="$tmpfiles t-select-out.out t-select-out.tmp"
8
9# Regular files.
10
11rm -f t-select-out.tmp
12${CHECKER} ./test-select-fd${EXEEXT} w 1 t-select-out.tmp > t-select-out.out
13test `cat t-select-out.tmp` = "1" || exit 1
14
15# Pipes.
16
17if false; then # This test fails on some platforms.
18 rm -f t-select-out.tmp
19 ( { echo abc; ${CHECKER} ./test-select-fd${EXEEXT} w 1 t-select-out.tmp; } | { sleep 1; cat; } ) > /dev/null
20 test `cat t-select-out.tmp` = "0" || exit 1
21fi
22
23rm -f t-select-out.tmp
24( { sleep 1; echo abc; ${CHECKER} ./test-select-fd${EXEEXT} w 1 t-select-out.tmp; } | cat) > /dev/null
25test `cat t-select-out.tmp` = "1" || exit 1
26
27# Special files.
28
29rm -f t-select-out.tmp
30${CHECKER} ./test-select-fd${EXEEXT} w 1 t-select-out.tmp > /dev/null
31test `cat t-select-out.tmp` = "1" || exit 1
32
33rm -fr $tmpfiles
34
35exit 0
Note: See TracBrowser for help on using the repository browser.