Skip to content

Commit

Permalink
mach: Warn and dispatch non-WPT tests for test-wpt
Browse files Browse the repository at this point in the history
  • Loading branch information
talklittle committed Jun 4, 2016
1 parent 7eac0a9 commit b0d76ae
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions python/servo/testing_commands.py
Expand Up @@ -337,6 +337,24 @@ def test_wpt_failure(self):
parser=create_parser_wpt)
def test_wpt(self, **kwargs):
self.ensure_bootstrapped()
test_list = kwargs["test_list"]
if not test_list:
return self._test_wpt(**kwargs)
else:
# Paths specified on command line. Ensure they are WPT, re-dispatch otherwise.
all_wpt = True
for test_path in test_list:
suite = self.suite_for_path(test_path)
if "wpt" != suite:
all_wpt = False
print("Warning: %s is not a WPT test. Delegating to test-%s." % (test_path, suite))
if all_wpt:
return self._test_wpt(**kwargs)
else:
# Dispatch each test to the correct suite
Registrar.dispatch("test", context=self.context, params=test_list)

def _test_wpt(self, **kwargs):
hosts_file_path = path.join(self.context.topdir, 'tests', 'wpt', 'hosts')
os.environ["hosts_file_path"] = hosts_file_path
run_file = path.abspath(path.join(self.context.topdir, "tests", "wpt", "run_wpt.py"))
Expand Down

0 comments on commit b0d76ae

Please sign in to comment.