[llvm-commits] [nightly-test-server] r50092 - in /nightly-test-server/trunk: AcceptTestResults.php NightlyTestAccept.php

Tanya Lattner tonic at nondot.org
Mon Apr 21 23:26:38 PDT 2008


Author: tbrethou
Date: Tue Apr 22 01:26:37 2008
New Revision: 50092

URL: http://llvm.org/viewvc/llvm-project?rev=50092&view=rev
Log:
Add build and send logs for new database.

Modified:
    nightly-test-server/trunk/AcceptTestResults.php
    nightly-test-server/trunk/NightlyTestAccept.php

Modified: nightly-test-server/trunk/AcceptTestResults.php
URL: http://llvm.org/viewvc/llvm-project/nightly-test-server/trunk/AcceptTestResults.php?rev=50092&r1=50091&r2=50092&view=diff

==============================================================================
--- nightly-test-server/trunk/AcceptTestResults.php (original)
+++ nightly-test-server/trunk/AcceptTestResults.php Tue Apr 22 01:26:37 2008
@@ -341,7 +341,21 @@
  mysql_close($mysql_link); 
 }
 
-
+/*******************************************************************************
+*
+* Opens a file handle to the specified filename, then writes the contents out,
+* and finally closes the filehandle.
+*
+*******************************************************************************/
+function WriteLogFile($filename, $contents) {
+  
+  $file = fopen($filename, "w");
+  
+  if($file) {
+    fwrite($file, $contents);
+    fclose($file);
+  }
+}
 
 /*******************************************************************************
 *
@@ -449,6 +463,8 @@
   $buildstatus = 4;
 }
 
+$db_date = date("Y-m-d H:i:s");
+
 // Add new test run config
 $testRunConfigId = addTestRunConfig($runDateTime, $machineId, $uname, 
                                     $gcc_version, $cvsCpuTime, $cvsWallTime, 
@@ -583,6 +599,47 @@
   updateLLVMStats($runDateTime, $loc, $filesincvs, $dirsincvs, $testRunConfigId);
 }
 
+$cwd = getcwd();
+
+if($machineId) {
+  print $machineId;
+  if (!file_exists('machines-new')) {
+    mkdir('machines-new');
+  }
+  
+  $machineDir = chdir("$cwd/machines-new");
+  
+  if($machineDir) {
+    if (!file_exists("$machineId")) {
+      mkdir("$machineId");
+    }
+    
+    $hasMachineDir = chdir("$cwd/machines-new/$machineId");
+   
+    if($hasMachineDir) {
+      WriteLogFile("$db_date-Build-Log.txt", $build_log);
+      
+      $sentdata="";
+      foreach ($_GET as $key => $value) {
+        if(strpos($value, "\n") == 0) {
+          $sentdata .= "'$key'  =>  \"$value\",\n";
+        } else {
+          $sentdata .= "'$key'  =>  <<EOD\n$value\nEOD\n,\n";
+        }
+      }
+      foreach ($_POST as $key => $value) {
+        if(strpos($value, "\n") == 0) {
+          $sentdata .= "'$key'  =>  \"$value\",\n";
+        } else {
+          $sentdata .= "'$key'  =>  <<EOD\n$value\nEOD\n,\n";
+        }
+      }
+      
+      WriteLogFile("$db_date-senddata.txt", $sentdata);
+    }
+  }
+}
+
 shutdown($mysql_link);
 }
 

Modified: nightly-test-server/trunk/NightlyTestAccept.php
URL: http://llvm.org/viewvc/llvm-project/nightly-test-server/trunk/NightlyTestAccept.php?rev=50092&r1=50091&r2=50092&view=diff

==============================================================================
--- nightly-test-server/trunk/NightlyTestAccept.php (original)
+++ nightly-test-server/trunk/NightlyTestAccept.php Tue Apr 22 01:26:37 2008
@@ -989,6 +989,7 @@
         WriteFile("$db_date-senddata.txt", $sentdata);
       }
     }
+    chdir("$cwd");
   }
   
   





More information about the llvm-commits mailing list