1#!/usr/bin/perl -w
2
3# Test that env vars are 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
17# HARNESS_PERL_SWITCHES
18
19my $test_template = <<'END';
20#!/usr/bin/perl
21
22use Test::More tests => 1;
23
24is $ENV{HARNESS_PERL_SWITCHES}, '-w';
25END
26
27open TEST, ">env_check_t.tmp";
28print TEST $test_template;
29close TEST;
30
31END { 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
401;
41