Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions t/test.pl
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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;
Expand Down Expand Up @@ -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) = @_;

Expand Down Expand Up @@ -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' : ' </dev/null');
$runperl = "$runperl <$::devnull";
}
if (defined $args{args}) {
$runperl = _quote_args($runperl, $args{args});
}
if (exists $args{stderr} && $args{stderr} eq 'devnull') {
$runperl = $runperl . ($is_mswin ? ' 2>nul' : ' 2>/dev/null');
$runperl = "$runperl 2>$::devnull";
}
elsif ($args{stderr}) {
$runperl = $runperl . ' 2>&1';
Expand Down
Loading