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