Move Test::Simple from lib to ext.
[p5sagit/p5-mst-13.2.git] / ext / Test-Simple / t / died.t
CommitLineData
ccbd73a4 1#!perl -w
ccbd73a4 2
3BEGIN {
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.
11package 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.
15require Test::Builder;
16my $TB = Test::Builder->create;
17$TB->plan(tests => 3);
18
19
20package main;
21
22require Test::Simple;
23
24chdir 't';
25push @INC, '../t/lib/';
26require Test::Simple::Catch;
27my($out, $err) = Test::Simple::Catch::caught();
28local $ENV{HARNESS_ACTIVE} = 0;
29
30Test::Simple->import(tests => 1);
31exit 250;
32
33END {
34 $TB->is_eq($out->read, <<OUT);
351..1
36OUT
37
38 $TB->is_eq($err->read, <<ERR);
39# Looks like your test exited with 250 before it could output anything.
40ERR
41
42 $TB->is_eq($?, 250, "exit code");
43
44 exit grep { !$_ } $TB->summary;
45}