Author: cfinck
Date: Fri Apr 17 21:13:01 2009
New Revision: 377

URL: http://svn.reactos.org/svn/reactos?rev=377&view=rev
Log:
- Remove "Tests marked as TODO", that's a Wine-specific thing we don't need to 
know about
- Change the layout, so that everything fits into one line (idea by Christoph)
- Don't compare differences for a specific result in case the test crashed

Modified:
    branches/danny-web/resources/testman/testman.sql
    branches/danny-web/www/www.reactos.org/testman/compare.php
    branches/danny-web/www/www.reactos.org/testman/css/compare.css
    branches/danny-web/www/www.reactos.org/testman/detail.php
    branches/danny-web/www/www.reactos.org/testman/js/compare.js.php
    branches/danny-web/www/www.reactos.org/testman/lang/de.inc.php
    branches/danny-web/www/www.reactos.org/testman/lang/en.inc.php
    branches/danny-web/www/www.reactos.org/testman/lang/pl.inc.php
    
branches/danny-web/www/www.reactos.org/testman/webservice/lib/WineTest.class.php

Modified: branches/danny-web/resources/testman/testman.sql
URL: 
http://svn.reactos.org/svn/reactos/branches/danny-web/resources/testman/testman.sql?rev=377&r1=376&r2=377&view=diff
==============================================================================
--- branches/danny-web/resources/testman/testman.sql [iso-8859-1] (original)
+++ branches/danny-web/resources/testman/testman.sql [iso-8859-1] Fri Apr 17 
21:13:01 2009
@@ -16,7 +16,6 @@
   `test_id` int(10) unsigned NOT NULL,
   `suite_id` int(10) unsigned NOT NULL,
   `count` int(10) NOT NULL COMMENT 'Number of all executed tests',
-  `todo` int(10) unsigned NOT NULL COMMENT 'Tests marked as TODO',
   `failures` int(10) unsigned NOT NULL COMMENT 'Number of failed tests',
   `skipped` int(10) unsigned NOT NULL COMMENT 'Number of skipped tests',
   PRIMARY KEY  (`id`),

Modified: branches/danny-web/www/www.reactos.org/testman/compare.php
URL: 
http://svn.reactos.org/svn/reactos/branches/danny-web/www/www.reactos.org/testman/compare.php?rev=377&r1=376&r2=377&view=diff
==============================================================================
--- branches/danny-web/www/www.reactos.org/testman/compare.php [iso-8859-1] 
(original)
+++ branches/danny-web/www/www.reactos.org/testman/compare.php [iso-8859-1] Fri 
Apr 17 21:13:01 2009
@@ -17,22 +17,22 @@
        GetLanguage();
        require_once("lang/$lang.inc.php");
        
