Subject: | Loads and loads of warnings when executing more than 100,000 test points |
Hello Andy,
As we discussed on IRC, Test::Harness prints screens of warnings when executing a test script with more than 100,000 test points:
Use of uninitialized value in numeric gt (>) at /usr/lib/perl5/5.8.5/Test/Harness/Straps.pm line 188, <FILE> line 100001.
Enormous test number seen [test 100001]
Can't detailize, too big.
As promised, I won't argue concerning than limit :-)
However, printing loads and loads of warnings is of no use. Plus the warning reveals a potential problem.
Attached to this ticket is a patch to Test::Harness::Straps that corrects this warning and avoid printing the "too many tests" warnings once it has been printed.
Regards
--- Test-Harness-2.52/lib/Test/Harness/Straps.pm 2005-05-08 06:40:42.000000000 +0200
+++ Test-Harness-2.52-new/lib/Test/Harness/Straps.pm 2005-07-10 00:36:52.685579841 +0200
@@ -154,6 +154,7 @@
my $totals = shift;
$self->{line}++;
+ $self->{max} ||= 100_000;
my $linetype;
my $point = Test::Harness::Point->from_test_line( $line );
@@ -185,9 +186,10 @@
$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}) ) {
+ warn "Enormous test number seen [test ", $point->number, "]\n" unless $self->{has_warned_too_many_tests};
+ warn "Can't detailize, too big.\n" unless $self->{has_warned_too_many_tests};
+ $self->{has_warned_too_many_tests} = 1;
}
else {
my $details = {