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