-
-       function GetValueForResult($result)
-       {
-               // If a test crashed, return a numeric value of 0, so that the 
comparison is accurate
-               if($result == -1)
-                       return 0;
-               
-               return $result;
-       }
        
        function GetDifference(&$current_result_row, &$prev_result_row, 
$subject)
        {
-               if(!$prev_result_row["id"] || $current_result_row[$subject] == 
$prev_result_row[$subject])
+               // Return   ("" is not possible because of IE...) if
+               //  - we have nothing to compare
+               //  - both values are identical
+               //  - a crash occured in one of the results
+               if(!$prev_result_row["id"] ||
+                  $current_result_row[$subject] == $prev_result_row[$subject] 
||
+                  $current_result_row[$subject] == -1 ||
+                  $prev_result_row[$subject] == -1)
+               {
                        return " ";
-               
-               $diff = GetValueForResult($current_result_row[$subject]) - 
GetValueForResult($prev_result_row[$subject]);
+               }
+               
+               $diff = $current_result_row[$subject] - 
$prev_result_row[$subject];
                
                if($diff > 0)
                        return "(+$diff)";
@@ -104,9 +104,6 @@
        <div class="real_failedtests" style="border: solid 1px black; 
border-left: none; width: 7px;"></div>
        <div class="desc"><?php echo $testman_langres["failedtests"]; ?></div>
        
-       <div class="box todotests"></div>
-       <div class="desc"><?php echo $testman_langres["todotests"]; ?></div>
-       
        <div class="box skippedtests"></div>
        <div class="desc"><?php echo $testman_langres["skippedtests"]; ?></div>
        
@@ -142,7 +139,7 @@
        for($i = 0; $i < count($id_array); $i++)
        {
                $result_stmt[$i] = $dbh->prepare(
-                       "SELECT e.id, e.count, e.todo, e.failures, e.skipped " .
+                       "SELECT e.id, e.count, e.failures, e.skipped " .
                        "FROM " . DB_TESTMAN . ".winetest_suites s " .
                        "LEFT JOIN " . DB_TESTMAN . ".winetest_results e ON 
e.suite_id = s.id AND e.test_id = :testid " .
                        "WHERE s.id IN (" . $suite_idlist . ")" .
@@ -198,7 +195,6 @@
                $prev_result_row = null;
                $temp_totaltests = -2;
                $temp_failedtests = -2;
-               $temp_todotests = -2;
                $temp_skippedtests = -2;
                
                for($i = 0; $i < count($result_stmt); $i++)
@@ -215,19 +211,13 @@
                        // Check whether there are any changes within the test 
results of several runs
                        CheckIfChanged($changed, $temp_totaltests, 
$result_row["count"]);
                        CheckIfChanged($changed, $temp_failedtests, 
$result_row["failures"]);
-                       CheckIfChanged($changed, $temp_todotests, 
$result_row["todo"]);
                        CheckIfChanged($changed, $temp_skippedtests, 
$result_row["skipped"]);
                        
                        if($result_row["id"])
                        {
-                               echo '<table class="celltable">';
-                               echo '<tr>';
-                               printf('<td colspan="3" title="%s" 
class="totaltests">%s <span class="diff">%s</span></td>', 
$testman_langres["totaltests"], GetTotalTestsString($result_row["count"]), 
GetDifference($result_row, $prev_result_row, "count"));
-                               echo '</tr><tr>';
-                               printf('<td title="%s" 
class="%s_failedtests">%d <span class="diff">%s</span></td>', 
$testman_langres["failedtests"], (($result_row["failures"] > 0 || 
$result_row["count"] == -1) ? 'real' : 'zero'), $result_row["failures"], 
GetDifference($result_row, $prev_result_row, "failures"));
-                               printf('<td title="%s" class="todotests">%d 
<span class="diff">%s</span></td>', $testman_langres["todotests"], 
$result_row["todo"], GetDifference($result_row, $prev_result_row, "todo"));
-                               printf('<td title="%s" class="skippedtests">%d 
<span class="diff">%s</span></td>', $testman_langres["skippedtests"], 
$result_row["skipped"], GetDifference($result_row, $prev_result_row, 
"skipped"));
-                               echo '</tr></table>';
+                               printf('<div title="%s" class="box 
totaltests">%s <span class="diff">%s</span></div>', 
$testman_langres["totaltests"], GetTotalTestsString($result_row["count"]), 
GetDifference($result_row, $prev_result_row, "count"));
+                               printf('<div title="%s" class="box 
%s_failedtests">%d <span class="diff">%s</span></div>', 
$testman_langres["failedtests"], (($result_row["failures"] > 0 || 
$result_row["count"] == -1) ? 'real' : 'zero'), $result_row["failures"], 
GetDifference($result_row, $prev_result_row, "failures"));
+                               printf('<div title="%s" class="box 
skippedtests">%d <span class="diff">%s</span></div>', 
$testman_langres["skippedtests"], $result_row["skipped"], 
GetDifference($result_row, $prev_result_row, "skipped"));
                        }
                        else
                        {

Modified: branches/danny-web/www/www.reactos.org/testman/css/compare.css
URL: 
http://svn.reactos.org/svn/reactos/branches/danny-web/www/www.reactos.org/testman/css/compare.css?rev=377&r1=376&r2=377&view=diff
==============================================================================
--- branches/danny-web/www/www.reactos.org/testman/css/compare.css [iso-8859-1] 
(original)
+++ branches/danny-web/www/www.reactos.org/testman/css/compare.css [iso-8859-1] 
Fri Apr 17 21:13:01 2009
@@ -45,10 +45,6 @@
        background-color: #FF6666 !important;
 }
 
-.todotests {
-       background-color: #9999FF !important;
-}
-
 .skippedtests {
        background-color: #CCCCCC !important;
 }
@@ -65,6 +61,8 @@
        background: #5984C3;
        color: white;
        font-weight: bold;
+       position: absolute;
+       width: 325px;
 }
 
 #comparetable {
@@ -82,7 +80,7 @@
        width: 200px;
 }
 
-#comparetable td {
+#comparetable td, #comparetable td div.box {
        border-right: solid 1px #BBBBBB;
        border-bottom: solid 1px #BBBBBB;
        padding: 3px;
@@ -92,14 +90,16 @@
        cursor: pointer;
 }
 
