couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cml...@apache.org
Subject svn commit: r734968 - /couchdb/trunk/share/www/script/couch_test_runner.js
Date Fri, 16 Jan 2009 10:51:16 GMT
Author: cmlenz
Date: Fri Jan 16 02:51:15 2009
New Revision: 734968

URL: http://svn.apache.org/viewvc?rev=734968&view=rev
Log:
Show total elapsed time in test suite. Closes COUCHDB-203.

Modified:
    couchdb/trunk/share/www/script/couch_test_runner.js

Modified: couchdb/trunk/share/www/script/couch_test_runner.js
URL: http://svn.apache.org/viewvc/couchdb/trunk/share/www/script/couch_test_runner.js?rev=734968&r1=734967&r2=734968&view=diff
==============================================================================
--- couchdb/trunk/share/www/script/couch_test_runner.js (original)
+++ couchdb/trunk/share/www/script/couch_test_runner.js Fri Jan 16 02:51:15 2009
@@ -41,7 +41,7 @@
 
 function runAllTests() {
   var rows = $("#tests tbody.content tr");
-  $("td", rows).html(" ");
+  $("td", rows).text("");
   $("td.status", rows).removeClass("error").removeClass("failure").removeClass("success").text("not
run");
   var offset = 0;
   function runNext() {
@@ -66,7 +66,7 @@
   }
   var row = currentRow = $(button).parents("tr").get(0);
   $("td.status", row).removeClass("error").removeClass("failure").removeClass("success");
-  $("td", row).html(" ");
+  $("td", row).text("");
   var testFun = tests[row.id];
   function run() {
     numFailures = 0;
@@ -115,15 +115,14 @@
 
 function updateTestsListing() {
   for (var name in tests) {
-    if (!tests.hasOwnProperty(name)) continue;
     var testFunction = tests[name];
     var row = $("<tr><th></th><td></td><td></td><td></td></tr>")
       .find("th").text(name).attr("title", "Show source").click(function() {
         showSource(this);
       }).end()
       .find("td:nth(0)").addClass("status").text("not run").end()
-      .find("td:nth(1)").addClass("duration").html("&nbsp;").end()
-      .find("td:nth(2)").addClass("details").html("&nbsp;").end();
+      .find("td:nth(1)").addClass("duration").end()
+      .find("td:nth(2)").addClass("details").end();
     $("<button type='button' class='run' title='Run test'></button>").click(function()
{
       this.blur();
       runTest(this);
@@ -139,8 +138,14 @@
   var tests = $("#tests tbody.content tr td.status");
   var testsRun = tests.filter(".success, .error, .failure");
   var testsFailed = testsRun.not(".success");
+  var totalDuration = 0;
+  $("#tests tbody.content tr td.duration:contains('ms')").each(function() {
+    var text = $(this).text();
+    totalDuration += parseInt(text.substr(0, text.length - 2), 10);
+  });
   $("#tests tbody.footer td").text(testsRun.length + " of " + tests.length +
-    " test(s) run, " + testsFailed.length + " failures");
+    " test(s) run, " + testsFailed.length + " failures (" +
+    totalDuration + " ms)");
 }
 
 // Use T to perform a test that returns false on failure and if the test fails,



Mime
View raw message