From: Jarkko Hietaniemi Date: Thu, 6 Sep 2001 13:08:48 +0000 (+0000) Subject: Rewhack Test-Simple into core harness. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=15db8fc4040f40c74bf7ab626bbe4a44cc833b6b;p=p5sagit%2Fp5-mst-13.2.git Rewhack Test-Simple into core harness. p4raw-id: //depot/perl@11912 --- diff --git a/lib/Test/Simple/t/exit.t b/lib/Test/Simple/t/exit.t index 27bf1fb..86954ab 100644 --- a/lib/Test/Simple/t/exit.t +++ b/lib/Test/Simple/t/exit.t @@ -1,3 +1,9 @@ +BEGIN { + chdir 't' if -d 't'; + @INC = '../lib'; + use File::Spec; +} + # Can't use Test.pm, that's a 5.005 thing. package My::Test; @@ -37,10 +43,14 @@ my %Tests = ( print "1..".keys(%Tests)."\n"; +my $lib = File::Spec->catdir('lib', 'Test', 'Simple', 'sample_tests'); + while( my($test_name, $exit_codes) = each %Tests ) { my($exit_code) = $exit_codes->[$IsVMS ? 1 : 0]; - my $wait_stat = system(qq{$^X t/lib/Test/Simple/sample_tests/$test_name}); + my $file = File::Spec->catfile($lib, $test_name); + + my $wait_stat = system(qq{$^X -"I../lib" -"I../t/lib" $file}); my $actual_exit = $wait_stat >> 8; My::Test::ok( $actual_exit == $exit_code, diff --git a/lib/Test/Simple/t/extra.t b/lib/Test/Simple/t/extra.t index 0df2c40..9d54894 100644 --- a/lib/Test/Simple/t/extra.t +++ b/lib/Test/Simple/t/extra.t @@ -1,3 +1,8 @@ +BEGIN { + chdir 't' if -d 't'; + @INC = '../lib'; +} + # Can't use Test.pm, that's a 5.005 thing. package My::Test; @@ -21,7 +26,7 @@ package main; require Test::Simple; -push @INC, 't/lib/'; +push @INC, '../t/lib'; require Test::Simple::Catch; my($out, $err) = Test::Simple::Catch::caught(); @@ -43,11 +48,7 @@ ok 4 - Car not ok 5 - Sar OUT - My::Test::ok($$err eq <