From: Karl Williamson Date: Sat, 15 Feb 2014 19:48:59 +0000 (-0700) Subject: t/test.pl: Add option to runperl to suppress STDERR X-Git-Tag: upstream/5.20.0~421 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=97dffe50643dd18f87b33b7ec6f8b55bbfd1fd74;p=platform%2Fupstream%2Fperl.git t/test.pl: Add option to runperl to suppress STDERR --- diff --git a/t/test.pl b/t/test.pl index fc64f4a..152c796 100644 --- a/t/test.pl +++ b/t/test.pl @@ -564,7 +564,8 @@ USE_OK # progs => [ multi-liner (avoid quotes) ] # progfile => perl script # stdin => string to feed the stdin (or undef to redirect from /dev/null) -# stderr => redirect stderr to stdout +# stderr => If 'devnull' suppresses stderr, if other TRUE value redirect +# stderr to stdout # args => [ command-line arguments to the perl program ] # verbose => print the command line @@ -680,7 +681,12 @@ sub _create_runperl { # Create the string to qx in runperl(). if (defined $args{args}) { $runperl = _quote_args($runperl, $args{args}); } - $runperl = $runperl . ' 2>&1' if $args{stderr}; + if ($args{stderr} eq 'devnull') { + $runperl = $runperl . ($is_mswin ? ' 2>nul' : ' 2>/dev/null'); + } + elsif ($args{stderr}) { + $runperl = $runperl . ' 2>&1'; + } if ($args{verbose}) { my $runperldisplay = $runperl; $runperldisplay =~ s/\n/\n\#/g;