bug 379327 - have mochitest print test filename in FAIL lines. r=sayrer
--- a/testing/mochitest/tests/SimpleTest/SimpleTest.js
+++ b/testing/mochitest/tests/SimpleTest/SimpleTest.js
@@ -60,27 +60,31 @@ SimpleTest.todo = function(condition, na
if (SimpleTest._logEnabled)
SimpleTest._logResult(test, "TODO WORKED?", "TODO");
SimpleTest._tests.push(test);
}
SimpleTest._logResult = function(test, passString, failString) {
var msg = test.result ? passString : failString;
msg += " | " + test.name;
+ var url = "";
+ if (parentRunner.currentTestURL)
+ url = " | " + parentRunner.currentTestURL;
+
if (test.result) {
if (test.todo)
- parentRunner.logger.error(msg)
+ parentRunner.logger.error(msg + url)
else
parentRunner.logger.log(msg);
} else {
msg += " | " + test.diag;
if (test.todo)
parentRunner.logger.log(msg)
else
- parentRunner.logger.error(msg);
+ parentRunner.logger.error(msg + url);
}
}
/**
* Copies of is and isnot with the call to ok replaced by a call to todo.
**/
SimpleTest.todo_is = function (a, b, name) {
--- a/testing/mochitest/tests/SimpleTest/TestRunner.js
+++ b/testing/mochitest/tests/SimpleTest/TestRunner.js
@@ -4,16 +4,17 @@
*
* * Avoid moving iframes: That causes reloads on mozilla and opera.
*
*
**/
var TestRunner = {};
TestRunner.logEnabled = false;
TestRunner._currentTest = 0;
+TestRunner.currentTestURL = "";
TestRunner._urls = [];
/**
* Make sure the tests don't hang. Runs every 300 seconds, but it will
* take up to 360 seconds to detect a hang.
**/
TestRunner._testCheckPoint = -1;
TestRunner._checkForHangs = function() {
@@ -81,16 +82,18 @@ TestRunner.runTests = function (/*url...
};
/**
* Run the next test. If no test remains, calls makeSummary
**/
TestRunner.runNextTest = function() {
if (TestRunner._currentTest < TestRunner._urls.length) {
var url = TestRunner._urls[TestRunner._currentTest];
+ TestRunner.currentTestURL = url;
+
$("current-test-path").innerHTML = url;
if (TestRunner.logEnabled)
TestRunner.logger.log("Running " + url + "...");
TestRunner._makeIframe(url);
} else {
$("current-test").innerHTML = "<b>Finished</b>";