aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Rasmus <mattr@zzntd.com>2014-11-21 13:49:44 -0800
committerMatthew Rasmus <mattr@zzntd.com>2014-11-21 13:52:18 -0800
commit655dd453bd3a8cf663b8d214f565c921601bb5a3 (patch)
tree521d3c4949e4ff78319b568f85503ba02cfdada2
parentb4c3aec383b2b1cd19ab6267775f9fb3735aa977 (diff)
downloadservo-655dd453bd3a8cf663b8d214f565c921601bb5a3.tar.gz
servo-655dd453bd3a8cf663b8d214f565c921601bb5a3.zip
Run a single WPT test from a relative path
Fixes #4055
-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())