about summary refs log tree commit diff stats
path: root/all_tests.py
diff options
context:
space:
mode:
Diffstat (limited to 'all_tests.py')
-rwxr-xr-xall_tests.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/all_tests.py b/all_tests.py
index 33b16f7f..6693b870 100755
--- a/all_tests.py
+++ b/all_tests.py
@@ -3,6 +3,12 @@
 if __name__ == '__main__':
 	import unittest
 	from test import *
+	from sys import exit, argv
+
+	try:
+		verbosity = int(argv[1])
+	except IndexError:
+		verbosity = 2
 
 	tests = []
 	for key, val in vars().copy().items():
@@ -10,4 +16,6 @@ if __name__ == '__main__':
 			tests.extend(v for k,v in vars(val).items() if type(v) == type)
 
 	suite = unittest.TestSuite(map(unittest.makeSuite, tests))
-	unittest.TextTestRunner(verbosity=2).run(suite)
+	result = unittest.TextTestRunner(verbosity=verbosity).run(suite)
+	if len(result.errors) + len(result.failures) > 0:
+		exit(1)