Commit | Line | Data |
ccbd73a4 |
1 | #!perl -w |
ccbd73a4 |
2 | |
3 | BEGIN { |
4 | if( $ENV{PERL_CORE} ) { |
5 | chdir 't'; |
6 | @INC = '../lib'; |
7 | } |
8 | } |
9 | |
10 | # Can't use Test.pm, that's a 5.005 thing. |
11 | package My::Test; |
12 | |
13 | # This has to be a require or else the END block below runs before |
14 | # Test::Builder's own and the ending diagnostics don't come out right. |
15 | require Test::Builder; |
16 | my $TB = Test::Builder->create; |
17 | $TB->plan(tests => 3); |
18 | |
19 | |
20 | package main; |
21 | |
22 | require Test::Simple; |
23 | |
24 | chdir 't'; |
25 | push @INC, '../t/lib/'; |
26 | require Test::Simple::Catch; |
27 | my($out, $err) = Test::Simple::Catch::caught(); |
28 | local $ENV{HARNESS_ACTIVE} = 0; |
29 | |
30 | Test::Simple->import(tests => 1); |
31 | |
32 | END { |
33 | $TB->is_eq($out->read, <<OUT); |
34 | 1..1 |
35 | OUT |
36 | |
37 | $TB->is_eq($err->read, <<ERR); |
38 | # No tests run! |
39 | ERR |
40 | |
41 | $TB->is_eq($?, 255, "exit code"); |
42 | |
43 | exit grep { !$_ } $TB->summary; |
44 | } |