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

Jim Laskey jlaskey at apple.com
Sat Sep 16 17:21:33 PDT 2006



Changes in directory nightlytest-serverside:

ProgramResults.php updated: 1.60 -> 1.61
---
Log message:

Debugging #4

---
Diffs of the changes:  (+31 -30)

 ProgramResults.php |   61 ++++++++++++++++++++++++++---------------------------
 1 files changed, 31 insertions(+), 30 deletions(-)


Index: nightlytest-serverside/ProgramResults.php
diff -u nightlytest-serverside/ProgramResults.php:1.60 nightlytest-serverside/ProgramResults.php:1.61
--- nightlytest-serverside/ProgramResults.php:1.60	Fri Sep 15 12:23:40 2006
+++ nightlytest-serverside/ProgramResults.php	Sat Sep 16 19:21:19 2006
@@ -420,7 +420,7 @@
   if (isset($tail)) {
     $program = "test/" . $tail;
   }
-  return $program;
+  return rtrim($program, ": ");;
 }
  
  
@@ -436,8 +436,8 @@
     $query = "SELECT program FROM tests WHERE night=$night_id AND result=\"FAIL\" ORDER BY program ASC";
     $program_query = mysql_query($query) or die (mysql_error());
     while($row = mysql_fetch_assoc($program_query)) {
-      $program = rtrim($row['program'], ": ");
-      $result .= trimTestPath($program) . "\n";
+      $program = trimTestPath($row['program']);
+      $result .= $program . "\n";
     }
     mysql_free_result($program_query);
 
@@ -446,7 +446,7 @@
     while($row = mysql_fetch_assoc($program_query)) {
       $test_result = $row['result'];
       if (!isTestPass($test_result)) {
-        $program = rtrim($row['program'], ": ");
+        $program = trimTestPath($row['program']);
         $reasons = getFailReasons($test_result);        
         $result .= $program . $reasons . "\n";
       }
@@ -475,8 +475,8 @@
     $query = "SELECT program FROM tests WHERE night=$night_id AND result=\"FAIL\"";
     $program_query = mysql_query($query) or die (mysql_error());
     while($row = mysql_fetch_assoc($program_query)){
-      $program = rtrim($row['program'], ": ");
-      $result .= trimTestPath($program) . "\n";
+      $program = trimTestPath($row['program']);
+      $result .= $program . "\n";
     }
     mysql_free_result($program_query);
   }
@@ -504,7 +504,7 @@
   $query = "SELECT program, result FROM $table WHERE night=$id";
   $program_query = mysql_query($query) or die (mysql_error());
   while ($row = mysql_fetch_assoc($program_query)) {
-    $program = rtrim($row['program'], ": ");
+    $program = trimTestPath($row['program']);
     $test_hash[$program] = $row['result'];
   }
   mysql_free_result($program_query);
@@ -522,9 +522,9 @@
   $query = "SELECT program FROM $table WHERE night=$id ORDER BY program ASC";
   $program_query = mysql_query($query) or die (mysql_error());
   while ($row = mysql_fetch_assoc($program_query)) {
-    $program = rtrim($row['program'], ": ");
+    $program = trimTestPath($row['program']);
     if (!isset($test_hash[$program])) {
-      $result .= trimTestPath($program) . "\n";
+      $result .= $program . "\n";
     }
   }
   mysql_free_result($program_query);
@@ -591,11 +591,10 @@
  * Does the test pass
  *
  * Return true if the test result indicates a pass.  For "tests" the possible
- * conditions are "PASS", "FAIL" and "XFAIL" (expected to fail.)  For programs
- * an asterix appears by each tool that has failed.
+ * conditions are "PASS", "FAIL" and "XFAIL" (expected to fail.)
  */
 function isTestPass($test_result) {
-  return !(strcmp($test_result, "FAIL") == 0 || strpos($test_result, "*") !== false);
+  return strcmp($test_result, "FAIL") != 0;
 }
 
 /*
@@ -603,14 +602,18 @@
  *
  * Returns a hash of tests that fail for a given night.
  */
-function getTestFailSet($id, $table){
+function getTestFailSet($id){
   $test_hash = array();
-  $query = "SELECT program, result FROM $table WHERE night=$id";
+  $query = "SELECT program, result, measure FROM tests WHERE night=$id ORDER BY program ASC, measure ASC";
   $program_query = mysql_query($query) or die (mysql_error());
   while ($row = mysql_fetch_assoc($program_query)) {
     $result = $row['result'];
     if (!isTestPass($result)) {
-      $program = rtrim($row['program'], ": ");
+      $program = trimTestPath($row['program']);
+      $measure = $row['measure'];
+      if (!StringEqual($measure, "dejagnu")) {
+        $program .= " [$measure]";
+      }
       $test_hash[$program] = $result;
     }
   }
@@ -626,15 +629,19 @@
  */
 function getPassingTests($id, $table, $test_hash){
   $result = "";
-  $query = "SELECT program, result FROM $table WHERE night=$id ORDER BY program ASC";
+  $query = "SELECT program, result, measure FROM tests WHERE night=$id ORDER BY program ASC, measure ASC";
   $program_query = mysql_query($query) or die (mysql_error());
   while ($row = mysql_fetch_assoc($program_query)) {
-    $program = rtrim($row['program'], ": ");
+    $program = trimTestPath($row['program']);
+    $measure = $row['measure'];
+    if (!StringEqual($measure, "dejagnu")) {
+      $program .= " [$measure]";
+    }
+    $result = $row['result'];
     $wasfailing = isset($test_hash[$program]);
-    $ispassing = isTestPass($row['result']);
+    $ispassing = isTestPass($result);
     if ($wasfailing && $ispassing) {
-      $reasons = getFailReasons($test_hash[$program]);
-      $result .= trimTestPath($program) . $reasons . "\n";
+      $result .= $program . "\n";
     }
   }
   mysql_free_result($program_query);
@@ -660,11 +667,8 @@
     $result = $row['newly_passing_tests'];
     mysql_free_result($program_query);
   } else {
-    $test_hash = getTestFailSet($prev_id, "tests");
-    $result .= getPassingTests($cur_id, "tests", $test_hash);
-  
-    $test_hash = getTestFailSet($prev_id, "program");
-    $result .= getPassingTests($cur_id, "program", $test_hash);
+    $test_hash = getTestFailSet($prev_id);
+    $result .= getPassingTests($cur_id, $test_hash);
   }
   return $result;
 }
@@ -688,11 +692,8 @@
     $result = $row['newly_failing_tests'];
     mysql_free_result($program_query);
   } else {
-    $test_hash = getTestFailSet($cur_id, "tests");
-    $result .= getPassingTests($prev_id, "tests", $test_hash);
-  
-    $test_hash = getTestFailSet($cur_id, "program");
-    $result .= getPassingTests($prev_id, "program", $test_hash);
+    $test_hash = getTestFailSet($cur_id);
+    $result .= getPassingTests($prev_id, $test_hash);
   }
   return $result;
 }






More information about the llvm-commits mailing list