tests/run-tests.py
changeset 1092 25db33023e4e
parent 1090 e7e4ca624772
child 1093 660262879b48
--- a/tests/run-tests.py	Tue Jun 05 00:20:53 2012 +0100
+++ b/tests/run-tests.py	Sun Jun 10 16:32:22 2012 +0100
@@ -599,8 +599,9 @@
 
     def hghave(reqs):
         # TODO: do something smarter when all other uses of hghave is gone
+        tdir = TESTDIR.replace('\\', '/')
         proc = Popen4('%s -c "%s/hghave %s"' %
-                      (options.shell, TESTDIR, ' '.join(reqs)), TESTDIR, 0)
+                      (options.shell, tdir, ' '.join(reqs)), TESTDIR, 0)
         proc.communicate()
         ret = proc.wait()
         if wifexited(ret):
@@ -909,7 +910,7 @@
 
     # Make a tmp subdirectory to work in
     testtmp = os.environ["TESTTMP"] = os.environ["HOME"] = \
-        os.path.join(HGTMP, os.path.basename(test)).replace('\\', '/')
+        os.path.join(HGTMP, os.path.basename(test))
 
     replacements = [
         (r':%s\b' % options.port, ':$HGPORT'),
@@ -1229,7 +1230,7 @@
             del os.environ[k]
 
     global TESTDIR, HGTMP, INST, BINDIR, PYTHONDIR, COVERAGE_FILE
-    TESTDIR = os.environ["TESTDIR"] = os.getcwd().replace('\\', '/')
+    TESTDIR = os.environ["TESTDIR"] = os.getcwd()
     if options.tmpdir:
         options.keep_tmpdir = True
         tmpdir = options.tmpdir
@@ -1246,7 +1247,12 @@
             #shutil.rmtree(tmpdir)
         os.makedirs(tmpdir)
     else:
-        tmpdir = tempfile.mkdtemp('', 'hgtests.')
+        d = None
+        if os.name == 'nt':
+            # without this, we get the default temp dir location, but
+            # in all lowercase, which causes troubles with paths (issue3490)
+            d = os.getenv('TMP')
+        tmpdir = tempfile.mkdtemp('', 'hgtests.', d)
     HGTMP = os.environ['HGTMP'] = os.path.realpath(tmpdir)
     DAEMON_PIDS = None
     HGRCPATH = None