Pureperlize
[p5sagit/Devel-GlobalDestruction.git] / t / 10_pure-perl.t
CommitLineData
9aaf3646 1use strict;
2use warnings;
3use FindBin qw($Bin);
4use Config;
5use IPC::Open2;
6
7# rerun the tests under the assumption of pure-perl
8
9# for the $^X-es
10$ENV{PERL5LIB} = join ($Config{path_sep}, @INC);
11$ENV{DEVEL_GLOBALDESTRUCTION_PP_TEST} = 1;
12
13my $this_file = quotemeta(__FILE__);
14
15my @tests = grep { $_ !~ /${this_file}$/ } glob("$Bin/*.t");
16print "1..@{[ scalar @tests ]}\n";
17
18sub ok ($$) {
19 print "not " if !$_[0];
20 print "ok";
21 print " - $_[1]" if defined $_[1];
22 print "\n";
23}
24
25for my $fn (@tests) {
26 # this is cheating, and may even hang here and there (testing on windows passed fine)
27 # if it does - will have to fix it somehow (really *REALLY* don't want to pull
28 # in IPC::Cmd just for a fucking test)
29 # the alternative would be to have an ENV check in each test to force a subtest
30 open2(my $out, my $in, $^X, $fn );
31 while (my $ln = <$out>) {
32 print " $ln";
33 }
34
35 wait;
36 ok (! $?, "Exit $? from: $^X $fn");
37}
38