summary refs log tree commit diff stats
path: root/test/all_tests.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/all_tests.py')
-rwxr-xr-xtest/all_tests.py28
1 files changed, 14 insertions, 14 deletions
diff --git a/test/all_tests.py b/test/all_tests.py
index 04321462..7cfc855f 100755
--- a/test/all_tests.py
+++ b/test/all_tests.py
@@ -14,20 +14,20 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-"""Run all the tests inside the test/ directory as a test suite."""
-if __name__ == '__main__':
-	import unittest
-	import sys
-	import os
+"""
+Run all the tests inside this directory as a test suite.
+Usage: ./all_tests.py [verbosity]
+"""
 
-	try:
-		verbosity = int(sys.argv[1])
-	except IndexError:
-		verbosity = 2
+import os
+import sys
+import unittest
 
-	ls = os.listdir(sys.path[0])
-	paths = [p[:-3] for p in ls if p[:3] == 'tc_' and p[-3:] == '.py']
-	suite = unittest.TestLoader().loadTestsFromNames(paths)
-	result = unittest.TextTestRunner(verbosity=verbosity).run(suite)
-	if len(result.errors) + len(result.failures) > 0:
+if __name__ == '__main__':
+	verbosity = int(sys.argv[1]) if len(sys.argv) > 1 else 1
+	tests     = (fname[:-3] for fname in os.listdir(sys.path[0]) \
+	             if fname[:3] == 'tc_' and fname[-3:] == '.py')
+	suite     = unittest.TestLoader().loadTestsFromNames(tests)
+	result    = unittest.TextTestRunner(verbosity=verbosity).run(suite)
+	if len(result.errors + result.failures) > 0:
 		sys.exit(1)
k.com> 2021-01-11 23:14:26 -0800 committer Kartik Agaram <vc@akkartik.com> 2021-01-11 23:14:26 -0800 7495' href='/akkartik/mu/commit/index.html?h=main&id=f66866c7566dcbdb55145976c289280abd6be8d2'>f66866c7 ^
f5465e12 ^
6e1eeeeb ^

f6b44306 ^
b514fbb9 ^

e877e1fc ^
a675eda3 ^
e877e1fc ^
fd5e720b ^



e877e1fc ^

b514fbb9 ^


70763af3 ^








6845c4d9 ^
70763af3 ^




b514fbb9 ^
f6b44306 ^
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48