diff --git a/t/test.pl b/t/test.pl index c7818c2f769e..e498038cd618 100644 --- a/t/test.pl +++ b/t/test.pl @@ -1,7 +1,6 @@ # # t/test.pl - most of Test::More functionality without the fuss - # NOTE: # # Do not rely on features found only in more modern Perls here, as some CPAN @@ -19,6 +18,10 @@ # In this file, we use the latter "Baby Perl" approach, and increment # will be worked over by t/op/inc.t +# This file sets for its caller $::IS_ASCII and $::IS_EBCDIC appropriately; +# and $::devnull to be the string to use to specify /dev/null on this +# platform. + $| = 1; our $Level = 1; my $test = 1; @@ -697,6 +700,9 @@ ($) my $is_vms = $^O eq 'VMS'; my $is_cygwin = $^O eq 'cygwin'; +# /dev/null appears to be surprisingly portable. +$::devnull = ($is_mswin ? 'nul' : '/dev/null'); + sub _quote_args { my ($runperl, $args) = @_; @@ -798,14 +804,13 @@ sub _create_runperl { # Create the string to qx in runperl(). # needing a pipeline, so that the fork tests have a sane environment # without these surprises. - # /dev/null appears to be surprisingly portable. - $runperl = $runperl . ($is_mswin ? ' nul' : ' 2>/dev/null'); + $runperl = "$runperl 2>$::devnull"; } elsif ($args{stderr}) { $runperl = $runperl . ' 2>&1';