2 from __future__
import print_function
3 import unittest
, os
, sys
5 # Catch silly mistakes...
6 os
.environ
['HOME'] = '/home/idontexist'
15 my_dir
= os
.path
.dirname(sys
.argv
[0])
21 suite_names
= [f
[:-3] for f
in os
.listdir(my_dir
)
22 if f
.startswith('test') and f
.endswith('.py')]
23 suite_names
.remove('testall')
26 alltests
= unittest
.TestSuite()
28 for name
in suite_names
:
29 m
= __import__(name
, globals(), locals(), [])
30 test
= unittest
.defaultTestLoader
.loadTestsFromModule(m
)
31 alltests
.addTest(test
)
33 a
= unittest
.TextTestRunner(verbosity
=2).run(alltests
)
38 print("Coverage module not found. Skipping coverage report.")
41 if not a
.wasSuccessful():
47 for x
in os
.listdir(d
):
49 all_sources
.append(os
.path
.join(d
, x
))
50 incl('../zeroinstall')
51 incl('../zeroinstall/support')
52 incl('../zeroinstall/cmd')
53 incl('../zeroinstall/injector')
54 incl('../zeroinstall/zerostore')
55 coverage
.report(all_sources
+ ['../0launch'])