From c829bc5fc3db8e9b08e5376362032fef4fc57fa3 Mon Sep 17 00:00:00 2001 From: John Christopher Anderson Date: Wed, 14 Oct 2009 06:35:04 +0000 Subject: tests not loading git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@825018 13f79535-47bb-0310-9956-ffa450edef68 --- share/www/couch_tests.html | 2 +- share/www/script/couch_test_runner.js | 50 +++++++++++++++-------------------- 2 files changed, 23 insertions(+), 29 deletions(-) (limited to 'share') diff --git a/share/www/couch_tests.html b/share/www/couch_tests.html index 76191938..173e9cb3 100644 --- a/share/www/couch_tests.html +++ b/share/www/couch_tests.html @@ -37,7 +37,7 @@ specific language governing permissions and limitations under the License. }); }); var testsPath = document.location.toString().split('?')[1]; - loadScript(testsPath||"script/couch_tests.js") + loadScript(testsPath||"script/couch_tests.js");
diff --git a/share/www/script/couch_test_runner.js b/share/www/script/couch_test_runner.js index 431c0aa7..221d83d1 100644 --- a/share/www/script/couch_test_runner.js +++ b/share/www/script/couch_test_runner.js @@ -12,6 +12,7 @@ // *********************** Test Framework of Sorts ************************* // + function loadScript(url) { if (typeof document != "undefined") document.write(''); }; @@ -145,12 +146,6 @@ function updateTestsFooter() { $("#tests tbody.footer td").html(""+testsRun.length + " of " + tests.length + " test(s) run, " + testsFailed.length + " failures (" + totalDuration + " ms) "); - if (testsFailed.length > 0) { - $("#tests tbody.footer td").append($('Click to Report Test Failures').click(function(e) { - e.preventDefault(); - reportTests(); - })); - } } // make report and save to local db @@ -159,9 +154,7 @@ function updateTestsFooter() { function saveTestReport() { var subject = $("#tests tbody.footer td").text(); - var report = { - "failures" : failureList - } + var report = makeTestReport(); var db = $.couch.db("test_suite_reports"); var saveReport = function() { db.saveDoc(report); @@ -169,9 +162,9 @@ function saveTestReport() { db.create({error: saveReport, success: saveReport}); }; -function testReport() { - var report = []; - report.push(testPlatform()+"\n"); +function makeTestReport() { + var report = {}; + report.platform = testPlatform()); $("#tests tbody.content tr").each(function() { var status = $("td.status", this).text(); if (status != "not run") { @@ -198,22 +191,22 @@ function testPlatform() { function reportTests() { - var summary = $("#tests tbody.footer td span").text(); - var report = testReport(); - var uri = "http://groups.google.com/group/couchdb-test-report/post" - + "?subject=" + escape(summary); - - var d=document; - var f=d.createElement("form"); - // f.style.display='none'; - f.action=uri; - f.method="POST";f.target="_blank"; - var t=d.createElement("textarea"); - t.name="body"; - t.value=report; - f.appendChild(t); - d.body.appendChild(f); - f.submit(); + // var summary = $("#tests tbody.footer td span").text(); + // var report = makeTestReport(); + // var uri = "http://groups.google.com/group/couchdb-test-report/post" + // + "?subject=" + escape(summary); + // + // var d=document; + // var f=d.createElement("form"); + // // f.style.display='none'; + // f.action=uri; + // f.method="POST";f.target="_blank"; + // var t=d.createElement("textarea"); + // t.name="body"; + // t.value=report; + // f.appendChild(t); + // d.body.appendChild(f); + // f.submit(); } // Use T to perform a test that returns false on failure and if the test fails, @@ -257,3 +250,4 @@ function repr(val) { return JSON.stringify(val); } } + -- cgit v1.2.3