From: Jim Meyering Date: Thu, 30 Jul 1998 12:26:24 +0000 (+0000) Subject: Avoid broken pipe message for tests that fail with usage errors. X-Git-Tag: FILEUTILS-3_16t~25 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=eb8ea6eac558c6f63e813840a05697c634c98da0;p=thirdparty%2Fcoreutils.git Avoid broken pipe message for tests that fail with usage errors. --- diff --git a/tests/cut/Test.pm b/tests/cut/Test.pm index f140a344bb..d5bdf0130e 100755 --- a/tests/cut/Test.pm +++ b/tests/cut/Test.pm @@ -71,9 +71,14 @@ my @tv = ( ); -# Don't use a pipe for these tests to avoid `Broken pipe' message. -$Test::input_via{'y'} = {REDIR => 0, FILE => 0}; -$Test::input_via{'z'} = {REDIR => 0, FILE => 0}; +# Don't use a pipe for failing tests. Otherwise, sometimes they +# fail so early they'd evoke the `Broken pipe' message. +my $t; +foreach $t (@tv) + { + my ($test_name, $flags, $in, $exp, $ret) = @$t; + $Test::input_via{$test_name} = {REDIR => 0, FILE => 0} if $ret; + } sub test_vector {