1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
#!/usr/bin/env python2.4
USAGE = """Just run test.py. Any supplied arguments are treated as PYTHONPATH
prefixes."""
import sys
import os.path
import unittest
path_prefix = []
if len(sys.argv) > 1:
if sys.argv[1] in ("-h", "--help", ""):
print USAGE
sys.exit(0)
path_prefix = sys.argv[1:]
path_prefix.append(os.path.join(os.path.dirname(__file__), ".."))
sys.path = [os.path.realpath(p) for p in path_prefix] + sys.path
try:
import bzrtools
except ImportError, e:
if len(sys.argv) == 1 and "bzrlib" in str(e):
print "You can spcify the path to bzrlib as the first argument"
raise
suite = bzrtools.test_suite()
runner = unittest.TextTestRunner(verbosity=0)
result = runner.run(suite)
sys.exit({True: 0, False: 3}[result.wasSuccessful()])
|