aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2010-01-21 14:25:41 +0000
committerYang Tse <yangsita@gmail.com>2010-01-21 14:25:41 +0000
commit4a349f7a540a4d45e5e0503be887c52192dce51f (patch)
tree6d8d9d93c72e0e2632ecc069823cff86f12e96af /tests
parent2f9a17fc4442a04d4ec81dc937fa3af7c8caeda7 (diff)
improve displaylogcontent() sub fixing a warning
Diffstat (limited to 'tests')
-rwxr-xr-xtests/runtests.pl15
1 files changed, 11 insertions, 4 deletions
diff --git a/tests/runtests.pl b/tests/runtests.pl
index 2a39715f6..2660a4ac3 100755
--- a/tests/runtests.pl
+++ b/tests/runtests.pl
@@ -3683,10 +3683,17 @@ sub displaylogcontent {
$truncate = $linecount > 1000;
}
}
- if (@tail) {
- logmsg "=== File too long: lines here were removed\n";
- # This won't work properly if time stamps are enabled in logmsg
- logmsg join('',@tail[$#tail-200..$#tail]);
+ if(@tail) {
+ my $tailshow = 200;
+ my $tailskip = 0;
+ my $tailtotal = scalar @tail;
+ if($tailtotal > $tailshow) {
+ $tailskip = $tailtotal - $tailshow;
+ logmsg "=== File too long: $tailskip lines omitted here\n";
+ }
+ for($tailskip .. $tailtotal-1) {
+ logmsg "$tail[$_]";
+ }
}
close(SINGLE);
}