Upgrade to Test::Harness 2.56
Steve Peters [Wed, 28 Sep 2005 22:59:08 +0000 (22:59 +0000)]
p4raw-id: //depot/perl@25649

MANIFEST
lib/Test/Harness.pm
lib/Test/Harness/Changes
lib/Test/Harness/Straps.pm
lib/Test/Harness/TAP.pod
lib/Test/Harness/bin/prove
lib/Test/Harness/t/test-harness.t
t/lib/sample-tests/bignum
t/lib/sample-tests/bignum_many [new file with mode: 0644]

index c038ab4..f0c34a4 100644 (file)
--- a/MANIFEST
+++ b/MANIFEST
@@ -2732,6 +2732,7 @@ t/lib/Math/BigRat/Test.pm         Math::BigRat test helper
 t/lib/NoExporter.pm                    Part of Test-Simple
 t/lib/sample-tests/bailout             Test data for Test::Harness
 t/lib/sample-tests/bignum              Test data for Test::Harness
+t/lib/sample-tests/bignum_many          Test data for Test::Harness
 t/lib/sample-tests/combined            Test data for Test::Harness
 t/lib/sample-tests/descriptive         Test data for Test::Harness
 t/lib/sample-tests/die                 Test data for Test::Harness
index 05a3e1c..a53049c 100644 (file)
@@ -35,11 +35,11 @@ Test::Harness - Run Perl standard test scripts with statistics
 
 =head1 VERSION
 
-Version 2.52
+Version 2.56
 
 =cut
 
-$VERSION = "2.52";
+$VERSION = "2.56";
 
 # Backwards compatibility for exportable variable names.
 *verbose  = *Verbose;
index cb6cf4f..f9a8d34 100644 (file)
@@ -1,5 +1,29 @@
 Revision history for Perl extension Test::Harness
 
+2.56 Wed Sep 28 16:04:00 CDT 2005
+    [FIXES]
+    * Incorporate bleadperl patch to fix Test::Harness on VMS.
+
+2.54 Wed Sep 28 09:52:19 CDT 2005
+    [FIXES]
+    * Test counts were wrong, so wouldn't install on Perls < 5.8.0.
+
+2.53_02 Thu Aug 25 21:37:01 CDT 2005
+    [FIXES]
+    * File order in prove is now sorted within the directory.  It's not
+      the sorting that's important as much as the deterministic results.
+      Thanks to Adam Kennedy and Casey West for pointing this out,
+      independently of each other, with 12 hours of the other.
+
+    [INTERNALS]
+    * Fix calls to podusage() to not use the DATA typeglob.  Thanks sungo.
+
+2.53_01 Sun Jul 10 10:45:27 CDT 2005
+    [FIXES]
+    * If we go over 100,000 tests, it used to print out a warning for
+      every test over 100,000.  Now, we stop after the first.  Thanks to
+      Sebastien Aperghis-Tramoni.
+
 2.52 Sun Jun 26 23:05:19 CDT 2005
     No changes
 
index 59f8e60..d561ea4 100644 (file)
@@ -3,7 +3,7 @@ package Test::Harness::Straps;
 
 use strict;
 use vars qw($VERSION);
-$VERSION = '0.23';
+$VERSION = '0.26';
 
 use Config;
 use Test::Harness::Assert;
