diff options
author | bors-servo <metajack+bors@gmail.com> | 2015-10-01 11:29:27 -0600 |
---|---|---|
committer | bors-servo <metajack+bors@gmail.com> | 2015-10-01 11:29:27 -0600 |
commit | 9488013b59e54f9a39cc89362ee6b84f89cc8ed0 (patch) | |
tree | 5cd11fe9b150c96c66c2674b064bb001e9f2a459 /python/servo/testing_commands.py | |
parent | fd66620602474e2070dc6fd6429e64cc6145b01c (diff) | |
parent | ab68d51eda8979441400688f26ceffddf25120c8 (diff) | |
download | servo-9488013b59e54f9a39cc89362ee6b84f89cc8ed0.tar.gz servo-9488013b59e54f9a39cc89362ee6b84f89cc8ed0.zip |
Auto merge of #7815 - mbrubeck:test-ref-include, r=SimonSapin
Fixes for reftest command-line handling
r? @SimonSapin
* Allow reftest harness to take 0 or more testname arguments.
* Change `mach test-ref` parameter from `--name` to `--include`. This is consistent with other test suites, and also fixes a bug in `mach test` caused by a conflicting keyword parameter in `Registrar.dispatch`.
* Allow `mach test-ref` to take any number of `include` arguments.
<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7815)
<!-- Reviewable:end -->
Diffstat (limited to 'python/servo/testing_commands.py')
-rw-r--r-- | python/servo/testing_commands.py | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/python/servo/testing_commands.py b/python/servo/testing_commands.py index e4c36236bd0..f6159406666 100644 --- a/python/servo/testing_commands.py +++ b/python/servo/testing_commands.py @@ -83,7 +83,7 @@ class MachCommands(CommandBase): ("tidy", {}), ("ref", {"kwargs": {"kind": render_mode}, "paths": [path.abspath(path.join("tests", "ref"))], - "include_arg": "name"}), + "include_arg": "include"}), ("wpt", {"kwargs": {"release": release}, "paths": [path.abspath(path.join("tests", "wpt", "web-platform-tests")), path.abspath(path.join("tests", "wpt", "mozilla"))], @@ -189,14 +189,14 @@ class MachCommands(CommandBase): help=HELP_RENDER_MODE) @CommandArgument('--release', '-r', action='store_true', help='Run with a release build of Servo') - @CommandArgument('--name', default=None, + @CommandArgument('--include', default=None, nargs='+', help="Only run tests that match this pattern. If the " "path to the ref test directory is included, it " "will automatically be trimmed out.") @CommandArgument( 'servo_params', default=None, nargs=argparse.REMAINDER, help="Command-line arguments to be passed through to Servo") - def test_ref(self, kind=DEFAULT_RENDER_MODE, name=None, servo_params=None, + def test_ref(self, kind=DEFAULT_RENDER_MODE, include=None, servo_params=None, release=False): self.ensure_bootstrapped() self.ensure_built_tests(release=release) @@ -210,17 +210,17 @@ class MachCommands(CommandBase): for k in kinds: print("Running %s reftests..." % k) test_args = [k, test_path] - if name is not None: - maybe_path = path.normpath(name) + if include is not None: ref_path = path.join("tests", "ref") - - # Check to see if we were passed something leading with the - # path to the ref test directory, and trim it so that reftest - # knows how to filter it. - if ref_path in maybe_path: - test_args.append(path.relpath(maybe_path, ref_path)) - else: - test_args.append(name) + for name in include: + # Check to see if we were passed something leading with the + # path to the ref test directory, and trim it so that reftest + # knows how to filter it. + maybe_path = path.normpath(name) + if ref_path in maybe_path: + test_args.append(path.relpath(maybe_path, ref_path)) + else: + test_args.append(name) if servo_params is not None: test_args += ["--"] + servo_params ret = self.run_test("reftest", test_args, release=release) |