1use warnings;
2use strict;
3use File::Spec;
4use Config;
5
6# operation of File::Temp under taint-check is broken for 'MSWin32' with non-user writable root directory (default for Win8+)
7# ... here File::Temp is required by Capture::Tiny in 'basic.t'
8# ... fix for File::Temp is committed but not distributed
9# ... ref: [RT#60340](https://rt.cpan.org/Ticket/Display.html?id=60340)
10# ToDO: revisit after File::Temp > v0.2302 is released
11if ('MSWin32' eq $^O) {
12    print "1..0 # SKIP broken (by File::Temp) on many 'MSWin32' platforms...\n";
13    exit 0;
14}
15
16# there is talk of possible perl compilations where -T is a fatal
17# we don't want to have the user deal with that
18system( $^X => -T => -e => 'use warnings; use strict; exit 0' );
19if ($?) {
20    print "1..0 # SKIP Your perl does not seem to like -T...\n";
21    exit 0;
22}
23
24# Taint mode ignores PERL5LIB, we have to convert to -I switches just
25# like Test::Harness does
26my @lib_switches;
27for my $env ( grep { defined $ENV{$_} } (qw/PERL5LIB PERLLIB/) ) {
28    push @lib_switches,
29      map { "-I$_" } grep { length($_) } split /\Q$Config{path_sep}\E/, $ENV{$env};
30}
31
32# all is well - just rerun the basic test
33exec( $^X => -T => @lib_switches =>
34      File::Spec->catpath( ( File::Spec->splitpath(__FILE__) )[ 0, 1 ], 'basic.t' ) );
35