bump version
[p5sagit/Devel-GlobalDestruction.git] / t / 10_pure-perl.t
index 841073a..3246c03 100644 (file)
@@ -12,11 +12,14 @@ $ENV{DEVEL_GLOBALDESTRUCTION_PP_TEST} = 1;
 
 my $this_file = quotemeta(__FILE__);
 
-my @tests = grep { $_ !~ /${this_file}$/ } glob("$Bin/*.t");
+opendir(my $dh, $Bin);
+my @tests = grep { $_ !~ /${this_file}$/ } map { "$Bin/$_" } grep { /\.t$/ } readdir $dh;
 print "1..@{[ scalar @tests ]}\n";
 
+my $had_error = 0;
+END { $? = $had_error }
 sub ok ($$) {
-  print "not " if !$_[0];
+  $had_error++, print "not " if !$_[0];
   print "ok";
   print " - $_[1]" if defined $_[1];
   print "\n";
@@ -35,4 +38,3 @@ for my $fn (@tests) {
   wait;
   ok (! $?, "Exit $? from: $^X $fn");
 }
-