If a stability setting is invalid, and contains upper-case letters, hint
[zeroinstall.git] / tests / testall.py
blob377c4bc6a4d5127ce739ff0217952d344752626d
1 #!/usr/bin/env python2.3
2 import unittest, os, sys
3 try:
4 import coverage
5 coverage.erase()
6 coverage.start()
7 except ImportError:
8 coverage = None
10 my_dir = os.path.dirname(sys.argv[0])
11 if not my_dir:
12 my_dir=os.getcwd()
14 sys.argv.append('-v')
16 suite_names = [f[:-3] for f in os.listdir(my_dir)
17 if f.startswith('test') and f.endswith('.py')]
18 suite_names.remove('testall')
19 suite_names.sort()
21 alltests = unittest.TestSuite()
23 for name in suite_names:
24 m = __import__(name, globals(), locals(), [])
25 alltests.addTest(m.suite)
27 a = unittest.TextTestRunner(verbosity=2).run(alltests)
29 if coverage:
30 coverage.stop()
31 else:
32 print "Coverage module not found. Skipping coverage report."
34 print "\nResult", a
35 if not a.wasSuccessful():
36 sys.exit(1)
38 if coverage:
39 d = '../zeroinstall/injector'
40 all_sources = [os.path.join(d, x) for x in os.listdir(d)
41 if x.endswith('.py')] + ['../0launch']
42 coverage.report(all_sources)