This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Add $Tests_Are_Passing to test.pl, analogous to Test::Builder's is_passing().
authorNicholas Clark <nick@ccl4.org>
Tue, 14 Dec 2010 16:58:10 +0000 (16:58 +0000)
committerNicholas Clark <nick@ccl4.org>
Tue, 14 Dec 2010 16:59:53 +0000 (16:59 +0000)
t/test.pl

index a558820..5f8eb98 100644 (file)
--- a/t/test.pl
+++ b/t/test.pl
@@ -26,6 +26,7 @@ my $Perl;       # Safer version of $^X set by which_perl()
 
 $TODO = 0;
 $NO_ENDING = 0;
+$Tests_Are_Passing = 1;
 
 # Use this instead of print to avoid interference while testing globals.
 sub _print {
@@ -122,7 +123,12 @@ sub _ok {
        $out = $pass ? "ok $test" : "not ok $test";
     }
 
-    $out = $out . " # TODO $TODO" if $TODO;
+    if ($TODO) {
+       $out = $out . " # TODO $TODO";
+    } else {
+       $Tests_Are_Passing = 0 unless $pass;
+    }
+
     _print "$out\n";
 
     unless ($pass) {