summaryrefslogtreecommitdiff
path: root/lib/Test
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Test')
-rw-r--r--lib/Test/Harness/Straps.pm4
-rw-r--r--lib/Test/Harness/t/callback.t8
-rw-r--r--lib/Test/Harness/t/strap-analyze.t12
-rw-r--r--lib/Test/Harness/t/test-harness.t13
-rw-r--r--lib/Test/Simple/t/exit.t5
5 files changed, 32 insertions, 10 deletions
diff --git a/lib/Test/Harness/Straps.pm b/lib/Test/Harness/Straps.pm
index 8f4f6bde48..aff5735667 100644
--- a/lib/Test/Harness/Straps.pm
+++ b/lib/Test/Harness/Straps.pm
@@ -315,8 +315,8 @@ sub _switches {
my $s = '';
$s .= " $ENV{'HARNESS_PERL_SWITCHES'}"
if exists $ENV{'HARNESS_PERL_SWITCHES'};
- $s .= join " ", qq[ "-$1"], map {qq["-I$_"]} $self->_filtered_INC
- if $first =~ /^#!.*\bperl.*\s-\w*([Tt]+)/;
+ $s .= qq[ "-$1" ] if $first =~ /^#!.*\bperl.*\s-\w*([Tt]+)/;
+ $s .= join " ", map {qq["-I$_"]} $self->_filtered_INC;
close(TEST) or print "can't close $file. $!\n";
diff --git a/lib/Test/Harness/t/callback.t b/lib/Test/Harness/t/callback.t
index 2fc943acf3..65de524302 100644
--- a/lib/Test/Harness/t/callback.t
+++ b/lib/Test/Harness/t/callback.t
@@ -10,7 +10,11 @@ BEGIN {
}
}
-my $SAMPLE_TESTS = $ENV{PERL_CORE} ? 'lib/sample-tests' : 't/sample-tests';
+use File::Spec::Functions;
+
+my $SAMPLE_TESTS = $ENV{PERL_CORE}
+ ? catdir(curdir(), 'lib', 'sample-tests')
+ : catdir(curdir(), 't', 'sample-tests');
use Test::More;
@@ -49,7 +53,7 @@ $strap->{callback} = sub {
while( my($test, $expect) = each %samples ) {
local @out = ();
- $strap->analyze_file("$SAMPLE_TESTS/$test");
+ $strap->analyze_file(catfile($SAMPLE_TESTS, $test));
is_deeply(\@out, $expect, "$test callback");
}
diff --git a/lib/Test/Harness/t/strap-analyze.t b/lib/Test/Harness/t/strap-analyze.t
index 781ddd2b0b..60ecb0da90 100644
--- a/lib/Test/Harness/t/strap-analyze.t
+++ b/lib/Test/Harness/t/strap-analyze.t
@@ -10,11 +10,19 @@ BEGIN {
}
}
-my $SAMPLE_TESTS = $ENV{PERL_CORE} ? 'lib/sample-tests' : 't/sample-tests';
+use File::Spec::Functions;
+
+my $SAMPLE_TESTS = $ENV{PERL_CORE}
+ ? catdir(curdir(), 'lib', 'sample-tests')
+ : catdir(curdir(), 't', 'sample-tests');
use strict;
use Test::More;
+if ($^O eq 'MacOS') {
+ plan skip_all => "Exit status broken on Mac OS";
+}
+
my $IsVMS = $^O eq 'VMS';
# VMS uses native, not POSIX, exit codes.
@@ -417,7 +425,7 @@ while( my($test, $expect) = each %samples ) {
}
my $strap = Test::Harness::Straps->new;
- my %results = $strap->analyze_file("$SAMPLE_TESTS/$test");
+ my %results = $strap->analyze_file(catfile($SAMPLE_TESTS, $test));
is_deeply($results{details}, $expect->{details}, "$test details" );
diff --git a/lib/Test/Harness/t/test-harness.t b/lib/Test/Harness/t/test-harness.t
index 6241818710..d0610596cd 100644
--- a/lib/Test/Harness/t/test-harness.t
+++ b/lib/Test/Harness/t/test-harness.t
@@ -10,7 +10,11 @@ BEGIN {
}
}
-my $SAMPLE_TESTS = $ENV{PERL_CORE} ? "lib/sample-tests" : "t/sample-tests";
+use File::Spec::Functions;
+
+my $SAMPLE_TESTS = $ENV{PERL_CORE}
+ ? catdir(curdir(), 'lib', 'sample-tests')
+ : catdir(curdir(), 't', 'sample-tests');
use strict;
@@ -36,9 +40,10 @@ package main;
use Test::More;
my $IsVMS = $^O eq 'VMS';
+my $IsMacOS = $^O eq 'MacOS';
# VMS uses native, not POSIX, exit codes.
-my $die_estat = $IsVMS ? 44 : 1;
+my $die_estat = $IsVMS ? 44 : $IsMacOS ? 0 : 1;
my %samples = (
simple => {
@@ -394,7 +399,7 @@ while (my($test, $expect) = each %samples) {
select NULL; # _run_all_tests() isn't as quiet as it should be.
local $SIG{__WARN__} = sub { $warning .= join '', @_; };
($totals, $failed) =
- Test::Harness::_run_all_tests("$SAMPLE_TESTS/$test");
+ Test::Harness::_run_all_tests(catfile($SAMPLE_TESTS, $test));
};
select STDOUT;
@@ -412,7 +417,7 @@ while (my($test, $expect) = each %samples) {
is_deeply( {map { $_=>$totals->{$_} } keys %{$expect->{total}}},
$expect->{total},
"$test - totals" );
- is_deeply( {map { $_=>$failed->{"$SAMPLE_TESTS/$test"}{$_} }
+ is_deeply( {map { $_=>$failed->{catfile($SAMPLE_TESTS, $test)}{$_} }
keys %{$expect->{failed}}},
$expect->{failed},
"$test - failed" );
diff --git a/lib/Test/Simple/t/exit.t b/lib/Test/Simple/t/exit.t
index 25e6259628..1367bbfdcd 100644
--- a/lib/Test/Simple/t/exit.t
+++ b/lib/Test/Simple/t/exit.t
@@ -18,6 +18,11 @@ if( $^O eq 'VMS' && $] <= 5.00503 ) {
exit 0;
}
+if( $^O eq 'MacOS' ) {
+ print "1..0 # Skip exit status broken on Mac OS\n";
+ exit 0;
+}
+
my $test_num = 1;
# Utility testing functions.
sub ok ($;$) {