Bug 1193223 - Add reftest support to mach test, r=chmanchester

This commit is contained in:
James Graham 2015-09-08 15:30:08 +01:00
parent 9f4bc0cc88
commit 488873f50f
2 changed files with 20 additions and 2 deletions

View File

@ -215,6 +215,19 @@ class ReftestRunner(MozbuildObject):
return rv
def process_test_objects(kwargs):
"""|mach test| works by providing a test_objects argument, from
which the test path must be extracted and converted into a normal
reftest tests argument."""
if "test_objects" in kwargs:
if kwargs["tests"] is None:
kwargs["tests"] = []
kwargs["tests"].extend(item["path"] for item in kwargs["test_objects"])
del kwargs["test_objects"]
@CommandProvider
class MachCommands(MachCommandBase):
@Command('reftest',
@ -263,6 +276,7 @@ class MachCommands(MachCommandBase):
return self._run_reftest(**kwargs)
def _run_reftest(self, **kwargs):
process_test_objects(kwargs)
reftest = self._spawn(ReftestRunner)
return reftest.run_desktop_test(**kwargs)
@ -307,6 +321,7 @@ class B2GCommands(MachCommandBase):
return self._run_reftest(**kwargs)
def _run_reftest(self, **kwargs):
process_test_objects(kwargs)
if self.device_name:
if self.device_name.startswith('emulator'):
emulator = 'arm'

View File

@ -96,7 +96,7 @@ TEST_SUITES = {
'reftest': {
'aliases': ('RR', 'rr', 'Rr'),
'mach_command': 'reftest',
'kwargs': {'test_file': None},
'kwargs': {'tests': None},
},
'reftest-ipc': {
'aliases': ('Ripc',),
@ -139,7 +139,10 @@ TEST_FLAVORS = {
'mach_command': 'mochitest',
'kwargs': {'flavor': 'mochitest', 'test_paths': []},
},
'reftest': { },
'reftest': {
'mach_command': 'reftest',
'kwargs': {'tests': []}
},
'steeplechase': { },
'web-platform-tests': {
'mach_command': 'web-platform-tests',