mirror of
https://github.com/servo/servo.git
synced 2025-07-31 19:20:22 +01:00
infer_test_by_dir cleanup
No actual change in functionality here. I was just unhappy with the way test-ref was singled out before, and realized an obvious fix.
This commit is contained in:
parent
9afdce4405
commit
3a6b6792ae
1 changed files with 13 additions and 14 deletions
|
@ -53,19 +53,18 @@ class MachCommands(CommandBase):
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
test_dirs = [
|
test_dirs = [
|
||||||
(path.join("tests", "content"), "test-content"),
|
# path, mach test command, optional flag for path argument
|
||||||
(path.join("tests", "wpt"), "test-wpt"),
|
(path.join("tests", "content"), "test-content", None),
|
||||||
|
(path.join("tests", "wpt"), "test-wpt", None),
|
||||||
|
(path.join("tests", "ref"), "test-ref", ["--name"]),
|
||||||
]
|
]
|
||||||
|
|
||||||
if path.join("tests", "ref") in maybe_path:
|
for test_dir, test_name, path_flag in test_dirs:
|
||||||
# test-ref is the outcast here in that it does not accept
|
if not path_flag:
|
||||||
# individual files as arguments unless passed through with --name
|
path_arg = []
|
||||||
args = [mach_command, "test-ref",
|
|
||||||
"--name", maybe_path] + params[1:]
|
|
||||||
else:
|
|
||||||
for test_dir, test_name in test_dirs:
|
|
||||||
if test_dir in maybe_path:
|
if test_dir in maybe_path:
|
||||||
args = [mach_command, test_name, maybe_path] + params[1:]
|
args = ([mach_command, test_name] + path_flag +
|
||||||
|
[maybe_path] + params[1:])
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
print("%s is not a valid test file or directory" % maybe_path)
|
print("%s is not a valid test file or directory" % maybe_path)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue