aboutsummaryrefslogtreecommitdiffstats
path: root/python/servo/testing_commands.py
diff options
context:
space:
mode:
authorbors-servo <metajack+bors@gmail.com>2015-05-31 21:20:57 -0500
committerbors-servo <metajack+bors@gmail.com>2015-05-31 21:20:57 -0500
commit713f18a58d9ba39d0f2cd1cc987774a28a9035ee (patch)
treef9fa58b20d0f65294f3e017e432abcce77d343de /python/servo/testing_commands.py
parent1d19338a93348c4e817a0b1619dc236881ba18f6 (diff)
parentbe7ae0c7326a802bd5a86fe9b73673296399d0ed (diff)
downloadservo-713f18a58d9ba39d0f2cd1cc987774a28a9035ee.tar.gz
servo-713f18a58d9ba39d0f2cd1cc987774a28a9035ee.zip
Auto merge of #6201 - glennw:jquery-runner, r=metajack
<!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6201) <!-- Reviewable:end -->
Diffstat (limited to 'python/servo/testing_commands.py')
-rw-r--r--python/servo/testing_commands.py41
1 files changed, 41 insertions, 0 deletions
diff --git a/python/servo/testing_commands.py b/python/servo/testing_commands.py
index 81361b0081f..44220022db4 100644
--- a/python/servo/testing_commands.py
+++ b/python/servo/testing_commands.py
@@ -225,6 +225,26 @@ class MachCommands(CommandBase):
execfile(run_file, run_globals)
return run_globals["update_tests"](**kwargs)
+ @Command('test-jquery',
+ description='Run the jQuery test suite',
+ category='testing')
+ @CommandArgument('--release', '-r', action='store_true',
+ help='Run the release build')
+ @CommandArgument('--dev', '-d', action='store_true',
+ help='Run the dev build')
+ def test_jquery(self, release, dev):
+ return self.jquery_test_runner("test", release, dev)
+
+ @Command('update-jquery',
+ description='Update the jQuery test suite expected results',
+ category='testing')
+ @CommandArgument('--release', '-r', action='store_true',
+ help='Run the release build')
+ @CommandArgument('--dev', '-d', action='store_true',
+ help='Run the dev build')
+ def update_jquery(self):
+ return self.jquery_test_runner("update", release, dev)
+
@Command('test-css',
description='Run the web platform tests',
category='testing',
@@ -291,3 +311,24 @@ class MachCommands(CommandBase):
return default
return path
+
+ def jquery_test_runner(self, cmd, release, dev):
+ self.ensure_bootstrapped()
+ base_dir = path.abspath(path.join("tests", "jquery"))
+ jquery_dir = path.join(base_dir, "jquery")
+ run_file = path.join(base_dir, "run_jquery.py")
+
+ # Clone the jQuery repository if it doesn't exist
+ if not os.path.isdir(jquery_dir):
+ subprocess.check_call(
+ ["git", "clone", "-b", "servo", "--depth", "1", "https://github.com/servo/jquery", jquery_dir])
+
+ # Run pull in case the jQuery repo was updated since last test run
+ subprocess.check_call(
+ ["git", "-C", jquery_dir, "pull"])
+
+ # Check that a release servo build exists
+ bin_path = path.abspath(self.get_binary_path(release, dev))
+
+ return subprocess.check_call(
+ [run_file, cmd, bin_path, base_dir])