aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbors-servo <metajack+bors@gmail.com>2014-11-21 20:24:30 -0700
committerbors-servo <metajack+bors@gmail.com>2014-11-21 20:24:30 -0700
commite6e73b8da70a6acaeabc1abf13071d044996f103 (patch)
tree767154ae422d8a03e69a4265dfc3d230887aded1
parent2bba42ad19a792565b653cdd5551933ab2d41c2b (diff)
parent655dd453bd3a8cf663b8d214f565c921601bb5a3 (diff)
downloadservo-e6e73b8da70a6acaeabc1abf13071d044996f103.tar.gz
servo-e6e73b8da70a6acaeabc1abf13071d044996f103.zip
auto merge of #4063 : mttr/servo/test_wpt_from_relpath, r=mbrubeck
Fixes #4055 This PR allows `./mach test-wpt` to be run (from /path/to/servo) with a single relative path to some wpt test. For example: ``` ./mach test-wpt tests/wpt/web-platform-tests/dom/sometest.html ``` The argument `tests/wpt/web-platform-tests/dom/sometest.html` is passed on as `--include dom/sometest.html`.
-rw-r--r--python/servo/testing_commands.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/python/servo/testing_commands.py b/python/servo/testing_commands.py
index 05242f7af5b..125d841f174 100644
--- a/python/servo/testing_commands.py
+++ b/python/servo/testing_commands.py
@@ -150,6 +150,16 @@ class MachCommands(CommandBase):
def test_wpt(self, params=None):
if params is None:
params = []
+ else:
+ # Allow the first argument to be a relative path from Servo's root
+ # directory, converting it to `--include some/wpt/test.html`
+ maybe_path = path.normpath(params[0])
+ wpt_path = path.join('tests', 'wpt', 'web-platform-tests')
+
+ if path.exists(maybe_path) and wpt_path in maybe_path:
+ params = ["--include",
+ path.relpath(maybe_path, wpt_path)] + params[1:]
+
return subprocess.call(
["bash", path.join("tests", "wpt", "run.sh")] + params,
env=self.build_env())