Commit | Line | Data |
4befcbc3 |
1 | use strict; |
2 | use warnings; |
3 | use Test::More; |
4 | |
5 | use B::Hooks::EndOfScope::WithFallback; |
6 | |
7 | plan skip_all => "Tests already executed in pure-perl mode" |
8 | unless B::Hooks::EndOfScope::WithFallback::__HAS_VM; |
9 | |
10 | eval { require Devel::Hide } |
11 | or plan skip_all => "Devel::Hide required for this test in presence of Variable::Magic"; |
12 | |
13 | use Config; |
14 | use FindBin qw($Bin); |
15 | use IPC::Open2 qw(open2); |
16 | |
17 | # for the $^X-es |
18 | $ENV{PERL5LIB} = join ($Config{path_sep}, @INC); |
19 | |
20 | # rerun the tests under the assumption of no vm at all |
21 | |
22 | for my $fn (glob("$Bin/*.t")) { |
23 | next if $fn =~ /test_without_/; |
24 | |
25 | local $ENV{DEVEL_HIDE_VERBOSE} = 0; |
26 | note "retesting $fn"; |
27 | my @cmd = ( $^X, '-MDevel::Hide=Variable::Magic', $fn ); |
28 | |
29 | # this is cheating, and may even hang here and there (testing on windows passed fine) |
30 | # if it does - will have to fix it somehow (really *REALLY* don't want to pull |
31 | # in IPC::Cmd just for a fucking test) |
32 | # the alternative would be to have an ENV check in each test to force a subtest |
33 | open2(my $out, my $in, @cmd); |
34 | while (my $ln = <$out>) { |
35 | print " $ln"; |
36 | } |
37 | |
38 | wait; |
39 | ok (! $?, "Exit $? from: @cmd"); |
40 | } |
41 | |
42 | done_testing; |