old mode 100644
new mode 100755
--- a/testing/xpcshell/selftest.py
+++ b/testing/xpcshell/selftest.py
@@ -414,16 +414,20 @@ class XPCShellTestsTests(unittest.TestCa
self.log = StringIO()
self.tempdir = tempfile.mkdtemp()
self.utility_path = os.path.join(objdir, 'dist', 'bin')
logger = structured.commandline.setup_logging("selftest%s" % id(self),
{},
{"tbpl": self.log})
self.x = XPCShellTests(logger)
self.x.harness_timeout = 15
+ self.symbols_path = None
+ candidate_path = os.path.join(build_obj.distdir, 'crashreporter-symbols')
+ if (os.path.isdir(candidate_path)):
+ self.symbols_path = candidate_path
def tearDown(self):
shutil.rmtree(self.tempdir)
def writeFile(self, name, contents):
"""
Write |contents| to a file named |name| in the temp directory,
and return the full path to the file.
@@ -449,25 +453,24 @@ class XPCShellTestsTests(unittest.TestCa
testlines.extend(t[1:])
self.manifest = self.writeFile("xpcshell.ini", """
[DEFAULT]
head =
tail =
""" + "\n".join(testlines))
- def assertTestResult(self, expected, shuffle=False, verbose=False,
- symbolsPath=None):
+ def assertTestResult(self, expected, shuffle=False, verbose=False):
"""
Assert that self.x.runTests with manifest=self.manifest
returns |expected|.
"""
self.assertEquals(expected,
self.x.runTests(xpcshellBin,
- symbolsPath=symbolsPath,
+ symbolsPath=self.symbols_path,
manifest=self.manifest,
mozInfo=mozinfo.info,
shuffle=shuffle,
verbose=verbose,
sequential=True,
testingModulesDir=os.path.join(objdir, '_tests', 'modules'),
utility_path=self.utility_path),
msg="""Tests should have %s, log:
@@ -527,35 +530,27 @@ tail =
self.assertNotInLog(TEST_PASS_STRING)
@unittest.skipIf(mozinfo.isWin or not mozinfo.info.get('debug'),
'We don\'t have a stack fixer on hand for windows.')
def testAssertStack(self):
"""
When an assertion is hit, we should produce a useful stack.
"""
- # Passing symbolsPath will cause the stack fixer to use
- # fix_stack_using_bpsyms and exercise the fileid utility in
- # this test.
- symbolsPath = None
- candidate_path = os.path.join(build_obj.distdir, 'crashreporter-symbols')
- if os.path.isdir(candidate_path):
- symbolsPath = candidate_path
-
self.writeFile("test_assert.js", '''
add_test(function test_asserts_immediately() {
Components.classes["@mozilla.org/xpcom/debug;1"]
.getService(Components.interfaces.nsIDebug2)
.assertion("foo", "assertion failed", "test.js", 1)
run_next_test();
});
''')
self.writeManifest(["test_assert.js"])
- self.assertTestResult(False, symbolsPath=symbolsPath)
+ self.assertTestResult(False)
self.assertInLog("###!!! ASSERTION")
log_lines = self.log.getvalue().splitlines()
line_pat = "#\d\d:"
unknown_pat = "#\d\d\: \?\?\?\[.* \+0x[a-f0-9]+\]"
self.assertFalse(any(re.search(unknown_pat, line) for line in log_lines),
"An stack frame without symbols was found in\n%s" % pprint.pformat(log_lines))
self.assertTrue(any(re.search(line_pat, line) for line in log_lines),