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