@@ -185,9 +185,11 @@ sub _analyze_line {
 
         $totals->{ok}++ if $point->pass;
 
-        if ( ($point->number > 100000) && ($point->number > $self->{max}) ) {
-            warn "Enormous test number seen [test ", $point->number, "]\n";
-            warn "Can't detailize, too big.\n";
+        if ( ($point->number > 100_000) && ($point->number > ($self->{max}||100_000)) ) {
+            if ( !$self->{too_many_tests}++ ) {
+                warn "Enormous test number seen [test ", $point->number, "]\n";
+                warn "Can't detailize, too big.\n";
+            }
         }
         else {
             my $details = {
@@ -602,7 +604,7 @@ etc. so it's ready to parse the next file.
 sub _reset_file_state {
     my($self) = shift;
 
-    delete @{$self}{qw(max skip_all todo)};
+    delete @{$self}{qw(max skip_all todo too_many_tests)};
     $self->{line}       = 0;
     $self->{saw_header} = 0;
     $self->{saw_bailout}= 0;
index fa80478..6dd0a96 100644 (file)
@@ -200,6 +200,7 @@ ignore, at least as far as analyzing the test results.  The harness is
 free, however, to display the diagnostics.  Typically diagnostics are
 used to provide information about the environment in which test file is
 running, or to delineate a group of tests.
+
     ...
     ok 18 - Closed database connection
     # End of database section.
index ee62afb..cd5b704 100644 (file)
@@ -32,8 +32,8 @@ GetOptions(
     'b|blib'        => \$blib,
     'd|debug'       => \$Test::Harness::debug,
     'D|dry'         => \$dry,
-    'h|help|?'      => sub {pod2usage({-verbose => 1, -input => \*DATA}); exit},
-    'H|man'         => sub {pod2usage({-verbose => 2, -input => \*DATA}); exit},
+    'h|help|?'      => sub {pod2usage({-verbose => 1}); exit},
+    'H|man'         => sub {pod2usage({-verbose => 2}); exit},
     'I=s@'          => \@includes,
     'l|lib'         => \$lib,
     'r|recurse'     => \$recurse,
@@ -96,7 +96,9 @@ sub all_in {
 
     local *DH;
     if ( opendir( DH, $start ) ) {
-        while ( my $file = readdir DH ) {
+        my @files = sort readdir DH;
+        closedir DH;
+        for my $file ( @files ) {
             next if $file eq File::Spec->updir || $file eq File::Spec->curdir;
             next if $file eq ".svn";
             next if $file eq "CVS";
index d07c432..7a4e6b8 100644 (file)
@@ -417,6 +417,24 @@ my %samples = (
                                             },
                                   all_ok => 0,
                                  },
+            bignum_many       => {
+                                  total => {
+                                            bonus      => 0,
+                                            max        => 2,
+                                            'ok'       => 11,
+                                            files      => 1,
+                                            bad        => 1,
+                                            good       => 0,
+                                            tests      => 1,
+                                            sub_skipped=> 0,
+                                            'todo'     => 0,
+                                            skipped    => 0,
+                                           },
+                                  failed => {
+                                             canon      => '3-100000',
+                                            },
+                                  all_ok => 0,
+                                 },
             'shbang_misparse' => {
                                   total => {
                                             bonus      => 0,
@@ -469,7 +487,7 @@ my %samples = (
                                  },
            );
 
-plan tests => (keys(%samples) * 8);
+plan tests => (keys(%samples) * 7);
 
 use Test::Harness;
 my @_INC = map { qq{"-I$_"} } @INC;
@@ -479,7 +497,7 @@ tie *NULL, 'Dev::Null' or die $!;
 
 for my $test ( sort keys %samples ) {
 SKIP: {
-    skip "-t introduced in 5.8.0", 8 if $test eq 'taint_warn' and $] < 5.008;
+    skip "-t introduced in 5.8.0", 7 if $test eq 'taint_warn' and $] < 5.008;
 
     my $expect = $samples{$test};
 
@@ -520,20 +538,20 @@ SKIP: {
                                                   "$test - failed" );
     }
 
-    SKIP: {
-        skip "special tests for bignum", 1 unless $test eq 'bignum';
-        is( $warning, <<WARN );
-Enormous test number seen [test 100001]
-Can't detailize, too big.
+    my $expected_warnings = "";
+    if ( $test eq "bignum" ) {
+        $expected_warnings = <<WARN;
 Enormous test number seen [test 136211425]
 Can't detailize, too big.
 WARN
-
     }
-
-    SKIP: {
-        skip "bignum has known warnings", 1 if $test eq 'bignum';
-        is( $warning, '' );
+    elsif ( $test eq 'bignum_many' ) {
+        $expected_warnings = <<WARN;
+Enormous test number seen [test 100001]
+Can't detailize, too big.
+WARN
     }
-}
-}
+    my $desc = $expected_warnings ? 'Got proper warnings' : 'No warnings';
+    is( $warning, $expected_warnings, "$test - $desc" );
+} # taint SKIP block
+} # for tests
index 3f51d38..b5824a1 100644 (file)
@@ -2,6 +2,6 @@ print <<DUMMY;
 1..2
 ok 1
 ok 2
-ok 100001
 ok 136211425
+ok 136211426
 DUMMY
diff --git a/t/lib/sample-tests/bignum_many b/t/lib/sample-tests/bignum_many
new file mode 100644 (file)
index 0000000..1e30b2f
--- /dev/null
@@ -0,0 +1,14 @@
+print <<DUMMY;
+1..2
+ok 1
+ok 2
+ok 99997
+ok 99998
+ok 99999
+ok 100000
+ok 100001
+ok 100002
+ok 100003
+ok 100004
+ok 100005
+DUMMY