]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
Avoid broken pipe message for tests that fail with usage errors.
authorJim Meyering <jim@meyering.net>
Thu, 30 Jul 1998 12:26:24 +0000 (12:26 +0000)
committerJim Meyering <jim@meyering.net>
Thu, 30 Jul 1998 12:26:24 +0000 (12:26 +0000)
tests/cut/Test.pm

index f140a344bbc14a16f41d2e751ae213bb71ffdd5b..d5bdf0130e9bf574ecf88b2ae642bf5e8eb627d2 100755 (executable)
@@ -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
 {