+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;
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,
+BEGIN {
+ chdir 't' if -d 't';
+ @INC = '../lib';
+}
+
# Can't use Test.pm, that's a 5.005 thing.
package My::Test;
require Test::Simple;
-push @INC, 't/lib/';
+push @INC, '../t/lib';
require Test::Simple::Catch;
my($out, $err) = Test::Simple::Catch::caught();
not ok 5 - Sar
OUT
- My::Test::ok($$err eq <<ERR);
-# Failed test ($0 at line 31)
-# Failed test ($0 at line 34)
-# Looks like you planned 3 tests but ran 2 extra.
-ERR
+ My::Test::ok($$err =~ /Looks like you planned 3 tests but ran 2 extra/);
exit 0;
}
use strict;
+BEGIN {
+ chdir 't' if -d 't';
+ @INC = '../lib';
+}
+
# Can't use Test.pm, that's a 5.005 thing.
package My::Test;
require Test::More;
-push @INC, 't/lib';
+push @INC, '../t/lib';
require Test::Simple::Catch::More;
my($out, $err) = Test::Simple::Catch::More::caught();
use strict;
+BEGIN {
+ chdir 't' if -d 't';
+ @INC = '../lib';
+}
+
# Can't use Test.pm, that's a 5.005 thing.
package My::Test;
require Test::More;
-push @INC, 't/lib';
+push @INC, '../t/lib';
require Test::Simple::Catch::More;
my($out, $err) = Test::Simple::Catch::More::caught();
use strict;
+BEGIN {
+ chdir 't' if -d 't';
+ @INC = '../lib';
+}
+
# Can't use Test.pm, that's a 5.005 thing.
package My::Test;
require Test::Simple;
-push @INC, 't/lib';
+push @INC, '../t/lib';
require Test::Simple::Catch;
my($out, $err) = Test::Simple::Catch::caught();
not ok 5 - damnit
OUT
- My::Test::ok($$err eq <<ERR);
-# Failed test ($0 at line 35)
-# Failed test ($0 at line 36)
-# Looks like you failed 2 tests of 5.
-ERR
+ My::Test::ok($$err =~ /Looks like you failed 2 tests of 5/;
# Prevent Test::Simple from exiting with non zero
exit 0;
# Can't use Test.pm, that's a 5.005 thing.
+
+BEGIN {
+ chdir 't' if -d 't';
+ @INC = '../lib';
+}
+
package My::Test;
print "1..2\n";
require Test::Simple;
-push @INC, 't/lib';
+push @INC, '../t/lib';
require Test::Simple::Catch;
my($out, $err) = Test::Simple::Catch::caught();
not ok 2 - Bar
OUT
- My::Test::ok($$err eq <<ERR);
-# Failed test ($0 at line 31)
-# Looks like you planned 5 tests but only ran 2.
-ERR
+ My::Test::ok($$err =~ /Looks like you planned 5 tests but only ran 2/);
exit 0;
}
# Can't use Test.pm, that's a 5.005 thing.
+
+BEGIN {
+ chdir 't' if -d 't';
+ @INC = '../lib';
+}
+
package My::Test;
print "1..12\n";
require Test::Simple;
-push @INC, 't/lib';
+push @INC, '../t/lib';
require Test::Simple::Catch;
my($out, $err) = Test::Simple::Catch::caught();
require Test::Simple;
-push @INC, 't/lib';
+push @INC, '../t/lib';
require Test::Simple::Catch::More;
my($out, $err) = Test::Simple::Catch::More::caught();
use strict;
+BEGIN {
+ chdir 't' if -d 't';
+ @INC = '../lib';
+}
+
# Can't use Test.pm, that's a 5.005 thing.
package My::Test;
package main;
require Test::More;
-push @INC, 't/lib';
+push @INC, '../t/lib';
require Test::Simple::Catch::More;
my($out, $err) = Test::Simple::Catch::More::caught();