summaryrefslogtreecommitdiff
path: root/share
diff options
context:
space:
mode:
authorChristopher Lenz <cmlenz@apache.org>2009-01-16 10:51:15 +0000
committerChristopher Lenz <cmlenz@apache.org>2009-01-16 10:51:15 +0000
commit4bd235f6ddcce66a6f0cba753702ff6f47088ccb (patch)
tree66cd651e2f2db558c9891e6dbe47f00ff78ee667 /share
parent19a1c58f04cef79e188ac603e5dbdd5d284d48e0 (diff)
Show total elapsed time in test suite. Closes COUCHDB-203.
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@734968 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'share')
-rw-r--r--share/www/script/couch_test_runner.js17
1 files changed, 11 insertions, 6 deletions
diff --git a/share/www/script/couch_test_runner.js b/share/www/script/couch_test_runner.js
index 09ba6f4d..31bd4a4a 100644
--- a/share/www/script/couch_test_runner.js
+++ b/share/www/script/couch_test_runner.js
@@ -41,7 +41,7 @@ function patchTest(fun) {
function runAllTests() {
var rows = $("#tests tbody.content tr");
- $("td", rows).html("&nbsp;");
+ $("td", rows).text("");
$("td.status", rows).removeClass("error").removeClass("failure").removeClass("success").text("not run");
var offset = 0;
function runNext() {
@@ -66,7 +66,7 @@ function runTest(button, callback, debug) {
}
var row = currentRow = $(button).parents("tr").get(0);
$("td.status", row).removeClass("error").removeClass("failure").removeClass("success");
- $("td", row).html("&nbsp;");
+ $("td", row).text("");
var testFun = tests[row.id];
function run() {
numFailures = 0;
@@ -115,15 +115,14 @@ function showSource(cell) {
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 @@ function updateTestsFooter() {
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,