aboutsummaryrefslogtreecommitdiffstats
path: root/test.py
diff options
context:
space:
mode:
authorMarien Zwart <marienz@gentoo.org>2006-04-05 17:20:51 +0200
committerMarien Zwart <marienz@gentoo.org>2006-04-05 17:20:51 +0200
commitaecdc0d3bf4b3ba08757db23f2416c2416cf1e9d (patch)
tree22c7fbb3d5da9a98a5c107843c7e99f8ddb177b6 /test.py
parentba072da930d0f9fd6e62277a9bcd76d6978c919d (diff)
downloadbugseverywhere-aecdc0d3bf4b3ba08757db23f2416c2416cf1e9d.tar.gz
Exit with a nonzero status if the tests fail.
Diffstat (limited to 'test.py')
-rw-r--r--test.py20
1 files changed, 15 insertions, 5 deletions
diff --git a/test.py b/test.py
index 8913c1f..3d7161b 100644
--- a/test.py
+++ b/test.py
@@ -3,18 +3,28 @@ import doctest
import sys
if len(sys.argv) > 1:
match = False
+ libbe_failures = libbe_tries = becommands_failures = becommands_tries = 0
mod = plugin.get_plugin("libbe", sys.argv[1])
if mod is not None:
- doctest.testmod(mod)
+ libbe_failures, libbe_tries = doctest.testmod(mod)
match = True
mod = plugin.get_plugin("becommands", sys.argv[1])
if mod is not None:
- doctest.testmod(mod)
+ becommands_failures, becommands_tries = doctest.testmod(mod)
match = True
if not match:
print "No modules match \"%s\"" % sys.argv[1]
-else:
+ sys.exit(1)
+ else:
+ sys.exit(libbe_failures or becommands_failures)
+else:
+ failed = False
for module in plugin.iter_plugins("libbe"):
- doctest.testmod(module[1])
+ failures, tries = doctest.testmod(module[1])
+ if failures:
+ failed = True
for module in plugin.iter_plugins("becommands"):
- doctest.testmod(module[1])
+ failures, tries = doctest.testmod(module[1])
+ if failures:
+ failed = True
+ sys.exit(failed)