aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDan Fandrich <dan@coneharvesters.com>2008-07-24 02:16:48 +0000
committerDan Fandrich <dan@coneharvesters.com>2008-07-24 02:16:48 +0000
commit932b58978029f1f6445076397b0fb275ceccb110 (patch)
treee4dbc3ad6b21f8be589f7e999b2eb8634beb70e8 /tests
parent27c282a6eee813f61546d1675e69792bf6ca268d (diff)
Changed the long logfile elision code in runtests.pl to properly handle
lines ending in \r.
Diffstat (limited to 'tests')
-rwxr-xr-xtests/runtests.pl37
1 files changed, 12 insertions, 25 deletions
diff --git a/tests/runtests.pl b/tests/runtests.pl
index 052f2212c..8d86cdce6 100755
--- a/tests/runtests.pl
+++ b/tests/runtests.pl
@@ -2963,11 +2963,10 @@ open(CMDLOG, ">$CURLLOG") ||
#######################################################################
# Display the contents of the given file. Line endings are canonicalized
-# and excessively long files are truncated
+# and excessively long files are elided
sub displaylogcontent {
my ($file)=@_;
if(open(SINGLE, "<$file")) {
- my $lfcount;
my $linecount = 0;
my $truncate;
my @tail;
@@ -2975,29 +2974,17 @@ sub displaylogcontent {
$string =~ s/\r\n/\n/g;
$string =~ s/[\r\f\032]/\n/g;
$string .= "\n" unless ($string =~ /\n$/);
- $lfcount = $string =~ tr/\n//;
- if($lfcount == 1) {
- $string =~ s/\n//;
- $string =~ s/\s*\!$//;
- $linecount++;
- if ($truncate) {
- push @tail, " $string\n";
- } else {
- logmsg " $string\n";
- }
- }
- else {
- for my $line (split("\n", $string)) {
- $line =~ s/\s*\!$//;
- $linecount++;
- if ($truncate) {
- push @tail, " $line\n";
- } else {
- logmsg " $line\n";
- }
- }
- }
- $truncate = $linecount > 1000;
+ $string =~ tr/\n//;
+ for my $line (split("\n", $string)) {
+ $line =~ s/\s*\!$//;
+ if ($truncate) {
+ push @tail, " $line\n";
+ } else {
+ logmsg " $line\n";
+ }
+ $linecount++;
+ $truncate = $linecount > 1000;
+ }
}
if (@tail) {
logmsg "=== File too long: lines here were removed\n";