aboutsummaryrefslogtreecommitdiffstats
path: root/utils/NightlyTest.pl
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2006-03-21 01:21:39 +0000
committerReid Spencer <rspencer@reidspencer.com>2006-03-21 01:21:39 +0000
commit7d6a5155a4bbdbe8fb7b34733ceb5c30e4fc03ba (patch)
treefa182bc5f66d0decbd50c92487fe21b8a4cabf21 /utils/NightlyTest.pl
parentd465126f5d4c61318158876ead3e5b7309c8a0e5 (diff)
downloadexternal_llvm-7d6a5155a4bbdbe8fb7b34733ceb5c30e4fc03ba.zip
external_llvm-7d6a5155a4bbdbe8fb7b34733ceb5c30e4fc03ba.tar.gz
external_llvm-7d6a5155a4bbdbe8fb7b34733ceb5c30e4fc03ba.tar.bz2
Cause the various warnings list to be generated via a <ul> list with
text enclosed in <tt>. This ensures that (a) the text is in a fixed width font (to indicated generated text) and (b) the text wraps without causing the page width to be extended. The main result of this is that the report will wrap to conform to the window size in which it is displayed instead of having a very wide length if a warning message is long. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26916 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/NightlyTest.pl')
-rwxr-xr-xutils/NightlyTest.pl24
1 files changed, 20 insertions, 4 deletions
diff --git a/utils/NightlyTest.pl b/utils/NightlyTest.pl
index db61914..f2a8de0 100755
--- a/utils/NightlyTest.pl
+++ b/utils/NightlyTest.pl
@@ -151,7 +151,21 @@ sub AddRecord {
sub AddPreTag { # Add pre tags around nonempty list, or convert to "none"
$_ = shift;
- if (length) { return "<ul><tt>$_</tt></ul>"; } else { "<b>none</b><br>"; }
+ if (length) { return "<pre>$_</pre>"; } else { "<b>none</b><br>"; }
+}
+
+sub ArrayToList { # Add <li> tags around nonempty list or convert to "none"
+ my $result = "";
+ if (scalar @_) {
+ $result = "<ul>";
+ foreach $item (@_) {
+ $result .= "<li><tt>$item</tt></li>";
+ }
+ $result .= "</ul>";
+ } else {
+ $result = "<p><b>none</b></p>";
+ }
+ return $result;
}
sub ChangeDir { # directory, logical name
@@ -528,7 +542,7 @@ foreach $Warning (@Warn) {
}
}
my $WarningsFile = join "\n", @Warnings;
-my $WarningsList = AddPreTag $WarningsFile;
+my $WarningsList = ArrayToList @Warnings;
$WarningsFile =~ s/:[0-9]+:/::/g;
# Emit the warnings file, so we can diff...
@@ -539,8 +553,10 @@ my ($WarningsAdded, $WarningsRemoved) = DiffFiles "-Warnings.txt";
print "ADDED WARNINGS:\n$WarningsAdded\n\n" if (length $WarningsAdded);
print "REMOVED WARNINGS:\n$WarningsRemoved\n\n" if (length $WarningsRemoved);
-$WarningsAdded = AddPreTag $WarningsAdded;
-$WarningsRemoved = AddPreTag $WarningsRemoved;
+my @TmpWarningsAdded = split "\n", $WarningsAdded;
+my @TmpWarningsRemoved = split "\n", $WarningsRemoved;
+$WarningsAdded = ArrayToList @TmpWarningsAdded;
+$WarningsRemoved = ArrayToList @TmpWarningsRemoved;
#
# Get some statistics about CVS commits over the current day...