From: Rafael Garcia-Suarez Date: Mon, 12 Jun 2006 14:35:22 +0000 (+0000) Subject: Adapt the new Test::Harness test to the core X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=e77388947cb2bf6620678b8c9693537e8c7df7e6;p=p5sagit%2Fp5-mst-13.2.git Adapt the new Test::Harness test to the core p4raw-id: //depot/perl@28386 --- diff --git a/lib/Test/Harness/t/failure.t b/lib/Test/Harness/t/failure.t index 0e1b783..9505532 100644 --- a/lib/Test/Harness/t/failure.t +++ b/lib/Test/Harness/t/failure.t @@ -13,6 +13,7 @@ BEGIN { use strict; use Test::More tests => 6; +use File::Spec; BEGIN { use_ok( 'Test::Harness' ); @@ -22,10 +23,15 @@ my $died; sub prepare_for_death { $died = 0; } sub signal_death { $died = 1; } +my $Curdir = File::Spec->curdir; +my $SAMPLE_TESTS = $ENV{PERL_CORE} + ? File::Spec->catdir($Curdir, 'lib', 'sample-tests') + : File::Spec->catdir($Curdir, 't', 'sample-tests'); + PASSING: { local $SIG{__DIE__} = \&signal_death; prepare_for_death(); - eval { runtests( "t/sample-tests/simple" ) }; + eval { runtests( File::Spec->catfile( $SAMPLE_TESTS, "simple" ) ) }; ok( !$@, "simple lives" ); is( $died, 0, "Death never happened" ); } @@ -33,7 +39,7 @@ PASSING: { FAILING: { local $SIG{__DIE__} = \&signal_death; prepare_for_death(); - eval { runtests( "t/sample-tests/too_many" ) }; + eval { runtests( File::Spec->catfile( $SAMPLE_TESTS, "too_many" ) ) }; ok( $@, "$@" ); ok( $@ =~ m[Failed 1/1], "too_many dies" ); is( $died, 1, "Death happened" );