This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
In fold_grind.t only report OK for each charset/target combination
authorDavid Leadbeater <dgl@dgl.cx>
Wed, 9 Mar 2011 00:48:24 +0000 (16:48 -0800)
committerFather Chrysostomos <sprout@cpan.org>
Wed, 9 Mar 2011 06:39:16 +0000 (22:39 -0800)
This brings the number of tests down significantly and due to the
reduced amount of printing the runtime too. Failing tests are still
reported and a complete run can be enabled by setting
$ENV{PERL_DEBUG_FULL_TEST} to a true value.

t/re/fold_grind.t

index 5a8a7b4..0a848f9 100644 (file)
@@ -46,6 +46,11 @@ my $Unicode = 3;
 # set.
 my $skip_apparently_redundant = ! $ENV{PERL_RUN_SLOW_TESTS};
 
+# Additionally parts of this test run a lot of subtests, outputting the
+# resulting TAP can be expensive so the tests are summarised internally. The
+# PERL_DEBUG_FULL_TEST environment variable can be set to produce the full
+# output for debugging purposes.
+
 sub range_type {
     my $ord = shift;
 
@@ -418,6 +423,9 @@ foreach my $test (sort { numerically } keys %tests) {
           # XXX Doesn't currently test multi-char folds in pattern
           next if @pattern != 1;
 
+          my $okays = 0;
+          my $this_iteration = 0;
+
           foreach my $bracketed (0, 1) {   # Put rhs in [...], or not
             foreach my $inverted (0,1) {
                 next if $inverted && ! $bracketed;  # inversion only valid in [^...]
@@ -542,8 +550,15 @@ foreach my $test (sort { numerically } keys %tests) {
                           utf8::upgrade($p) if length($upgrade_pattern);
                           my $res = $op ? ($c =~ $p): ($c !~ $p);
 
-                          $count++;
-                          ok($res, $desc);
+                          if (!$res || $ENV{PERL_DEBUG_FULL_TEST}) {
+                            # Failed or debug; output the result
+                            $count++;
+                            ok($res, $desc);
+                          } else {
+                            # Just count the test as passed
+                            $okays++;
+                          }
+                          $this_iteration++;
                         }
                       }
                     }
@@ -552,6 +567,12 @@ foreach my $test (sort { numerically } keys %tests) {
               }
             }
           }
+
+          unless($ENV{PERL_DEBUG_FULL_TEST}) {
+            $count++;
+            is $okays, $this_iteration, "Subtests okay for "
+              .  "charset=$charset, utf8_pattern=$utf8_pattern";
+          }
         }
       }
     }