X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FTest%2FHarness%2Ft%2Ftest-harness.t;h=f75f37963c3738aace56b07dd595610309531417;hb=d5201bd266fe42b2df8b480183c08be291a1ad06;hp=c428e850f766b81b04b854ea47db2ecbc6000dd5;hpb=83943eac2433a9cd52f114532df2a61529f109a2;p=p5sagit%2Fp5-mst-13.2.git diff --git a/lib/Test/Harness/t/test-harness.t b/lib/Test/Harness/t/test-harness.t index c428e85..f75f379 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 => { @@ -426,7 +431,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; @@ -444,7 +449,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" );