From: Sebastien D. <sde...@us...> - 2005-06-29 14:37:41
|
Update of /cvsroot/tslogparser/tslogparser In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15780 Modified Files: HISTORY report.php run-browse.php Log Message: New feature: comparison between different testsuites Index: run-browse.php =================================================================== RCS file: /cvsroot/tslogparser/tslogparser/run-browse.php,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- run-browse.php 12 Jan 2005 15:25:13 -0000 1.6 +++ run-browse.php 29 Jun 2005 14:37:30 -0000 1.7 @@ -171,14 +171,20 @@ } else { + echo " <form method='POST' action='report2.php'>\n"; + + /* default to masking PASS and SKIP status */ + echo " <input type='hidden' name='build_PASS' value='hidden'>\n"; + echo " <input type='hidden' name='link_SKIP' value='hidden'>\n"; + echo " <input type='hidden' name='execution_PASS' value='hidden'>\n"; + + + foreach($infos as $release => $data) { echo " <tr>\n"; echo " <td valign=\"top\""; - if (count($data["runs"])>1) - echo " rowspan=\"".(count($data["runs"])+2)."\""; - elseif (count($data["runs"])==1) - echo " rowspan=\"2\""; + echo " rowspan=\"".(count($data["runs"])+1)."\""; echo ">\n"; echo " <font color='orange'>".stringFromDB($release)."</font>\n"; echo " </td>\n"; @@ -189,22 +195,11 @@ if ($data["runs"]) { - echo " <form method='POST' action='report.php'>\n"; - echo " <input type='hidden' name='opts_rel' value=\"".$data["id"]."\">\n"; - - /* default to masking PASS and SKIP status */ - echo " <input type='hidden' name='build_PASS' value='hidden'>\n"; - echo " <input type='hidden' name='link_SKIP' value='hidden'>\n"; - echo " <input type='hidden' name='execution_PASS' value='hidden'>\n"; - foreach ($data["runs"] as $run_id => $run_data) { echo " <tr>\n"; echo " <td align=center>\n"; - if (count($data["runs"])>1) - echo " <input type='checkbox' name='chkd_runs[]' value='".$run_id."'>\n"; - else - echo " \n"; + echo " <input type='checkbox' name='chkd_runs[]' value='".$run_id."'>\n"; echo " </td>\n"; echo " <td>\n"; echo " ".stringFromDB($run_data["name"])."\n"; @@ -217,20 +212,20 @@ echo " </td>\n"; echo " </tr>\n"; } - if (count($data["runs"])>1) - { - echo " <tr>\n"; - echo " <td colspan='3' align=center>\n"; - echo " <input type='submit' name='compare' value='Compare selected'>\n"; - echo " </td>\n"; - echo " <td>\n"; - echo " \n"; - echo " </td>\n"; - echo " </tr>\n"; - } - echo " </form>\n"; } } + echo " <tr>\n"; + echo " <td>\n"; + echo " \n"; + echo " </td>\n"; + echo " <td colspan='3' align=left>\n"; + echo " <input type='submit' name='compare' value='Compare selected'>\n"; + echo " </td>\n"; + echo " <td>\n"; + echo " \n"; + echo " </td>\n"; + echo " </tr>\n"; + echo " </form>\n"; } ?> </table> Index: report.php =================================================================== RCS file: /cvsroot/tslogparser/tslogparser/report.php,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- report.php 12 Jan 2005 15:25:13 -0000 1.5 +++ report.php 29 Jun 2005 14:37:30 -0000 1.6 @@ -37,9 +37,6 @@ */ -//echo "<pre>\n"; -//print_r($_POST); -//echo "</pre>\n"; $root=""; require($root."database.inc.php"); @@ -49,17 +46,17 @@ require($root."header.inc.php"); -/* Verify that the page was not opened directly */ -if (!isset($_POST["opts_rel"])) - die("<p>No valid parameter found. Please use <a href='run-browse.php'>this page</a>.</p>\n</body></html>\n"); +//echo "<pre>\n"; +//print_r($_POST); +//echo "</pre>\n"; + /* We check for correct parameters */ $mode=""; + if (isset($_POST["compare"]) && isset($_POST["chkd_runs"])) { - if (count($_POST["chkd_runs"]) <= 1) - die("<p>Multiple releases comparison not implemented yet. <a href='run-browse.php'>Back</a></p>\n</body></html>\n"); $mode="COMPARE"; } @@ -209,7 +206,7 @@ { if ($mode != "BROWSE" || !isset($_POST[str_replace (' ','_',$row["res_status"])])) { - $data[$row["rou_name"]][$row["assert_id"]][$row["descr_info"]][$row["descr_id"]][$row["run_name"]]=array( + $data[$row["rou_name"]][$row["descr_info"]][$row["assert_id"]][$row["descr_id"]][$row["run_name"]]=array( "status" => $row["res_status"], "log" => isset($_POST["logs"])?trim($row["res_log"]):$row["is_res_log"]); $displayed++; @@ -225,35 +222,42 @@ /* In case we are comparing several runs, we filter out the results which are the same for all runs */ if (($mode == "COMPARE") && !(isset($_POST["details"]))) { - foreach ($data as $routine => $assertsdata) - foreach ($assertsdata as $assert_id => $testdata) - foreach ($testdata as $testname => $desc_data) + foreach ($data as $routine => $testdata) + foreach ($testdata as $testname => $assertsdata) + { + $tmpres=""; + $diff=0; + $count = 0; + foreach ($assertsdata as $assert_id => $desc_data) foreach ($desc_data as $desc_id => $run_data) - { - $tmpres=""; - $diff=0; foreach ($run_data as $run_name => $detail) { + $count++; if (!$tmpres) $tmpres=$detail["status"]; // save the status of the 1st test elseif ($tmpres != $detail["status"]) $diff=1; // we found a difference, we must not delete this one } - if (!$diff) + + if ((!$diff) && ($count == count($runs))) + { + foreach ($assertsdata as $assert_id => $desc_data) + foreach ($desc_data as $desc_id => $run_data) { - unset ($data[$routine][$assert_id][$testname][$desc_id]); // No difference in this testcase + unset ($data[$routine][$testname][$assert_id][$desc_id]); // No difference in this testcase $displayed--; + // we cascade-delete the empty tree branchs + if (!$data[$routine][$testname][$assert_id]) unset($data[$routine][$testname][$assert_id]); + if (!$data[$routine][$testname]) unset($data[$routine][$testname]); + if (!$data[$routine]) unset($data[$routine]); + if (!$data) + die("The runs are identical -- aborted"); } - // we cascade-delete the empty tree branchs - if (!$data[$routine][$assert_id][$testname]) unset($data[$routine][$assert_id][$testname]); - if (!$data[$routine][$assert_id]) unset($data[$routine][$assert_id]); - if (!$data[$routine]) unset($data[$routine]); - if (!$data) - die("The runs are identical -- aborted"); - } + } + } } -ksort($runs); +//ksort($runs); ksort($data); //echo "<pre>\n"; @@ -362,29 +366,38 @@ echo " <tr>\n"; echo " <td"; $count=0; - foreach($rou_data as $assert_data) - $count += count($assert_data); + foreach($rou_data as $test_data) + $count += count($test_data); if ($count > 1) echo " rowspan='".$count."'"; echo ">".stringFromDB($routine)."</td>\n"; $first=1; $anomalie=0; - foreach ($rou_data as $assert_id => $assert_data) + foreach ($rou_data as $testcase => $test_data) { - $assert_first=1; - $countTC = count($assert_data); - foreach ($assert_data as $testcase => $test_data) + $test_first=1; + + if (!$first) + echo " <tr>\n"; + if ($test_first) { + echo " <td"; if (count($test_data) > 1) + echo " rowspan=".count($test_data); + echo ">".stringFromDB($testcase).($anomalie?" (*)":"")."</td>\n"; + } + + foreach ($test_data as $assert_id => $assert_data) + { + $assert_first=1; + $countTC = count($assert_data); + if ($countTC > 1) { $anomalie=1; $anomalies++; } - foreach ($test_data as $testid => $run_data) + foreach ($assert_data as $testid => $run_data) { - if (!$first) - echo " <tr>\n"; - echo " <td>".stringFromDB($testcase).($anomalie?" (*)":"")."</td>\n"; foreach ($runs as $run => $run_data_bis) { echo " <td>"; @@ -433,6 +446,7 @@ echo " </tr>\n"; $first=0; $assert_first=0; + $test_first=0; } } } Index: HISTORY =================================================================== RCS file: /cvsroot/tslogparser/tslogparser/HISTORY,v retrieving revision 1.28 retrieving revision 1.29 diff -u -d -r1.28 -r1.29 --- HISTORY 14 Jun 2005 12:42:46 -0000 1.28 +++ HISTORY 29 Jun 2005 14:37:30 -0000 1.29 @@ -1,3 +1,8 @@ +2005-06-29: +- Mods in run-browse.php and report.php to allow comparison + between several test suite releases. This has to be tested with the OPTS + module (OK with TAHI). + 2005-06-14: - Fix in detailed.php: add <pre> tags around assertion text and remove strip_tags around log details. |