Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/pactest/pactest.py
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2008-07-24 22:14:27 -0500
committerDan McGee <dan@archlinux.org>2008-07-24 22:16:29 -0500
commitcf25884e992e9c0dd6e4bf2f7cd4bb3252578bf6 (patch)
tree430b9f5675db96ea803aa52b081547bdedc83efc /pactest/pactest.py
parent9f57921467ea368be96ffc09c8c35e9acfcc41ed (diff)
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 <dan@archlinux.org>
Diffstat (limited to 'pactest/pactest.py')
-rwxr-xr-xpactest/pactest.py9
1 files changed, 7 insertions, 2 deletions
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: