mirror of
https://github.com/servo/servo.git
synced 2025-06-22 08:08:59 +01:00
Auto merge of #5776 - servo:split-unit-tests, r=mbrubeck
Closes #5707. (Includes a rebase of it.) Fixes #5688. r? @mbrubeck <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/5776) <!-- Reviewable:end -->
This commit is contained in:
commit
f795440ee3
16 changed files with 210 additions and 109 deletions
|
@ -101,17 +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", "unit_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',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue