summaryrefslogtreecommitdiff
path: root/tests/cut/Test.pm
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1998-07-30 12:26:24 +0000
committerJim Meyering <jim@meyering.net>1998-07-30 12:26:24 +0000
commiteb8ea6eac558c6f63e813840a05697c634c98da0 (patch)
treec411fc259c3fcc461534127931d3fe37dfd7adac /tests/cut/Test.pm
parentda68f3941181d98919c6ec33a2485215aca1b2dd (diff)
downloadcoreutils-eb8ea6eac558c6f63e813840a05697c634c98da0.tar.xz
Avoid broken pipe message for tests that fail with usage errors.
Diffstat (limited to 'tests/cut/Test.pm')
-rwxr-xr-xtests/cut/Test.pm11
1 files changed, 8 insertions, 3 deletions
diff --git a/tests/cut/Test.pm b/tests/cut/Test.pm
index f140a344b..d5bdf0130 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
{