diff options
author | Lorry <lorry@roadtrain.codethink.co.uk> | 2012-08-15 09:31:11 +0100 |
---|---|---|
committer | Lorry <lorry@roadtrain.codethink.co.uk> | 2012-08-15 09:31:11 +0100 |
commit | d0dc3f5c30ca0b8350b48ba032a65681bfa20bdb (patch) | |
tree | 17ada9ef2482441523576855dce14785e40d96a3 /tests/010-pipe | |
download | pv-d0dc3f5c30ca0b8350b48ba032a65681bfa20bdb.tar.gz |
Tarball conversion
Diffstat (limited to 'tests/010-pipe')
-rw-r--r-- | tests/010-pipe | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/010-pipe b/tests/010-pipe new file mode 100644 index 0000000..8e569dd --- /dev/null +++ b/tests/010-pipe @@ -0,0 +1,26 @@ +#!/bin/sh +# +# Check that there is no SIGPIPE or dropped data on bigger data transfers. + +# We nead GNU head. On some platforms it is named ghead instead of head. +HEAD=head +for p in `echo $PATH | tr ':' '\n'` +do + if test -x $p/ghead + then + HEAD=$p/ghead + break + fi +done + +# Don't use dd. See http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=324308 +COUNT1=100000000 +#COUNT2=`$PROG -B 100000 -q /dev/zero | $HEAD -c $COUNT1 | wc -c | tr -d ' '` +# Remove \n to fix the test on AIX +COUNT2=`$PROG -B 100000 -q /dev/zero | $HEAD -c $COUNT1 | tr -d '\n' | wc -c | tr -d ' '` + +#echo "[$COUNT1] [$COUNT2]" + +test "x$COUNT1" = "x$COUNT2" + +# EOF |