|
1 | 1 | # |
2 | 2 | # t/test.pl - most of Test::More functionality without the fuss |
3 | 3 |
|
4 | | - |
5 | 4 | # NOTE: |
6 | 5 | # |
7 | 6 | # Do not rely on features found only in more modern Perls here, as some CPAN |
|
19 | 18 | # In this file, we use the latter "Baby Perl" approach, and increment |
20 | 19 | # will be worked over by t/op/inc.t |
21 | 20 |
|
| 21 | +# This file sets for its caller $::IS_ASCII and $::IS_EBCDIC appropriately; |
| 22 | +# and $::devnull to be the string to use to specify /dev/null on this |
| 23 | +# platform. |
| 24 | + |
22 | 25 | $| = 1; |
23 | 26 | our $Level = 1; |
24 | 27 | my $test = 1; |
|
697 | 700 | my $is_vms = $^O eq 'VMS'; |
698 | 701 | my $is_cygwin = $^O eq 'cygwin'; |
699 | 702 |
|
| 703 | +# /dev/null appears to be surprisingly portable. |
| 704 | +$::devnull = ($is_mswin ? 'nul' : '/dev/null'); |
| 705 | + |
700 | 706 | sub _quote_args { |
701 | 707 | my ($runperl, $args) = @_; |
702 | 708 |
|
@@ -798,14 +804,13 @@ sub _create_runperl { # Create the string to qx in runperl(). |
798 | 804 | # needing a pipeline, so that the fork tests have a sane environment |
799 | 805 | # without these surprises. |
800 | 806 |
|
801 | | - # /dev/null appears to be surprisingly portable. |
802 | | - $runperl = $runperl . ($is_mswin ? ' <nul' : ' </dev/null'); |
| 807 | + $runperl = "$runperl <$::devnull"; |
803 | 808 | } |
804 | 809 | if (defined $args{args}) { |
805 | 810 | $runperl = _quote_args($runperl, $args{args}); |
806 | 811 | } |
807 | 812 | if (exists $args{stderr} && $args{stderr} eq 'devnull') { |
808 | | - $runperl = $runperl . ($is_mswin ? ' 2>nul' : ' 2>/dev/null'); |
| 813 | + $runperl = "$runperl 2>$::devnull"; |
809 | 814 | } |
810 | 815 | elsif ($args{stderr}) { |
811 | 816 | $runperl = $runperl . ' 2>&1'; |
|
0 commit comments