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