run-tests.py: allow a different temporary directory to be specified
authorBryan O'Sullivan <bos@serpentine.com>
Fri, 05 Oct 2007 12:42:52 -0700
changeset 5388 557e4a916e12
parent 5387 4b6f0aa568e5
child 5389 26c060922085
run-tests.py: allow a different temporary directory to be specified
tests/run-tests.py
--- a/tests/run-tests.py	Fri Oct 05 12:30:19 2007 -0700
+++ b/tests/run-tests.py	Fri Oct 05 12:42:52 2007 -0700
@@ -47,6 +47,8 @@
     help="print a test coverage report inc. standard libraries")
 parser.add_option("-t", "--timeout", type="int",
     help="kill errant tests after TIMEOUT seconds")
+parser.add_option("--tmpdir", type="string",
+    help="run tests in the given temporary directory")
 parser.add_option("-v", "--verbose", action="store_true",
     help="output verbose messages")
 parser.add_option("--with-hg", type="string",
@@ -394,7 +396,7 @@
 os.environ['TZ'] = 'GMT'
 
 TESTDIR = os.environ["TESTDIR"] = os.getcwd()
-HGTMP   = os.environ["HGTMP"]   = tempfile.mkdtemp("", "hgtests.")
+HGTMP = os.environ['HGTMP'] = tempfile.mkdtemp('', 'hgtests.', options.tmpdir)
 DAEMON_PIDS = None
 HGRCPATH = None