bug 379327 - have mochitest print test filename in FAIL lines. r=sayrer

This commit is contained in:
ted.mielczarek@gmail.com 2007-09-04 06:02:34 -07:00
Родитель 98f86293af
Коммит 2734931499
2 изменённых файлов: 9 добавлений и 2 удалений

Просмотреть файл

@ -65,9 +65,13 @@ SimpleTest.todo = function(condition, name, diag) {
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 {
@ -75,7 +79,7 @@ SimpleTest._logResult = function(test, passString, failString) {
if (test.todo)
parentRunner.logger.log(msg)
else
parentRunner.logger.error(msg);
parentRunner.logger.error(msg + url);
}
}

Просмотреть файл

@ -9,6 +9,7 @@
var TestRunner = {};
TestRunner.logEnabled = false;
TestRunner._currentTest = 0;
TestRunner.currentTestURL = "";
TestRunner._urls = [];
/**
@ -86,6 +87,8 @@ TestRunner.runTests = function (/*url...*/) {
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)