-.celltable {
-       width: 215px;
-}
-
-.celltable td {
+#comparetable td div {
        text-align: center;
 }
 
-.celltable td.totaltests {
+#comparetable td div.box {
+       float: left;
+       width: 95px;
+}
+
+#comparetable td div.totaltests {
        font-weight: bold;
+       width: 120px;
 }

Modified: branches/danny-web/www/www.reactos.org/testman/detail.php
URL: 
http://svn.reactos.org/svn/reactos/branches/danny-web/www/www.reactos.org/testman/detail.php?rev=377&r1=376&r2=377&view=diff
==============================================================================
--- branches/danny-web/www/www.reactos.org/testman/detail.php [iso-8859-1] 
(original)
+++ branches/danny-web/www/www.reactos.org/testman/detail.php [iso-8859-1] Fri 
Apr 17 21:13:01 2009
@@ -52,7 +52,7 @@
        
        // Get information about this result
        $stmt = $dbh->prepare(
-               "SELECT l.log, e.count, e.todo, e.failures, e.skipped, 
s.module, s.test, UNIX_TIMESTAMP(r.timestamp) timestamp, r.revision, 
r.platform, a.name, r.comment " .
+               "SELECT l.log, e.count, e.failures, e.skipped, s.module, 
s.test, UNIX_TIMESTAMP(r.timestamp) timestamp, r.revision, r.platform, a.name, 
r.comment " .
                "FROM " . DB_TESTMAN . ".winetest_results e " .
                "JOIN " . DB_TESTMAN . ".winetest_logs l ON e.id = l.id " .
                "JOIN " . DB_TESTMAN . ".winetest_suites s ON e.suite_id = s.id 
" .
@@ -81,10 +81,6 @@
        <tr class="even" onmouseover="Row_OnMouseOver(this)" 
onmouseout="Row_OnMouseOut(this)">
                <td class="info"><?php echo $testman_langres["failedtests"]; 
?>:</td>
                <td><?php echo $row["failures"]; ?></td>
-       </tr>
-       <tr class="odd" onmouseover="Row_OnMouseOver(this)" 
onmouseout="Row_OnMouseOut(this)">
-               <td class="info"><?php echo $testman_langres["todotests"]; 
?>:</td>
-               <td><?php echo $row["todo"]; ?></td>
        </tr>
        <tr class="even" onmouseover="Row_OnMouseOver(this)" 
onmouseout="Row_OnMouseOut(this)">
                <td class="info"><?php echo $testman_langres["skippedtests"]; 
?>:</td>

Modified: branches/danny-web/www/www.reactos.org/testman/js/compare.js.php
URL: 
http://svn.reactos.org/svn/reactos/branches/danny-web/www/www.reactos.org/testman/js/compare.js.php?rev=377&r1=376&r2=377&view=diff
==============================================================================
--- branches/danny-web/www/www.reactos.org/testman/js/compare.js.php 
[iso-8859-1] (original)
+++ branches/danny-web/www/www.reactos.org/testman/js/compare.js.php 
[iso-8859-1] Fri Apr 17 21:13:01 2009
@@ -76,12 +76,12 @@
                // Remove all difference data in this case as there is no 
previous element
                for(var i = 0; i < trs.length; i++)
                {
-                       var tds = 
trs[i].childNodes[Index].getElementsByTagName("td");
-                       
-                       for(var j = 0; j < tds.length; j++)
+                       var divs = 
trs[i].childNodes[Index].getElementsByTagName("div");
+                       
+                       for(var j = 0; j < divs.length; j++)
                        {
                                // \u00A0 = &nbsp;
-                               
tds[j].getElementsByTagName("span")[0].firstChild.data = "\u00A0";
+                               
divs[j].getElementsByTagName("span")[0].firstChild.data = "\u00A0";
                        }
                }
                
@@ -91,28 +91,35 @@
        // No, then add the difference data accordingly
        for(var i = 0; i < trs.length; i++)
        {
-               // We can only add difference data if the current table and the 
previous one contain tables with result data
-               if(trs[i].childNodes[Index].firstChild.nodeName != "TABLE" || 
trs[i].childNodes[Index - 1].firstChild.nodeName != "TABLE")
+               // We can only add difference data if the current table and the 
previous one contain result data
+               if(trs[i].childNodes[Index].firstChild.nodeName != "DIV" || 
trs[i].childNodes[Index - 1].firstChild.nodeName != "DIV")
                        continue;
                
-               var tds = trs[i].childNodes[Index].getElementsByTagName("td");
-               
-               for(var j = 0; j < tds.length; j++)
+               var divs = trs[i].childNodes[Index].childNodes;
+               
+               for(var j = 0; j < divs.length; j++)
                {
-                       var CurrentValue = GetValueForResult(tds[j]);
-                       var PreviousValue = 
GetValueForResult(trs[i].childNodes[Index - 1].getElementsByTagName("td")[j]);
-                       
-                       // Calculate the difference
-                       var Diff = CurrentValue - PreviousValue;
-                       
-                       if(Diff > 0)
-                               var DiffString = String("(+" + Diff + ")");
-                       else if(Diff < 0)
-                               var DiffString = String("(" + Diff + ")");
+                       var CurrentValue = divs[j].firstChild.data;
+                       var PreviousValue = trs[i].childNodes[Index - 
1].childNodes[j].firstChild.data;
+                       
+                       if(CurrentValue == PreviousValue || CurrentValue == -1 
|| PreviousValue == -1)
+                       {
+                               var DiffString = "\u00A0";
+                       }
                        else
-                               var DiffString = "\u00A0";
-                       
-                       tds[j].getElementsByTagName("span")[0].firstChild.data 
= DiffString;
+                       {
+                               // Calculate the difference
+                               var Diff = CurrentValue - PreviousValue;
+                               
+                               if(Diff > 0)
+                                       var DiffString = String("(+" + Diff + 
")");
+                               else if(Diff < 0)
+                                       var DiffString = String("(" + Diff + 
")");
+                               else
+                                       var DiffString = "\u00A0";
+                       }
+                       
+                       divs[j].getElementsByTagName("span")[0].firstChild.data 
= DiffString;
                }
        }
 }
