aboutsummaryrefslogtreecommitdiffstats
path: root/python/servo/testing_commands.py
diff options
context:
space:
mode:
authorSimon Sapin <simon.sapin@exyr.org>2015-04-21 18:24:11 +0200
committerSimon Sapin <simon.sapin@exyr.org>2015-04-21 20:22:10 +0200
commitce1f2bab7bdc12ed3ff2b0d96f0000a8d478586b (patch)
treea6c35b87cfbce50afc5e364065e5b90ce60cf7d1 /python/servo/testing_commands.py
parent7b9c9e14531b811da0f4dbf3596100e6fbb792d7 (diff)
downloadservo-ce1f2bab7bdc12ed3ff2b0d96f0000a8d478586b.tar.gz
servo-ce1f2bab7bdc12ed3ff2b0d96f0000a8d478586b.zip
Fix up the splitting of the unit tests crate.
Closes #5707. (Includes a rebase of it.) Fixes #5688.
Diffstat (limited to 'python/servo/testing_commands.py')
-rw-r--r--python/servo/testing_commands.py18
1 files changed, 13 insertions, 5 deletions
diff --git a/python/servo/testing_commands.py b/python/servo/testing_commands.py
index 62f4f213fbf..81361b0081f 100644
--- a/python/servo/testing_commands.py
+++ b/python/servo/testing_commands.py
@@ -101,18 +101,26 @@ class MachCommands(CommandBase):
@Command('test-unit',
description='Run unit tests',
category='testing')
+ @CommandArgument('--package', '-p', default=None, help="Specific package to test")
@CommandArgument('test_name', nargs=argparse.REMAINDER,
help="Only run tests that match this pattern")
- def test_unit(self, test_name=None, component=None, package=None):
+ def test_unit(self, test_name=None, package=None):
if test_name is None:
test_name = []
self.ensure_bootstrapped()
- return 0 != subprocess.call(
- ["cargo", "test", "-p", "gfx_tests", "net_tests", "script_tests",
- "style_tests", "util_tests"] + test_name,
- env=self.build_env(), cwd=self.servo_crate())
+ if package:
+ packages = [package]
+ else:
+ packages = os.listdir(path.join(self.context.topdir, "tests", "unit"))
+
+ for crate in packages:
+ result = subprocess.call(
+ ["cargo", "test", "-p", "%s_tests" % crate] + test_name,
+ env=self.build_env(), cwd=self.servo_crate())
+ if result != 0:
+ return result
@Command('test-ref',
description='Run the reference tests',