Debian Codegraph @

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

raw
1 #!/usr/bin/perl -w
2
3 # Test that env vars are 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 # HARNESS_PERL_SWITCHES
18
19 my $test_template = <<'END';
20 #!/usr/bin/perl
21
22 use Test::More tests => 1;
23
24 is $ENV{HARNESS_PERL_SWITCHES}, '-w';
25 END
26
27 open TEST, ">env_check_t.tmp";
28 print TEST $test_template;
29 close TEST;
30
31 END { unlink 'env_check_t.tmp'; }
32
33 {
34 local $ENV{HARNESS_PERL_SWITCHES} = '-w';
35 my ( $tot, $failed )
36 = Test::Harness::execute_tests( tests => ['env_check_t.tmp'] );
37 is $tot->{bad}, 0;
38 }
39
40 1;