diff options
author | Simon Sapin <simon.sapin@exyr.org> | 2019-07-01 19:25:10 +0200 |
---|---|---|
committer | Simon Sapin <simon.sapin@exyr.org> | 2019-07-02 18:29:24 +0200 |
commit | 7c85dc09b59e653caf60cb18d3b3fdea2ba4d4ae (patch) | |
tree | dd03b42a0ee6a495c1c62df9fa49ccc55dffba95 /python/servo/testing_commands.py | |
parent | d9dbcd52c3fc0f34d2f5cd4c20aaed794946eb80 (diff) | |
download | servo-7c85dc09b59e653caf60cb18d3b3fdea2ba4d4ae.tar.gz servo-7c85dc09b59e653caf60cb18d3b3fdea2ba4d4ae.zip |
Share more `./mach build` logic with mach check, doc, test-unit
Fixes #23659
Diffstat (limited to 'python/servo/testing_commands.py')
-rw-r--r-- | python/servo/testing_commands.py | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/python/servo/testing_commands.py b/python/servo/testing_commands.py index 8696f02f8dc..d1880f6385e 100644 --- a/python/servo/testing_commands.py +++ b/python/servo/testing_commands.py @@ -214,7 +214,8 @@ class MachCommands(CommandBase): help="Run in bench mode") @CommandArgument('--nocapture', default=False, action="store_true", help="Run tests with nocapture ( show test stdout )") - def test_unit(self, test_name=None, package=None, bench=False, nocapture=False): + @CommandBase.build_like_command_arguments + def test_unit(self, test_name=None, package=None, bench=False, nocapture=False, **kwargs): if test_name is None: test_name = [] @@ -277,22 +278,18 @@ class MachCommands(CommandBase): # in to the servo.exe build dir, so just point PATH to that. env["PATH"] = "%s%s%s" % (path.dirname(self.get_binary_path(False, False)), os.pathsep, env["PATH"]) - features = self.servo_features() if len(packages) > 0 or len(in_crate_packages) > 0: - args = ["cargo", "bench" if bench else "test", "--manifest-path", self.ports_glutin_manifest()] + args = [] for crate in packages: args += ["-p", "%s_tests" % crate] for crate in in_crate_packages: args += ["-p", crate] args += test_patterns - if features: - args += ["--features", "%s" % ' '.join(features)] - if nocapture: args += ["--", "--nocapture"] - err = self.call_rustup_run(args, env=env) + err = self.run_cargo_build_like_command("bench" if bench else "test", args, env=env, **kwargs) if err is not 0: return err |