From: Jarkko Hietaniemi Date: Wed, 27 Jun 2001 19:55:16 +0000 (+0000) Subject: The Test::More and Test::Simple tests required help X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=12b8e1e4619e2f84702749a446aad4e8d554b7ed;p=p5sagit%2Fp5-mst-13.2.git The Test::More and Test::Simple tests required help thanks to our schizophrenic test scheme. p4raw-id: //depot/perl@10994 --- diff --git a/lib/Test/More/t/fail-like.t b/lib/Test/More/t/fail-like.t index 9bac0af..98564fd 100644 --- a/lib/Test/More/t/fail-like.t +++ b/lib/Test/More/t/fail-like.t @@ -35,7 +35,7 @@ sub ok ($;$) { package main; require Test::More; -push @INC, 't', '.'; +@INC = ('../lib', 'lib/Test/More'); require Catch; my($out, $err) = Catch::caught(); diff --git a/lib/Test/More/t/fail.t b/lib/Test/More/t/fail.t index d684e65..9645e2b 100644 --- a/lib/Test/More/t/fail.t +++ b/lib/Test/More/t/fail.t @@ -22,7 +22,7 @@ sub ok ($;$) { package main; require Test::More; -push @INC, 't', '.'; +@INC = ('../lib', 'lib/Test/More'); require Catch; my($out, $err) = Catch::caught(); diff --git a/lib/Test/More/t/plan_is_noplan.t b/lib/Test/More/t/plan_is_noplan.t index 29ccd6b..b0c031e 100644 --- a/lib/Test/More/t/plan_is_noplan.t +++ b/lib/Test/More/t/plan_is_noplan.t @@ -21,7 +21,7 @@ package main; require Test::More; -push @INC, 't', '.'; +@INC = ('../lib', 'lib/Test/More'); require Catch; my($out, $err) = Catch::caught(); diff --git a/lib/Test/More/t/skipall.t b/lib/Test/More/t/skipall.t index bfee83d..ff7607d 100644 --- a/lib/Test/More/t/skipall.t +++ b/lib/Test/More/t/skipall.t @@ -22,7 +22,7 @@ sub ok ($;$) { package main; require Test::More; -push @INC, 't', '.'; +@INC = ('../lib', 'lib/Test/More'); require Catch; my($out, $err) = Catch::caught(); diff --git a/lib/Test/Simple/t/exit.t b/lib/Test/Simple/t/exit.t index 7247a0c..dac5c48 100644 --- a/lib/Test/Simple/t/exit.t +++ b/lib/Test/Simple/t/exit.t @@ -33,8 +33,13 @@ my %Tests = ( print "1..".keys(%Tests)."\n"; chdir 't' if -d 't'; +use File::Spec; +my $lib = File::Spec->catdir('lib', 'Test', 'Simple', 'sample_tests'); while( my($test_name, $exit_code) = each %Tests ) { - my $wait_stat = system(qq{$^X -"I../blib/lib" sample_tests/$test_name}); + my $file = File::Spec->catfile($lib, $test_name); + my $wait_stat = system(qq{$^X -"I../lib" -"Ilib/Test/Simple" $file}); My::Test::ok( $wait_stat >> 8 == $exit_code, "$test_name exited with $exit_code" ); } + + diff --git a/lib/Test/Simple/t/extra.t b/lib/Test/Simple/t/extra.t index ba04517..d2161e3 100644 --- a/lib/Test/Simple/t/extra.t +++ b/lib/Test/Simple/t/extra.t @@ -21,7 +21,7 @@ package main; require Test::Simple; -push @INC, 't', '.'; +@INC = ('../lib', 'lib/Test/Simple'); require Catch; my($out, $err) = Catch::caught(); diff --git a/lib/Test/Simple/t/fail.t b/lib/Test/Simple/t/fail.t index c0bd42e..a291588 100644 --- a/lib/Test/Simple/t/fail.t +++ b/lib/Test/Simple/t/fail.t @@ -23,7 +23,7 @@ package main; require Test::Simple; -push @INC, 't', '.'; +@INC = ('../lib', 'lib/Test/Simple'); require Catch; my($out, $err) = Catch::caught(); diff --git a/lib/Test/Simple/t/missing.t b/lib/Test/Simple/t/missing.t index 867639b..711dbb4 100644 --- a/lib/Test/Simple/t/missing.t +++ b/lib/Test/Simple/t/missing.t @@ -21,7 +21,7 @@ package main; require Test::Simple; -push @INC, 't', '.'; +@INC = ('../lib', 'lib/Test/Simple'); require Catch; my($out, $err) = Catch::caught(); diff --git a/lib/Test/Simple/t/no_plan.t b/lib/Test/Simple/t/no_plan.t index 9e4290b..327f3ca 100644 --- a/lib/Test/Simple/t/no_plan.t +++ b/lib/Test/Simple/t/no_plan.t @@ -21,7 +21,7 @@ package main; require Test::Simple; -push @INC, 't', '.'; +@INC = ('../lib', 'lib/Test/Simple'); require Catch; my($out, $err) = Catch::caught(); diff --git a/lib/Test/Simple/t/plan_is_noplan.t b/lib/Test/Simple/t/plan_is_noplan.t index 8cf11c5..0e49605 100644 --- a/lib/Test/Simple/t/plan_is_noplan.t +++ b/lib/Test/Simple/t/plan_is_noplan.t @@ -30,7 +30,7 @@ package main; require Test::Simple; -push @INC, 't', '.'; +@INC = ('../lib', 'lib/Test/Simple'); require Catch; my($out, $err) = Catch::caught();