summaryrefslogtreecommitdiff
path: root/lib/Test
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@gmail.com>2006-06-12 14:35:22 +0000
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2006-06-12 14:35:22 +0000
commite77388947cb2bf6620678b8c9693537e8c7df7e6 (patch)
tree670a26d814baaeb3efee93107314d547e798280b /lib/Test
parentfe2ae5081bc2e29bed890e921179e594deb788ec (diff)
downloadperl-e77388947cb2bf6620678b8c9693537e8c7df7e6.tar.gz
Adapt the new Test::Harness test to the core
p4raw-id: //depot/perl@28386
Diffstat (limited to 'lib/Test')
-rw-r--r--lib/Test/Harness/t/failure.t10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/Test/Harness/t/failure.t b/lib/Test/Harness/t/failure.t
index 0e1b783acd..9505532459 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" );