Change 20023 by [EMAIL PROTECTED] on 2003/07/06 07:29:22
Subject: Re: maint @ 19975 [PATCH lib/Test/Harness.pm]
From: Michael G Schwern <[EMAIL PROTECTED]>
Date: Sat, 5 Jul 2003 13:34:37 -0700
Message-ID: <[EMAIL PROTECTED]>
Print out the "ok" messages only once every second,
this should make output much less and therefore testing
much faster, especially on slower connections.
Affected files ...
... //depot/perl/lib/Test/Harness.pm#74 edit
Differences ...
==== //depot/perl/lib/Test/Harness.pm#74 (text) ====
Index: perl/lib/Test/Harness.pm
--- perl/lib/Test/Harness.pm#73~19881~ Sun Jun 29 03:17:28 2003
+++ perl/lib/Test/Harness.pm Sun Jul 6 00:29:22 2003
@@ -13,12 +13,12 @@
use vars qw($VERSION $Verbose $Switches $Have_Devel_Corestack $Curtest
$Columns $verbose $switches $ML $Strap
- @ISA @EXPORT @EXPORT_OK
+ @ISA @EXPORT @EXPORT_OK $Last_ML_Print
);
# Backwards compatibility for exportable variable names.
-*verbose = \$Verbose;
-*switches = \$Switches;
+*verbose = *Verbose;
+*switches = *Switches;
$Have_Devel_Corestack = 0;
@@ -449,7 +449,7 @@
my $width = _leader_width(@tests);
foreach my $tfile (@tests) {
-
+ $Last_ML_Print = 0; # so each test prints at least once
my($leader, $ml) = _mk_leader($tfile, $width);
local $ML = $ml;
print $leader;
@@ -706,7 +706,7 @@
my $detail = $totals->{details}[-1];
if( $detail->{ok} ) {
- _print_ml("ok $curr/$max");
+ _print_ml_less("ok $curr/$max");
if( $detail->{type} eq 'skip' ) {
$totals->{skip_reason} = $detail->{reason}
@@ -741,6 +741,15 @@
print join '', $ML, @_ if $ML;
}
+
+# For slow connections, we save lots of bandwidth by printing only once
+# per second.
+sub _print_ml_less {
+ if( $Last_ML_Print != time ) {
+ _print_ml(@_);
+ $Last_ML_Print = time;
+ }
+}
sub _bonusmsg {
my($tot) = @_;
End of Patch.