summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2009-12-11 23:35:26 +0100
committerhut <hut@lavabit.com>2009-12-11 23:35:26 +0100
commit084a0743189363c8c03aae1fe6766ae92a4469a3 (patch)
tree2bc35c333b5e6d6c53a25a28d65de60e0f3502c5
parent4b66c3a834409458c0bf665b1f6065c1aab3ba8d (diff)
downloadranger-084a0743189363c8c03aae1fe6766ae92a4469a3.tar.gz
run all tests with a single executable
-rwxr-xr-xall_tests.py11
-rw-r--r--test/__init__.py5
2 files changed, 16 insertions, 0 deletions
diff --git a/all_tests.py b/all_tests.py
new file mode 100755
index 00000000..b408b5de
--- /dev/null
+++ b/all_tests.py
@@ -0,0 +1,11 @@
+#!/usr/bin/python3
+import unittest
+from test import *
+
+tests = []
+for key, val in vars().copy().items():
+	if key.startswith('tc_'):
+		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)
diff --git a/test/__init__.py b/test/__init__.py
index e69de29b..4f1c736a 100644
--- a/test/__init__.py
+++ b/test/__init__.py
@@ -0,0 +1,5 @@
+import os, sys
+
+__all__ = [ x[0:x.index('.')] \
+		for x in os.listdir(os.path.dirname(__file__)) \
+		if x.startswith('tc_') ]