mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Add nocapture argument to test-unit
This commit is contained in:
parent
dd2aa4195a
commit
46291fd998
1 changed files with 9 additions and 3 deletions
|
@ -193,12 +193,14 @@ class MachCommands(CommandBase):
|
||||||
@Command('test-unit',
|
@Command('test-unit',
|
||||||
description='Run unit tests',
|
description='Run unit tests',
|
||||||
category='testing')
|
category='testing')
|
||||||
|
@CommandArgument('test_name', nargs=argparse.REMAINDER,
|
||||||
|
help="Only run tests that match this pattern or file path")
|
||||||
@CommandArgument('--package', '-p', default=None, help="Specific package to test")
|
@CommandArgument('--package', '-p', default=None, help="Specific package to test")
|
||||||
@CommandArgument('--bench', default=False, action="store_true",
|
@CommandArgument('--bench', default=False, action="store_true",
|
||||||
help="Run in bench mode")
|
help="Run in bench mode")
|
||||||
@CommandArgument('test_name', nargs=argparse.REMAINDER,
|
@CommandArgument('--nocapture', default=False, action="store_true",
|
||||||
help="Only run tests that match this pattern or file path")
|
help="Run tests with nocapture ( show test stdout )")
|
||||||
def test_unit(self, test_name=None, package=None, bench=False):
|
def test_unit(self, test_name=None, package=None, bench=False, nocapture=False):
|
||||||
if test_name is None:
|
if test_name is None:
|
||||||
test_name = []
|
test_name = []
|
||||||
|
|
||||||
|
@ -259,6 +261,10 @@ class MachCommands(CommandBase):
|
||||||
|
|
||||||
if features:
|
if features:
|
||||||
args += ["--features", "%s" % ' '.join(features)]
|
args += ["--features", "%s" % ' '.join(features)]
|
||||||
|
|
||||||
|
if nocapture:
|
||||||
|
args += ["--", "--nocapture"]
|
||||||
|
|
||||||
err = call(args, env=env, cwd=self.servo_crate())
|
err = call(args, env=env, cwd=self.servo_crate())
|
||||||
if err is not 0:
|
if err is not 0:
|
||||||
return err
|
return err
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue