[llvm-commits] CVS: llvm/utils/NightlyTest.pl

Brian Gaeke gaeke at cs.uiuc.edu
Tue Sep 28 09:04:11 PDT 2004



Changes in directory llvm/utils:

NightlyTest.pl updated: 1.66 -> 1.67
---
Log message:

Touch output files before reading or writing them, so that they are
always guaranteed to exist. This fixes PR444: http://llvm.cs.uiuc.edu/PR444 . Thanks to Alkis
for reporting the bug and testing the patch.
AddRecord used to return a big list, but that return value was never
used. So now it doesn't return anything.
Create the WebDir if it does not exist.
Fix a typo in a comment.


---
Diffs of the changes:  (+26 -3)

Index: llvm/utils/NightlyTest.pl
diff -u llvm/utils/NightlyTest.pl:1.66 llvm/utils/NightlyTest.pl:1.67
--- llvm/utils/NightlyTest.pl:1.66	Mon Sep  6 14:32:55 2004
+++ llvm/utils/NightlyTest.pl	Tue Sep 28 11:04:00 2004
@@ -44,7 +44,7 @@
 #  process and erased (unless -noremove is specified; see above.)
 # WEBDIR is the directory into which the test results web page will be written,
 #  AND in which the "index.html" is assumed to be a symlink to the most recent
-#  copy of the results. This directory MUST exist before the script is run.
+#  copy of the results. This directory will be created if it does not exist.
 # LLVMGCCDIR is the directory in which the LLVM GCC Front End is installed
 #  to. This is the same as you would have for a normal LLVM build.
 #
@@ -109,6 +109,18 @@
   return "0";
 }
 
+sub Touch {
+  my @files = @_;
+  my $now = time;
+  foreach my $file (@files) {
+    if (! -f $file) {
+      open (FILE, ">$file") or warn "Could not create new file $file";
+      close FILE;
+    }
+    utime $now, $now, $file;
+  }
+}
+
 sub AddRecord {
   my ($Val, $Filename) = @_;
   my @Records;
@@ -118,7 +130,6 @@
   }
   push @Records, "$DATE: $Val";
   WriteFile "$WebDir/$Filename", (join "\n", @Records) . "\n";
-  return @Records;
 }
 
 sub AddPreTag {  # Add pre tags around nonempty list, or convert to "none"
@@ -315,6 +326,10 @@
   print "BuildLog = $BuildLog\n";
 }
 
+if (! -d $WebDir) {
+  mkdir $WebDir, 0777;
+  warn "Warning: $WebDir did not exist; creating it.\n";
+}
 
 #
 # Create the CVS repository directory
@@ -744,10 +759,18 @@
 my $PrevDaysList = join "\n  ", map { "<a href=\"$_.html\">$_</a><br>" } @PrevDays;
 
 #
-# Start outputing files into the web directory
+# Start outputting files into the web directory
 #
 ChangeDir( $WebDir, "Web Directory" );
 
+# Make sure we don't get errors running the nightly tester the first time
+# because of files that don't exist.
+Touch ('running_build_time.txt', 'running_Olden_llc_time.txt',
+       'running_loc.txt', 'running_Olden_machcode.txt',
+       'running_Olden_bytecode.txt', 'running_Olden_nat_time.txt',
+       'running_Olden_cbe_time.txt', 'running_Olden_opt_time.txt',
+       'running_Olden_jit_time.txt');
+
 # Add information to the files which accumulate information for graphs...
 AddRecord($LOC, "running_loc.txt");
 AddRecord($BuildTime, "running_build_time.txt");






More information about the llvm-commits mailing list