diff options
author | Andrew Shu <talklittle@gmail.com> | 2016-06-03 19:05:16 -0700 |
---|---|---|
committer | Andrew Shu <talklittle@gmail.com> | 2016-06-04 14:12:14 -0700 |
commit | b0d76ae8920776302fbd49cc308789f79c748406 (patch) | |
tree | a8ba5bcd1085539df9076ec38849a2bbba9aa518 /python/servo/testing_commands.py | |
parent | 7eac0a9e4539ff6b0d92cf111b966dcd5df9ccba (diff) | |
download | servo-b0d76ae8920776302fbd49cc308789f79c748406.tar.gz servo-b0d76ae8920776302fbd49cc308789f79c748406.zip |
mach: Warn and dispatch non-WPT tests for test-wpt
Diffstat (limited to 'python/servo/testing_commands.py')
-rw-r--r-- | python/servo/testing_commands.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/python/servo/testing_commands.py b/python/servo/testing_commands.py index 6c3e3f50ef5..4fd3bba2fd0 100644 --- a/python/servo/testing_commands.py +++ b/python/servo/testing_commands.py @@ -337,6 +337,24 @@ class MachCommands(CommandBase): 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")) |