[llvm-commits] CVS: nightlytest-serverside/ProgramResults.php

Jim Laskey jlaskey at apple.com
Fri Oct 20 13:46:46 PDT 2006



Changes in directory nightlytest-serverside:

ProgramResults.php updated: 1.84 -> 1.85
---
Log message:

Correct newly failing attempt #3.

---
Diffs of the changes:  (+55 -14)

 ProgramResults.php |   69 ++++++++++++++++++++++++++++++++++++++++++-----------
 1 files changed, 55 insertions(+), 14 deletions(-)


Index: nightlytest-serverside/ProgramResults.php
diff -u nightlytest-serverside/ProgramResults.php:1.84 nightlytest-serverside/ProgramResults.php:1.85
--- nightlytest-serverside/ProgramResults.php:1.84	Fri Oct 20 14:51:39 2006
+++ nightlytest-serverside/ProgramResults.php	Fri Oct 20 15:46:32 2006
@@ -385,33 +385,43 @@
   }
 }
 
-
 /*
- * Return reason why a llvm test failed.
+ * Return reasons why a llvm test failed as an array.
  */
-function getFailReasons($test_result) {
-  $result = "";
+function getFailReasonsAsList($test_result) {
+  $result = array();
   $phases = split(", ", $test_result);
   
   for ($i = 0; $i < count($phases); $i++) {
     $phase = $phases[$i];
     if (strpos($phase, "*") !== false) {
       list($tool, $tool_result) = split(": ", $phase);
-      if (strcmp($result, "") != 0) {
-        $result .= ", ";
-      }
-      $result .= $tool;
+      array_push($result, $tool);
     }
   }
   
-  if (strcmp($result, "") != 0) {
-    $result = " [" . $result . "]";
+  return $result;
+}
+
+/*
+ * Return reasons why a llvm test failed as a string.
+ */
+function FailReasonsAsString($reasons) {
+  if (count($reasons) != 0) {
+    $result = " [";
+    for ($i = 0; $i < count($reasons); $i++) {
+      if ($i != 0) {
+        $result .= ", ";
+      }
+      $result .= $reasons[$i];
+    }
+    
+    $result .= "] ";
   }
   
   return $result;
 }
 
-
 /*
  * Trim test path to exclude redundant info.
  */
@@ -447,7 +457,7 @@
       $test_result = $row['result'];
       if (!isTestPass($test_result)) {
         $program = trimTestPath($row['program']);
-        $reasons = getFailReasons($test_result);        
+        $reasons = FailReasonsAsString(getFailReasonsAsList($test_result));        
         $result .= $program . $reasons . "\n";
       }
     }
@@ -604,6 +614,7 @@
  */
 function getTestFailSet($id) {
   $test_hash = array();
+  
   $query = "SELECT program, result, measure FROM tests WHERE night=$id AND result=\"FAIL\" ORDER BY program ASC, measure ASC";
   $program_query = mysql_query($query) or die (mysql_error());
   while ($row = mysql_fetch_assoc($program_query)) {
@@ -613,6 +624,20 @@
     $test_hash[$key] = true;
   }
   mysql_free_result($program_query);
+  
+  $query = "SELECT program, result FROM program WHERE night=$id ORDER BY program ASC";
+  $program_query = mysql_query($query) or die (mysql_error());
+  while($row = mysql_fetch_assoc($program_query)) {
+    $program = trimTestPath($row['program']);
+    $test_result = $row['result'];
+    $reasons = getFailReasonsAsList($test_result);
+    
+    if (count($reasons) != 0) {
+      $test_hash[$program] = $reasons;
+    }
+  }
+  mysql_free_result($program_query);
+  
   return $test_hash;
 }
 
@@ -635,6 +660,22 @@
     }
   }
   mysql_free_result($program_query);
+
+  $query = "SELECT program, result FROM program WHERE night=$id ORDER BY program ASC";
+  $program_query = mysql_query($query) or die (mysql_error());
+  while($row = mysql_fetch_assoc($program_query)) {
+    $program = trimTestPath($row['program']);
+    $test_result = $row['result'];
+    $new_reasons = getFailReasonsAsList($test_result);
+    $diff_reasons = array_diff($old_reasons, $new_reasons);
+    $now_passing_reasons = array_intersect($diff_reasons, $old_reasons);
+
+    if (count($now_passing_reasons) > 0) {
+      $reasons .= $program . FailReasonsAsString($now_passing_reasons) . "\n";   
+    }
+  }
+  mysql_free_result($program_query);
+
   return $passing;
 }
 
@@ -716,10 +757,10 @@
  *
  */
 function getEmailReport($cur_id, $prev_id) {
-  $added = getNewTests($cur_id, $prev_id);
-  $removed = getRemovedTests($cur_id, $prev_id);
   $passing = getFixedTests($cur_id, $prev_id);
   $failing = getBrokenTests($cur_id, $prev_id);
+  $added = getNewTests($cur_id, $prev_id);
+  $removed = getRemovedTests($cur_id, $prev_id);
   
   $email = "";
   if (strcmp($passing, "") == 0) {






More information about the llvm-commits mailing list