aboutsummaryrefslogtreecommitdiffstats
path: root/python
diff options
context:
space:
mode:
authorbors-servo <metajack+bors@gmail.com>2014-12-02 15:42:53 -0700
committerbors-servo <metajack+bors@gmail.com>2014-12-02 15:42:53 -0700
commit600da2af7e6c886f46d013008d2f933b99a2b92f (patch)
treee222e349992dbfcf05c373edac77f655a33e5cd9 /python
parent791606bde79cf38ae8484882a7986a1f258957a4 (diff)
parent3a6b6792aee93e5ca8ae9d3c9c9df46b3cd391f8 (diff)
downloadservo-600da2af7e6c886f46d013008d2f933b99a2b92f.tar.gz
servo-600da2af7e6c886f46d013008d2f933b99a2b92f.zip
auto merge of #4168 : mttr/servo/mach_inferred_test_cleanup, r=Manishearth
No actual change in functionality here. I was just unhappy with the way test-ref was singled out before, and realized an obvious fix.
Diffstat (limited to 'python')
-rw-r--r--python/servo/testing_commands.py27
1 files changed, 13 insertions, 14 deletions
diff --git a/python/servo/testing_commands.py b/python/servo/testing_commands.py
index 0a944eb2795..53f2cd288af 100644
--- a/python/servo/testing_commands.py
+++ b/python/servo/testing_commands.py
@@ -53,23 +53,22 @@ class MachCommands(CommandBase):
return 1
test_dirs = [
- (path.join("tests", "content"), "test-content"),
- (path.join("tests", "wpt"), "test-wpt"),
+ # path, mach test command, optional flag for path argument
+ (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:
- # test-ref is the outcast here in that it does not accept
- # individual files as arguments unless passed through with --name
- args = [mach_command, "test-ref",
- "--name", maybe_path] + params[1:]
+ for test_dir, test_name, path_flag in test_dirs:
+ if not path_flag:
+ path_arg = []
+ if test_dir in maybe_path:
+ args = ([mach_command, test_name] + path_flag +
+ [maybe_path] + params[1:])
+ break
else:
- for test_dir, test_name in test_dirs:
- if test_dir in maybe_path:
- args = [mach_command, test_name, maybe_path] + params[1:]
- break
- else:
- print("%s is not a valid test file or directory" % maybe_path)
- return 1
+ print("%s is not a valid test file or directory" % maybe_path)
+ return 1
return subprocess.call(args, env=self.build_env())