@@ -188,7 +195,6 @@
                        
TempBlock.appendChild(DragColumn.childNodes[i].cloneNode(true));
                
                TempBlock.id = "TempBlock";
-               TempBlock.style.position = "absolute";
                TempBlock.style.top = GetAbsoluteOffsetTop(DragColumn) + "px";
                
                document.body.insertBefore(TempBlock, 
document.getElementById("comparetable"));

Modified: branches/danny-web/www/www.reactos.org/testman/lang/de.inc.php
URL: 
http://svn.reactos.org/svn/reactos/branches/danny-web/www/www.reactos.org/testman/lang/de.inc.php?rev=377&r1=376&r2=377&view=diff
==============================================================================
--- branches/danny-web/www/www.reactos.org/testman/lang/de.inc.php [iso-8859-1] 
(original)
+++ branches/danny-web/www/www.reactos.org/testman/lang/de.inc.php [iso-8859-1] 
Fri Apr 17 21:13:01 2009
@@ -44,7 +44,6 @@
                "legend" => "Legende",
                "totaltests" => "Alle Tests",
                "failedtests" => "Fehlgeschlagene Tests",
-               "todotests" => "Als TODO markierte Tests",
                "skippedtests" => "Übersprungene Tests",
                "difference" => "Unterschied zum vorherigen Ergebnis",
                

