diff options
author | Bobby Holley <bobbyholley@gmail.com> | 2016-10-16 22:40:19 -0700 |
---|---|---|
committer | Bobby Holley <bobbyholley@gmail.com> | 2016-10-16 22:40:19 -0700 |
commit | eec06798bef2c58c0306153598e6b1eaa0529639 (patch) | |
tree | 161c177c0615ce584c46942a017bdacdc96a0f52 /python/servo/testing_commands.py | |
parent | d80bf2ada73295bc91a267d0f8f7c4a5ffb1a03f (diff) | |
download | servo-eec06798bef2c58c0306153598e6b1eaa0529639.tar.gz servo-eec06798bef2c58c0306153598e6b1eaa0529639.zip |
Implement ./mach test-unit --bench.
Diffstat (limited to 'python/servo/testing_commands.py')
-rw-r--r-- | python/servo/testing_commands.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/python/servo/testing_commands.py b/python/servo/testing_commands.py index 208d9b2433b..d1158304bff 100644 --- a/python/servo/testing_commands.py +++ b/python/servo/testing_commands.py @@ -172,9 +172,11 @@ class MachCommands(CommandBase): description='Run unit tests', category='testing') @CommandArgument('--package', '-p', default=None, help="Specific package to test") + @CommandArgument('--bench', default=False, action="store_true", + help="Run in bench mode") @CommandArgument('test_name', nargs=argparse.REMAINDER, help="Only run tests that match this pattern or file path") - def test_unit(self, test_name=None, package=None): + def test_unit(self, test_name=None, package=None, bench=False): if test_name is None: test_name = [] @@ -228,7 +230,7 @@ class MachCommands(CommandBase): features = self.servo_features() if len(packages) > 0: - args = ["cargo", "test"] + args = ["cargo", "bench" if bench else "test"] for crate in packages: args += ["-p", "%s_tests" % crate] args += test_patterns @@ -239,7 +241,7 @@ class MachCommands(CommandBase): # Run style tests with the testing feature if has_style: - args = ["cargo", "test", "-p", "style_tests", "--features"] + args = ["cargo", "bench" if bench else "test", "-p", "style_tests", "--features"] if features: args += ["%s" % ' '.join(features + ["testing"])] else: |