diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2002-05-31 21:42:12 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2002-05-31 21:42:12 +0000 |
commit | d5201bd266fe42b2df8b480183c08be291a1ad06 (patch) | |
tree | e7f719e75b91b93f6b813831b273f6d3dca6c15e /lib/Test | |
parent | 83943eac2433a9cd52f114532df2a61529f109a2 (diff) | |
download | perl-d5201bd266fe42b2df8b480183c08be291a1ad06.tar.gz |
Integrate macperl patches #16926 and #16938;
Big MacPerl Testing Patch No. 2
Big MacPerl Testing Patch No. 3
p4raw-id: //depot/perl@16942
p4raw-integrated: from //depot/macperl@16937 'copy in'
lib/Devel/SelfStubber.pm lib/Devel/SelfStubber.t
lib/File/DosGlob.t lib/File/Path.t lib/File/Spec/t/Spec.t
lib/File/Temp.pm lib/FindBin.t lib/Tie/File/t/09_gen_rs.t
lib/lib.t t/comp/use.t utils/dprofpp.PL utils/splain.PL
(@16123..) t/lib/MakeMaker/Test/Utils.pm (@16230..)
lib/diagnostics.t (@16646..) lib/ExtUtils/t/00setup_dummy.t
lib/ExtUtils/t/Command.t (@16730..) lib/lib_pm.PL (@16926..)
lib/ExtUtils/MM_MacOS.pm lib/Test/Harness/Straps.pm
lib/Test/Harness/t/callback.t
lib/Test/Harness/t/strap-analyze.t
lib/Test/Harness/t/test-harness.t (@16929..)
p4raw-integrated: from //depot/macperl@16926 'merge in' lib/English.t
(@16123..) ext/DynaLoader/DynaLoader_pm.PL (@16868..)
Diffstat (limited to 'lib/Test')
-rw-r--r-- | lib/Test/Harness/Straps.pm | 7 | ||||
-rw-r--r-- | lib/Test/Harness/t/callback.t | 8 | ||||
-rw-r--r-- | lib/Test/Harness/t/strap-analyze.t | 12 | ||||
-rw-r--r-- | lib/Test/Harness/t/test-harness.t | 13 |
4 files changed, 30 insertions, 10 deletions
diff --git a/lib/Test/Harness/Straps.pm b/lib/Test/Harness/Straps.pm index d19239fb59..7b018aebd4 100644 --- a/lib/Test/Harness/Straps.pm +++ b/lib/Test/Harness/Straps.pm @@ -328,8 +328,11 @@ sub _switches { # When taint mode is on, PERL5LIB is ignored. So we need to put # all that on the command line as -Is. - $s .= join " ", qq[ "-$1"], map {qq["-I$_"]} $self->_filtered_INC - if $first =~ /^#!.*\bperl.*\s-\w*([Tt]+)/; + if ($first =~ /^#!.*\bperl.*\s-\w*([Tt]+)/) { + $s .= join " ", qq[ "-$1"], map {qq["-I$_"]} $self->_filtered_INC; + } elsif ($^O eq 'MacOS') { + $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 0537f919ab..63aaa22c9c 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; @@ -50,7 +54,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 7ebbf3581d..96b549ab2c 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. @@ -455,7 +463,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 c428e850f7..f75f37963c 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" ); |