From: Frederic Massart Date: Wed, 16 Dec 2015 06:43:03 +0000 (+0800) Subject: Add --stop-on-failure to phpunit X-Git-Tag: v1.5.4~3 X-Git-Url: https://git.cameron1729.xyz/?a=commitdiff_plain;h=e3c8b65cf4a73c14a5fdfea390ca17550a5cc0d2;p=mdk.git Add --stop-on-failure to phpunit --- diff --git a/mdk/commands/phpunit.py b/mdk/commands/phpunit.py index 96f2d81..4de5994 100644 --- a/mdk/commands/phpunit.py +++ b/mdk/commands/phpunit.py @@ -81,6 +81,14 @@ class PhpunitCommand(Command): } ), ( + ['-q', '--stop-on-failure'], + { + 'action': 'store_true', + 'dest': 'stoponfailure', + 'help': 'stop execution upon first failure or error' + } + ), + ( ['-c', '--coverage'], { 'action': 'store_true', @@ -139,7 +147,8 @@ class PhpunitCommand(Command): 'filter': args.filter, 'testcase': args.testcase, 'testsuite': testsuite, - 'unittest': args.unittest + 'unittest': args.unittest, + 'stopon': [] if not args.stoponfailure else ['failure'] } if args.run: diff --git a/mdk/phpunit.py b/mdk/phpunit.py index 1f5628e..060951d 100644 --- a/mdk/phpunit.py +++ b/mdk/phpunit.py @@ -40,7 +40,7 @@ class PHPUnit(object): self._Wp = Wp self._M = M - def getCommand(self, testcase=None, unittest=None, filter=None, coverage=None, testsuite=None): + def getCommand(self, testcase=None, unittest=None, filter=None, coverage=None, testsuite=None, stopon=None): """Get the PHPUnit command""" cmd = [] if self.usesComposer(): @@ -52,6 +52,10 @@ class PHPUnit(object): cmd.append('--coverage-html') cmd.append(self.getCoverageDir()) + if stopon: + for on in stopon: + cmd.append('--stop-on-%s' % on) + if testcase: cmd.append(testcase) elif unittest: