1#!/usr/bin/perl -w
2
3# Test that HARNESS_SUBCLASS env var is honoured.
4
5use strict;
6use warnings;
7use lib 't/lib';
8
9use Test::More (
10    $^O eq 'VMS'
11    ? ( skip_all => 'VMS' )
12    : ( tests => 1 )
13);
14
15use Test::Harness;
16
17my $test_template = <<'END';
18#!/usr/bin/perl
19
20use Test::More tests => 1;
21
22is $ENV{HARNESS_IS_SUBCLASS}, 'TAP::Harness::TestSubclass';
23END
24
25my $tempfile = "_check_subclass_t.tmp";
26open TEST, ">$tempfile";
27print TEST $test_template;
28close TEST;
29
30END { 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
391;
40