2
USAGE = """Just run test.py. Any supplied arguments are treated as PYTHONPATH
11
if sys.argv[1] in ("-h", "--help", ""):
14
path_prefix = sys.argv[1:]
15
path_prefix.append(os.path.join(os.path.dirname(__file__), ".."))
16
sys.path = [os.path.realpath(p) for p in path_prefix] + sys.path
18
from bzrlib.plugins import bzrtools
19
except ImportError, e:
20
if len(sys.argv) == 1 and "bzrlib" in str(e):
21
print "You can specify the path to bzrlib as the first argument"
23
suite = bzrtools.test_suite()
24
runner = unittest.TextTestRunner(verbosity=0)
25
tempdir = tempfile.mkdtemp()
29
result = runner.run(suite)
31
shutil.rmtree(tempdir)
33
sys.exit({True: 0, False: 3}[result.wasSuccessful()])