aboutsummaryrefslogtreecommitdiffstats
path: root/python/servo/testing_commands.py
diff options
context:
space:
mode:
authorJack Moffitt <jack@metajack.im>2014-10-02 23:14:42 -0600
committerJack Moffitt <jack@metajack.im>2014-10-02 23:14:42 -0600
commit7f6f072b02a50a609ff03c4b095476c83ff4d60e (patch)
tree744899569fe8297120795c6d35e034f14c4378d7 /python/servo/testing_commands.py
parent76d1d78cc0e08185f372a53e0cb2ce9e46213c31 (diff)
downloadservo-7f6f072b02a50a609ff03c4b095476c83ff4d60e.tar.gz
servo-7f6f072b02a50a609ff03c4b095476c83ff4d60e.zip
Fix up and run unit tests.
This adds the subpackages to `./mach test-unit`.
Diffstat (limited to 'python/servo/testing_commands.py')
-rw-r--r--python/servo/testing_commands.py25
1 files changed, 15 insertions, 10 deletions
diff --git a/python/servo/testing_commands.py b/python/servo/testing_commands.py
index 3d20aeb27da..05242f7af5b 100644
--- a/python/servo/testing_commands.py
+++ b/python/servo/testing_commands.py
@@ -54,22 +54,27 @@ class MachCommands(CommandBase):
print("Tests completed in %0.2fs" % elapsed)
@Command('test-unit',
- description='Run libservo unit tests',
+ description='Run unit tests',
category='testing',
allow_all_args=True)
@CommandArgument('test_name', default=None, nargs="...",
help="Only run tests that match this pattern")
- @CommandArgument(
- 'params', default=None, nargs="...",
- help="Command-line arguments to be passed to the test harness")
- def test_unit(self, test_name=None, params=None):
- if params is None:
- params = []
- if test_name is not None:
- params.append(test_name)
+ def test_unit(self, test_name=None):
+ if test_name is None:
+ test_name = []
self.ensure_bootstrapped()
self.ensure_built_tests()
- return self.run_test("servo", params)
+
+ ret = self.run_test("servo", test_name) != 0
+
+ def cargo_test(component):
+ return 0 != subprocess.call(
+ ["cargo", "test", "-p", component], env=self.build_env())
+
+ for component in os.listdir("components"):
+ ret = ret or cargo_test(component)
+
+ return ret
@Command('test-ref',
description='Run the reference tests',