Changes in directory nightlytest-serverside:
ProgramResults.php updated: 1.83 -> 1.84 --- Log message: Correct newly failing attempt #2. --- Diffs of the changes: (+13 -58) ProgramResults.php | 71 +++++++++-------------------------------------------- 1 files changed, 13 insertions(+), 58 deletions(-) Index: nightlytest-serverside/ProgramResults.php diff -u nightlytest-serverside/ProgramResults.php:1.83 nightlytest-serverside/ProgramResults.php:1.84 --- nightlytest-serverside/ProgramResults.php:1.83 Fri Oct 20 14:46:09 2006 +++ nightlytest-serverside/ProgramResults.php Fri Oct 20 14:51:39 2006 @@ -387,42 +387,31 @@ /* - * Return reasons why a llvm test failed as an array. + * Return reason why a llvm test failed. */ -function getFailReasonsAsList($test_result) { - $result = array(); +function getFailReasons($test_result) { + $result = ""; $phases = split(", ", $test_result); for ($i = 0; $i < count($phases); $i++) { $phase = $phases[$i]; if (strpos($phase, "*") !== false) { list($tool, $tool_result) = split(": ", $phase); - array_push($result, $tool); - } - } - - 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) { + if (strcmp($result, "") != 0) { $result .= ", "; } - $result .= $reasons[$i]; + $result .= $tool; } - - $result .= "] "; + } + + if (strcmp($result, "") != 0) { + $result = " [" . $result . "]"; } return $result; } + /* * Trim test path to exclude redundant info. */ @@ -458,7 +447,7 @@ $test_result = $row['result']; if (!isTestPass($test_result)) { $program = trimTestPath($row['program']); - $reasons = FailReasonsAsString(getFailReasonsAsList($test_result)); + $reasons = getFailReasons($test_result); $result .= $program . $reasons . "\n"; } } @@ -615,7 +604,6 @@ */ 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)) { @@ -625,25 +613,9 @@ $test_hash[$key] = true; } mysql_free_result($program_query); - - $query = "SELECT program, result FROM program WHERE night=$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; } - /* * Get list of newly passing tests * @@ -663,23 +635,6 @@ } } mysql_free_result($program_query); - - $query = "SELECT program, result FROM program WHERE night=$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); - $old_reasons = isset($test_hash[$program]) ? $test_hash[$program] : array(); - $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; } @@ -761,10 +716,10 @@ * */ function getEmailReport($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); + $passing = getFixedTests($cur_id, $prev_id); + $failing = getBrokenTests($cur_id, $prev_id); $email = ""; if (strcmp($passing, "") == 0) { _______________________________________________ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits