Debian Codegraph @

cpan/Test-Harness/t/compat/subclass.t

raw
1 #!/usr/bin/perl -w
2
3 # Test that HARNESS_SUBCLASS env var is honoured.
4
5 use strict;
6 use warnings;
7 use lib 't/lib';
8
9 use Test::More (
10 $^O eq 'VMS'
11 ? ( skip_all => 'VMS' )
12 : ( tests => 1 )
13 );
14
15 use Test::Harness;
16
17 my $test_template = <<'END';
18 #!/usr/bin/perl
19
20 use Test::More tests => 1;
21
22 is $ENV{HARNESS_IS_SUBCLASS}, 'TAP::Harness::TestSubclass';
23 END
24
25 my $tempfile = "_check_subclass_t.tmp";
26 open TEST, ">$tempfile";
27 print TEST $test_template;
28 close TEST;
29
30 END { unlink $tempfile; }
31
32 {
33 local $ENV{HARNESS_SUBCLASS} = 'TAP::Harness::TestSubclass';
34 my ( $tot, $failed )
35 = Test::Harness::execute_tests( tests => [$tempfile] );
36 is $tot->{bad}, 0;
37 }
38
39 1;