From: Dagfinn Ilmari Mannsåker Date: Tue, 24 Jul 2012 17:09:19 +0000 (+0100) Subject: Actually detect errors in pure-perl test X-Git-Tag: Devel-GlobalDestruction-0.07~2 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=6d3e0a6f835b971f8e877688998699a9dd7c688e;p=p5sagit%2FDevel-GlobalDestruction.git Actually detect errors in pure-perl test --- diff --git a/Changes b/Changes index 7c56904..8aabdb5 100644 --- a/Changes +++ b/Changes @@ -1,3 +1,5 @@ + * Actually detect errors in pure-perl test + 0.06 Thu, 14 Jun 2012 * De-retardize XS-less behavior under SpeedyCGI * Test suite now works from within space-containing paths diff --git a/t/01_basic.t b/t/01_basic.t index 5a6bdcf..c16cab3 100644 --- a/t/01_basic.t +++ b/t/01_basic.t @@ -21,8 +21,10 @@ BEGIN { print "1..4\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"; diff --git a/t/10_pure-perl.t b/t/10_pure-perl.t index 8342391..47bfbc2 100644 --- a/t/10_pure-perl.t +++ b/t/10_pure-perl.t @@ -16,8 +16,10 @@ my $this_file = quotemeta(__FILE__); my @tests = grep { $_ !~ /${this_file}$/ } bsd_glob("$Bin/*.t"); 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"; @@ -36,4 +38,3 @@ for my $fn (@tests) { wait; ok (! $?, "Exit $? from: $^X $fn"); } -