Modified: branches/danny-web/www/www.reactos.org/testman/lang/en.inc.php
URL: 
http://svn.reactos.org/svn/reactos/branches/danny-web/www/www.reactos.org/testman/lang/en.inc.php?rev=377&r1=376&r2=377&view=diff
==============================================================================
--- branches/danny-web/www/www.reactos.org/testman/lang/en.inc.php [iso-8859-1] 
(original)
+++ branches/danny-web/www/www.reactos.org/testman/lang/en.inc.php [iso-8859-1] 
Fri Apr 17 21:13:01 2009
@@ -44,7 +44,6 @@
                "legend" => "Legend",
                "totaltests" => "Total Tests",
                "failedtests" => "Failed Tests",
-               "todotests" => "Tests marked as TODO",
                "skippedtests" => "Skipped tests",
                "difference" => "Difference to the previous result",
                

Modified: branches/danny-web/www/www.reactos.org/testman/lang/pl.inc.php
URL: 
http://svn.reactos.org/svn/reactos/branches/danny-web/www/www.reactos.org/testman/lang/pl.inc.php?rev=377&r1=376&r2=377&view=diff
==============================================================================
--- branches/danny-web/www/www.reactos.org/testman/lang/pl.inc.php [iso-8859-1] 
(original)
+++ branches/danny-web/www/www.reactos.org/testman/lang/pl.inc.php [iso-8859-1] 
Fri Apr 17 21:13:01 2009
@@ -45,7 +45,6 @@
                "legend" => "Legenda",
                "totaltests" => "Wszystkie testy",
                "failedtests" => "Nieudane",
-               "todotests" => "Oznaczone jako TODO",
                "skippedtests" => "Pominięte",
                "difference" => "Różnica względem poprzedniego wyniku",
                

Modified: 
branches/danny-web/www/www.reactos.org/testman/webservice/lib/WineTest.class.php
URL: 
http://svn.reactos.org/svn/reactos/branches/danny-web/www/www.reactos.org/testman/webservice/lib/WineTest.class.php?rev=377&r1=376&r2=377&view=diff
==============================================================================
--- 
branches/danny-web/www/www.reactos.org/testman/webservice/lib/WineTest.class.php
 [iso-8859-1] (original)
+++ 
branches/danny-web/www/www.reactos.org/testman/webservice/lib/WineTest.class.php
 [iso-8859-1] Fri Apr 17 21:13:01 2009
@@ -78,17 +78,15 @@
                                // We found no summary line, so the test 
probably crashed
                                // Indicate this by setting count to -1 and set 
the rest to zero.
                                $count = -1;
-                               $todo = 0;
                                $failures = 0;
                                $skipped = 0;
                        }
                        
                        // Add the information into the DB
-                       $stmt = $dbh->prepare("INSERT INTO " . DB_TESTMAN . 
".winetest_results (test_id, suite_id, count, todo, failures, skipped) VALUES 
(:testid, :suiteid, :count, :todo, :failures, :skipped)");
+                       $stmt = $dbh->prepare("INSERT INTO " . DB_TESTMAN . 
".winetest_results (test_id, suite_id, count, failures, skipped) VALUES 
(:testid, :suiteid, :count, :failures, :skipped)");
                        $stmt->bindValue(":testid", (int)$test_id);
                        $stmt->bindValue(":suiteid", (int)$suite_id);
                        $stmt->bindParam(":count", $count);
-                       $stmt->bindParam(":todo", $todo);
                        $stmt->bindParam(":failures", $failures);
                        $stmt->bindParam(":skipped", $skipped);
                        $stmt->execute() or die("Submit(): SQL failed #2");

Reply via email to