Bug 1036639 - Report correct filename from xpcshell/head.js when using do_check_* assertion functions.;r=gps

This commit is contained in:
Chris Manchester 2014-07-09 20:24:59 -04:00
parent aa6feee34d
commit f367a664b7
2 changed files with 16 additions and 0 deletions

View File

@ -723,6 +723,9 @@ function todo_check_neq(left, right, stack) {
}
function do_report_result(passed, text, stack, todo) {
while (stack.filename.contains("head.js") && stack.caller) {
stack = stack.caller;
}
if (passed) {
if (todo) {
do_throw_todo(text, stack);

View File

@ -537,6 +537,19 @@ tail =
self.assertEquals(1, self.x.passCount)
self.assertEquals(0, self.x.failCount)
def testLogCorrectFileName(self):
"""
Make sure a meaningful filename and line number is logged
by a passing test.
"""
self.writeFile("test_add_test_simple.js", ADD_TEST_SIMPLE)
self.writeManifest(["test_add_test_simple.js"])
self.assertTestResult(True, verbose=True)
self.assertInLog("true == true")
self.assertNotInLog("[do_check_true :")
self.assertInLog("[test_simple : 5]")
def testAddTestFailing(self):
"""
Ensure add_test() with a failing test is reported.