From cf25884e992e9c0dd6e4bf2f7cd4bb3252578bf6 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Thu, 24 Jul 2008 22:14:27 -0500 Subject: pactest: exit with a non-zero error code on unexpected failure This will allow the return code of pactest to be useful, for such things as use in a git-bisect test script. Signed-off-by: Dan McGee --- pactest/pactest.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'pactest/pactest.py') diff --git a/pactest/pactest.py b/pactest/pactest.py index 7cda2556..f95ef3c1 100755 --- a/pactest/pactest.py +++ b/pactest/pactest.py @@ -93,13 +93,18 @@ if __name__ == "__main__": env.pacman["valgrind"] = opts.valgrind env.pacman["manual-confirm"] = opts.manualconfirm - if len(opts.testcases) == 0: + if opts.testcases is None or len(opts.testcases) == 0: print "no tests defined, nothing to do" + sys.exit(2) else: - for i in opts.testcases: env.addtest(i) + for i in opts.testcases: + env.addtest(i) # run tests and print overall results env.run() env.results() + if env.failed > 0: + sys.exit(1) + # vim: set ts=4 sw=4 et: -- cgit v1.2.3-24-g4f1b