mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-11 12:25:53 +00:00
Bug 503613 - Remove the tail file functionality from xpcshell; r=gps
MozReview-Commit-ID: JcglhFl89DX --HG-- extra : rebase_source : e268c51b9124cebdc7dd39999bc5ac9ad466b1d8 extra : histedit_source : ee311347d6ce83466f926662392f63b3089a103c
This commit is contained in:
parent
d6f8033af2
commit
9d595b6142
@ -1351,7 +1351,6 @@ class TreeMetadataEmitter(LoggingMixin):
|
||||
'manifest': source_manifest,
|
||||
'name': mozpath.basename(test),
|
||||
'head': '',
|
||||
'tail': '',
|
||||
'support-files': '',
|
||||
'subsuite': '',
|
||||
})
|
||||
@ -1386,7 +1385,6 @@ class TreeMetadataEmitter(LoggingMixin):
|
||||
'manifest': manifest_path,
|
||||
'name': test.id,
|
||||
'head': '',
|
||||
'tail': '',
|
||||
'support-files': '',
|
||||
'subsuite': '',
|
||||
})
|
||||
|
@ -1,6 +1,5 @@
|
||||
[DEFAULT]
|
||||
head = head1 head2
|
||||
tail = tail1 tail2
|
||||
dupe-manifest =
|
||||
|
||||
[test_xpcshell.js]
|
||||
|
@ -600,8 +600,6 @@ class TestEmitterBasic(unittest.TestCase):
|
||||
'test_xpcshell.js': True,
|
||||
'head1': False,
|
||||
'head2': False,
|
||||
'tail1': False,
|
||||
'tail2': False,
|
||||
},
|
||||
},
|
||||
'reftest.list': {
|
||||
|
@ -48,7 +48,6 @@ ALL_TESTS = {
|
||||
"name": "test_async_chain.js",
|
||||
"path": "/Users/gps/src/firefox/services/common/tests/unit/test_async_chain.js",
|
||||
"relpath": "test_async_chain.js",
|
||||
"tail": ""
|
||||
}
|
||||
],
|
||||
"services/common/tests/unit/test_async_querySpinningly.js": [
|
||||
@ -63,7 +62,6 @@ ALL_TESTS = {
|
||||
"name": "test_async_querySpinningly.js",
|
||||
"path": "/Users/gps/src/firefox/services/common/tests/unit/test_async_querySpinningly.js",
|
||||
"relpath": "test_async_querySpinningly.js",
|
||||
"tail": ""
|
||||
}
|
||||
],
|
||||
"toolkit/mozapps/update/test/unit/test_0201_app_launch_apply_update.js": [
|
||||
@ -81,7 +79,6 @@ ALL_TESTS = {
|
||||
"relpath": "test_0201_app_launch_apply_update.js",
|
||||
"run-sequentially": "Launches application.",
|
||||
"skip-if": "toolkit == 'gonk' || os == 'android'",
|
||||
"tail": ""
|
||||
},
|
||||
{
|
||||
"dir_relpath": "toolkit/mozapps/update/test/unit",
|
||||
@ -97,7 +94,6 @@ ALL_TESTS = {
|
||||
"relpath": "test_0201_app_launch_apply_update.js",
|
||||
"run-sequentially": "Launches application.",
|
||||
"skip-if": "toolkit == 'gonk' || os == 'android'",
|
||||
"tail": ""
|
||||
}
|
||||
],
|
||||
"mobile/android/tests/background/junit3/src/common/TestAndroidLogWriters.java": [
|
||||
|
@ -340,7 +340,6 @@ class SupportFilesConverter(object):
|
||||
"""
|
||||
def __init__(self):
|
||||
self._fields = (('head', set()),
|
||||
('tail', set()),
|
||||
('support-files', set()),
|
||||
('generated-files', set()))
|
||||
|
||||
@ -382,7 +381,7 @@ class SupportFilesConverter(object):
|
||||
elif pattern[0] == '!':
|
||||
info.deferred_installs.add(pattern)
|
||||
# We only support globbing on support-files because
|
||||
# the harness doesn't support * for head and tail.
|
||||
# the harness doesn't support * for head.
|
||||
elif '*' in pattern and field == 'support-files':
|
||||
info.pattern_installs.append((manifest_dir, pattern, out_dir))
|
||||
# "absolute" paths identify files that are to be
|
||||
|
@ -577,9 +577,6 @@ function _execute_test() {
|
||||
coverageCollector.finalize();
|
||||
}
|
||||
|
||||
// _TAIL_FILES is dynamically defined by <runxpcshelltests.py>.
|
||||
_load_files(_TAIL_FILES);
|
||||
|
||||
// Execute all of our cleanup functions.
|
||||
let reportCleanupError = function(ex) {
|
||||
let stack, filename;
|
||||
@ -1264,7 +1261,6 @@ function do_load_child_test_harness()
|
||||
"const _HEAD_JS_PATH=" + uneval(_HEAD_JS_PATH) + "; "
|
||||
+ "const _HEAD_FILES=" + uneval(_HEAD_FILES) + "; "
|
||||
+ "const _MOZINFO_JS_PATH=" + uneval(_MOZINFO_JS_PATH) + "; "
|
||||
+ "const _TAIL_FILES=" + uneval(_TAIL_FILES) + "; "
|
||||
+ "const _TEST_NAME=" + uneval(_TEST_NAME) + "; "
|
||||
// We'll need more magic to get the debugger working in the child
|
||||
+ "const _JSDEBUGGER_PORT=0; "
|
||||
|
@ -87,11 +87,10 @@ class RemoteXPCShellTestThread(xpcshell.XPCShellTestThread):
|
||||
self.log.info("%s | current directory: %r" % (name, self.remoteHere))
|
||||
self.log.info("%s | environment: %s" % (name, self.env))
|
||||
|
||||
def getHeadAndTailFiles(self, test):
|
||||
def getHeadFiles(self, test):
|
||||
"""Override parent method to find files on remote device.
|
||||
|
||||
Obtains lists of head- and tail files. Returns a tuple containing
|
||||
a list of head files and a list of tail files.
|
||||
Obtains lists of head- files. Returns a list of head files.
|
||||
"""
|
||||
def sanitize_list(s, kind):
|
||||
for f in s.strip().split(' '):
|
||||
@ -109,9 +108,7 @@ class RemoteXPCShellTestThread(xpcshell.XPCShellTestThread):
|
||||
self.remoteHere = self.remoteForLocal(test['here'])
|
||||
|
||||
headlist = test.get('head', '')
|
||||
taillist = test.get('tail', '')
|
||||
return (list(sanitize_list(headlist, 'head')),
|
||||
list(sanitize_list(taillist, 'tail')))
|
||||
return list(sanitize_list(headlist, 'head'))
|
||||
|
||||
def buildXpcsCmd(self):
|
||||
# change base class' paths to remote paths and use base class to build command
|
||||
|
@ -376,30 +376,26 @@ class XPCShellTestThread(Thread):
|
||||
mozinfo.output_to_file(mozInfoJSPath)
|
||||
return mozInfoJSPath
|
||||
|
||||
def buildCmdHead(self, headfiles, tailfiles, xpcscmd):
|
||||
def buildCmdHead(self, headfiles, xpcscmd):
|
||||
"""
|
||||
Build the command line arguments for the head and tail files,
|
||||
Build the command line arguments for the head files,
|
||||
along with the address of the webserver which some tests require.
|
||||
|
||||
On a remote system, this is overloaded to resolve quoting issues over a secondary command line.
|
||||
"""
|
||||
cmdH = ", ".join(['"' + f.replace('\\', '/') + '"'
|
||||
for f in headfiles])
|
||||
cmdT = ", ".join(['"' + f.replace('\\', '/') + '"'
|
||||
for f in tailfiles])
|
||||
|
||||
dbgport = 0 if self.jsDebuggerInfo is None else self.jsDebuggerInfo.port
|
||||
|
||||
return xpcscmd + \
|
||||
['-e', 'const _SERVER_ADDR = "localhost"',
|
||||
'-e', 'const _HEAD_FILES = [%s];' % cmdH,
|
||||
'-e', 'const _TAIL_FILES = [%s];' % cmdT,
|
||||
'-e', 'const _JSDEBUGGER_PORT = %d;' % dbgport,
|
||||
]
|
||||
|
||||
def getHeadAndTailFiles(self, test):
|
||||
"""Obtain lists of head- and tail files. Returns a tuple
|
||||
containing a list of head files and a list of tail files.
|
||||
def getHeadFiles(self, test):
|
||||
"""Obtain lists of head- files. Returns a list of head files.
|
||||
"""
|
||||
def sanitize_list(s, kind):
|
||||
for f in s.strip().split(' '):
|
||||
@ -417,13 +413,11 @@ class XPCShellTestThread(Thread):
|
||||
yield path
|
||||
|
||||
headlist = test.get('head', '')
|
||||
taillist = test.get('tail', '')
|
||||
return (list(sanitize_list(headlist, 'head')),
|
||||
list(sanitize_list(taillist, 'tail')))
|
||||
return list(sanitize_list(headlist, 'head'))
|
||||
|
||||
def buildXpcsCmd(self):
|
||||
"""
|
||||
Load the root head.js file as the first file in our test path, before other head, test, and tail files.
|
||||
Load the root head.js file as the first file in our test path, before other head, and test files.
|
||||
On a remote system, we overload this to add additional command line arguments, so this gets overloaded.
|
||||
"""
|
||||
# - NOTE: if you rename/add any of the constants set here, update
|
||||
@ -623,8 +617,8 @@ class XPCShellTestThread(Thread):
|
||||
self.mozInfoJSPath = self.setupMozinfoJS()
|
||||
|
||||
self.buildXpcsCmd()
|
||||
head_files, tail_files = self.getHeadAndTailFiles(self.test_object)
|
||||
cmdH = self.buildCmdHead(head_files, tail_files, self.xpcsCmd)
|
||||
head_files = self.getHeadFiles(self.test_object)
|
||||
cmdH = self.buildCmdHead(head_files, self.xpcsCmd)
|
||||
|
||||
# The test file will have to be loaded after the head files.
|
||||
cmdT = self.buildCmdTestFile(path)
|
||||
|
@ -1047,23 +1047,6 @@ add_test({
|
||||
|
||||
self.assertTrue(raised)
|
||||
|
||||
def testMissingTailFile(self):
|
||||
"""
|
||||
Ensure that missing tail file results in fatal error.
|
||||
"""
|
||||
self.writeFile("test_basic.js", SIMPLE_PASSING_TEST)
|
||||
self.writeManifest([("test_basic.js", "tail = missing.js")])
|
||||
|
||||
raised = False
|
||||
|
||||
try:
|
||||
self.assertTestResult(True)
|
||||
except Exception, ex:
|
||||
raised = True
|
||||
self.assertEquals(ex.message[0:9], "tail file")
|
||||
|
||||
self.assertTrue(raised)
|
||||
|
||||
def testRandomExecution(self):
|
||||
"""
|
||||
Check that random execution doesn't break.
|
||||
|
Loading…
Reference in New Issue
Block a user