Upgrade to Test-Simple-0.82.
[p5sagit/p5-mst-13.2.git] / lib / Test / Simple / t / died.t
1 #!perl -w
2 # $Id: /mirror/googlecode/test-more/t/died.t 60310 2008-09-07T23:47:22.837229Z schwern  $
3
4 BEGIN {
5     if( $ENV{PERL_CORE} ) {
6         chdir 't';
7         @INC = '../lib';
8     }
9 }
10
11 # Can't use Test.pm, that's a 5.005 thing.
12 package My::Test;
13
14 # This has to be a require or else the END block below runs before
15 # Test::Builder's own and the ending diagnostics don't come out right.
16 require Test::Builder;
17 my $TB = Test::Builder->create;
18 $TB->plan(tests => 3);
19
20
21 package main;
22
23 require Test::Simple;
24
25 chdir 't';
26 push @INC, '../t/lib/';
27 require Test::Simple::Catch;
28 my($out, $err) = Test::Simple::Catch::caught();
29 local $ENV{HARNESS_ACTIVE} = 0;
30
31 Test::Simple->import(tests => 1);
32 exit 250;
33
34 END {
35     $TB->is_eq($out->read, <<OUT);
36 1..1
37 OUT
38
39     $TB->is_eq($err->read, <<ERR);
40 # Looks like your test exited with 250 before it could output anything.
41 ERR
42
43     $TB->is_eq($?, 250, "exit code");
44
45     exit grep { !$_ } $TB->summary;
46 }