summary refs log tree commit diff stats
path: root/all_tests.py
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2010-02-25 02:45:40 +0100
committerhut <hut@lavabit.com>2010-02-25 02:45:47 +0100
commite9e4b4ffa4b4865c46acbebfc7ef2083bfac0210 (patch)
tree881e838f20c2025321409b23157b8e4af1f4eea2 /all_tests.py
parenta5d9423cad0a112564447b2519208b9ec5354665 (diff)
downloadranger-e9e4b4ffa4b4865c46acbebfc7ef2083bfac0210.tar.gz
added Makefile
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)