utests: support --exit-on-failure
@@ -86,6 +86,7 @@ if __name__ == "__main__":
parser.add_argument("-q", "--quiet", dest="vrbst", action="store_const", const=0)
parser.add_argument("-v", "--verbose",dest="vrbst", action="store_const", const=2)
parser.add_argument("-d", "--doc", dest="docs", action="store_true")
+ parser.add_argument("-x", "--exit-on-failure", dest="failfast", action="store_true")
parser.add_argument(dest="directory", nargs="?", action="store", default=None)
parser.set_defaults(vrbst=1)
@@ -97,7 +98,8 @@ if __name__ == "__main__":
tests = get_tests(args.directory)
suite = unittest.TestSuite(tests)
- runner = unittest.TextTestRunner(descriptions=args.docs, verbosity=args.vrbst)
+ runner = unittest.TextTestRunner(descriptions=args.docs, verbosity=args.vrbst,
+ failfast=args.failfast)
result = runner.run(suite)
rc = len(result.failures) + len(result.errors)
if rc > 250:
