Commit | Line | Data |
9887772b |
1 | use strict; |
2 | use warnings; |
3 | use Test::More; |
4 | |
37f19e68 |
5 | plan skip_all => "PP tests already executed" |
6 | if $ENV{NAMESPACE_CLEAN_USE_PP}; |
7 | |
727a1a2f |
8 | eval { require Variable::Magic } |
9887772b |
9 | or plan skip_all => "PP tests already executed"; |
10 | |
727a1a2f |
11 | $ENV{B_HOOKS_ENDOFSCOPE_IMPLEMENTATION} = 'PP'; |
12 | require B::Hooks::EndOfScope; |
13 | ok( ($INC{'B/Hooks/EndOfScope/PP.pm'} && ! $INC{'B/Hooks/EndOfScope/XS.pm'}), |
14 | 'PP BHEOS loaded properly'); |
9887772b |
15 | |
16 | use Config; |
17 | use FindBin qw($Bin); |
18 | use IPC::Open2 qw(open2); |
e6eee479 |
19 | use File::Glob 'bsd_glob'; |
9887772b |
20 | |
21 | # for the $^X-es |
22 | $ENV{PERL5LIB} = join ($Config{path_sep}, @INC); |
23 | |
727a1a2f |
24 | |
9887772b |
25 | # rerun the tests under the assumption of pure-perl |
26 | my $this_file = quotemeta(__FILE__); |
27 | |
e6eee479 |
28 | for my $fn (bsd_glob("$Bin/*.t")) { |
9887772b |
29 | next if $fn =~ /${this_file}$/; |
30 | |
727a1a2f |
31 | my @cmd = ($^X, $fn); |
9887772b |
32 | |
33 | # this is cheating, and may even hang here and there (testing on windows passed fine) |
34 | # if it does - will have to fix it somehow (really *REALLY* don't want to pull |
35 | # in IPC::Cmd just for a fucking test) |
36 | # the alternative would be to have an ENV check in each test to force a subtest |
37 | open2(my $out, my $in, @cmd); |
38 | while (my $ln = <$out>) { |
39 | print " $ln"; |
40 | } |
41 | |
42 | wait; |
43 | ok (! $?, "Exit $? from: @cmd"); |
44 | } |
45 | |
46 | done_testing; |