[llvm-commits] CVS: llvm/utils/NightlyTest.pl NightlyTestTemplate.html
Tanya Brethour
tbrethou at cs.uiuc.edu
Sat Nov 20 16:02:51 PST 2004
Changes in directory llvm/utils:
NightlyTest.pl updated: 1.69 -> 1.70
NightlyTestTemplate.html updated: 1.32 -> 1.33
---
Log message:
Added the ability to run Dejagnu tests.
---
Diffs of the changes: (+100 -1)
Index: llvm/utils/NightlyTest.pl
diff -u llvm/utils/NightlyTest.pl:1.69 llvm/utils/NightlyTest.pl:1.70
--- llvm/utils/NightlyTest.pl:1.69 Sun Nov 7 21:28:27 2004
+++ llvm/utils/NightlyTest.pl Sat Nov 20 18:02:40 2004
@@ -21,6 +21,7 @@
# LARGE_PROBLEM_SIZE enabled.
# -noexternals Do not run the external tests (for cases where povray
# or SPEC are not installed)
+# -rundejagnu Runs features and regressions using Dejagnu
# -parallel Run two parallel jobs with GNU Make.
# -release Build an LLVM Release version
# -pedantic Enable additional GCC warnings to detect possible errors.
@@ -50,6 +51,7 @@
# to. This is the same as you would have for a normal LLVM build.
#
use POSIX qw(strftime);
+use File::Copy;
my $HOME = $ENV{'HOME'};
my $CVSRootDir = $ENV{'CVSROOT'};
@@ -82,6 +84,7 @@
my $DEBUG = 0;
my $CONFIGUREARGS = "";
my $NICE = "";
+my $RUNDEJAGNU = 0;
sub ReadFile {
if (open (FILE, $_[0])) {
@@ -145,6 +148,13 @@
chdir($dir) || die "Cannot change directory to: $name ($dir) ";
}
+sub CopyFile { #filename, newfile
+ my ($file, $newfile) = @_;
+ chomp($file);
+ if ($VERBOSE) { print "Copying $file to $newfile\n"; }
+ copy($file, $newfile);
+}
+
sub GetDir {
my $Suffix = shift;
opendir DH, $WebDir;
@@ -248,6 +258,52 @@
return "$content</li></ol>\n";
}
+sub GetDejagnuTestResults { # (filename, log)
+ my ($filename, $DejagnuLog) = @_;
+ my @lines;
+ my $firstline;
+ $/ = "\n"; #Make sure we're going line at a time.
+ if (open SRCHFILE, $filename) {
+ # Process test results
+ push(@lines,"<h3>UNEXPECTED TEST RESULTS</h3><ol><li>\n");
+ my $first_list = 1;
+ my $should_break = 1;
+ my $nocopy = 0;
+ my $readingsum = 0;
+ while ( <SRCHFILE> ) {
+ if ( length($_) > 1 ) {
+ chomp($_);
+ if ( m/^XPASS:/ || m/^FAIL:/ ) {
+ $nocopy = 0;
+ if ( $first_list ) {
+ $first_list = 0;
+ $should_break = 1;
+ push(@lines,"<b>$_</b><br/>\n");
+ } else {
+ push(@lines,"</li><li><b>$_</b><br/>\n");
+ }
+ } elsif ( m/Summary/ ) {
+ if ( $first_list ) { push(@lines,"<b>PERFECT!</b>"); }
+ push(@lines,"</li></ol><h3>STATISTICS</h3><pre>\n");
+ $should_break = 0;
+ $nocopy = 0;
+ $readingsum = 1;
+ } elsif ( $readingsum ) {
+ push(@lines,"$_\n");
+ }
+ }
+ }
+ }
+ push(@lines, "</pre>\n");
+ close SRCHFILE;
+
+ #add link to complete testing log
+ push(@lines, "<p>A complete log of testing <a href=\"$DejagnuLog\">Feature and Regression</a> is available for further analysis.</p>\n");
+
+ my $content = join("", at lines);
+ return "$content</li></ol>\n";
+}
+
#####################################################################
## MAIN PROGRAM
@@ -291,6 +347,7 @@
$CONFIGUREARGS .= " CC=$ARGV[0]/gcc CXX=$ARGV[0]/g++"; shift; next;
}
if (/^-noexternals$/) { $NOEXTERNALS = 1; next; }
+ if(/^-runDejagnu$/) { $RUNDEJAGNU = 1; next; }
print "Unknown option: $_ : ignoring!\n";
}
@@ -321,6 +378,9 @@
my $SingleSourceLog = "$Prefix-SingleSource-ProgramTest.txt.gz";
my $MultiSourceLog = "$Prefix-MultiSource-ProgramTest.txt.gz";
my $ExternalLog = "$Prefix-External-ProgramTest.txt.gz";
+my $DejagnuLog = "$Prefix-Dejagnu-testrun.log";
+my $DejagnuSum = "$Prefix-Dejagnu-testrun.sum";
+my $DejagnuTestsLog = "$Prefix-DejagnuTests-Log.txt";
if ($VERBOSE) {
print "INITIALIZED\n";
@@ -434,7 +494,7 @@
if ($VERBOSE) { print "BUILD ERROR\n"; }
}
-if ($BuildError) { $NOFEATURES = 1; $NOREGRESSIONS = 1; }
+if ($BuildError) { $NOFEATURES = 1; $NOREGRESSIONS = 1; $RUNDEJAGNU=0; }
# Get results of feature tests.
my $FeatureTestResults; # String containing the results of the feature tests
@@ -483,9 +543,37 @@
$RegressionWallTime = "0.0";
}
+my $DejangnuTestResults; # String containing the results of the dejagnu
+if($RUNDEJAGNU) {
+ if($VERBOSE) { print "DEJAGNU FEATURE/REGRESSION TEST STAGE\n"; }
+
+ my $dejagnu_output = "$DejagnuTestsLog";
+
+ #Run the feature and regression tests, results are put into testrun.sum
+ #Full log in testrun.log
+ system "time -p gmake $MAKEOPTS check-dejagnu >& $dejagnu_output";
+
+ #Extract time of dejagnu tests
+ my $DejagnuTimeU = GetRegexNum "^user", 0, "([0-9.]+)", "$dejagnu_output";
+ my $DejagnuTimeS = GetRegexNum "^sys", 0, "([0-9.]+)", "$dejagnu_output";
+ $DejagnuTime = $DejagnuTimeU+$DejagnuTimeS; # DejagnuTime = User+System
+ $DejagnuWallTime = GetRegexNum "^real", 0,"([0-9.]+)","$dejagnu_output";
+
+ #Copy the testrun.log and testrun.sum to our webdir
+ CopyFile("test/testrun.log", $DejagnuLog);
+ CopyFile("test/testrun.sum", $DejagnuSum);
+
+ $DejagnuTestResults = GetDejagnuTestResults($DejagnuSum, $DejagnuLog);
+} else {
+ $DejagnuTestResults = "Skipped by user choice.";
+ $DejagnuTime = "0.0";
+ $DejagnuWallTime = "0.0";
+}
+
if ($DEBUG) {
print $FeatureTestResults;
print $RegressionTestResults;
+ print $DejagnuTestResults;
}
if ( $VERBOSE ) { print "BUILD INFORMATION COLLECTION STAGE\n"; }
Index: llvm/utils/NightlyTestTemplate.html
diff -u llvm/utils/NightlyTestTemplate.html:1.32 llvm/utils/NightlyTestTemplate.html:1.33
--- llvm/utils/NightlyTestTemplate.html:1.32 Fri Jul 23 01:50:18 2004
+++ llvm/utils/NightlyTestTemplate.html Sat Nov 20 18:02:40 2004
@@ -18,6 +18,7 @@
<a href="#Programs">Programs</a><br>
<a href="#Feature">Feature</a><br>
<a href="#Regression">Regression</a><br>
+<a href="#Dejagnu">Dejagnu Tests</a><br>
</td></tr></table></td></tr></table>
<p>
@@ -71,6 +72,7 @@
<tr><td>Build CVS Tree</td><td>$BuildTime</td><td>$BuildWallTime</td></tr>
<tr><td>Run Feature Tests</td><td>$FeatureTime</td><td>$FeatureWallTime</td></tr>
<tr><td>Run Regression Tests</td><td>$RegressionTime</td><td>$RegressionWallTime</td></tr>
+<tr><td>Run Dejagnu Tests</td><td>$DejagnuTime</td><td>$DejagnuWallTime</td></tr>
</table></li>
<li>Number of object files compiled: <b>$NumObjects</b></li>
<li>Number of libraries linked: <b>$NumLibraries</b></li>
@@ -256,4 +258,13 @@
<br/>
$RegressionTestResults
+<br/><br/><center>
+<table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#000000">
+<table border="0" cellpadding="10" cellspacing="0"><tr><td bgcolor="#DDAA77"
+<font size=+2 face=Verdana><b><a name="Dejagnu">Dejagnu Test Results</font></b>
+</td></tr></table></td></tr></table></center>
+<br/>
+$DejagnuTestResults
+
</td></tr></html>
+
More information about the llvm-commits
mailing list