From 15db8fc4040f40c74bf7ab626bbe4a44cc833b6b Mon Sep 17 00:00:00 2001 From: Jarkko Hietaniemi Date: Thu, 6 Sep 2001 13:08:48 +0000 Subject: [PATCH] Rewhack Test-Simple into core harness. p4raw-id: //depot/perl@11912 --- lib/Test/Simple/t/exit.t | 12 +++++++++++- lib/Test/Simple/t/extra.t | 13 +++++++------ lib/Test/Simple/t/fail-like.t | 7 ++++++- lib/Test/Simple/t/fail-more.t | 7 ++++++- lib/Test/Simple/t/fail.t | 13 +++++++------ lib/Test/Simple/t/missing.t | 13 ++++++++----- lib/Test/Simple/t/no_plan.t | 8 +++++++- lib/Test/Simple/t/plan_is_noplan.t | 2 +- lib/Test/Simple/t/skipall.t | 7 ++++++- 9 files changed, 59 insertions(+), 23 deletions(-) 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 <