Merge with stable
authorChristian Ebert <blacktrash@gmx.net>
Sun, 10 Jun 2012 16:32:22 +0100
changeset 1092 25db33023e4e
parent 1087 06fb629c6195 (current diff)
parent 1091 15dc93f78ecd (diff)
child 1097 7f458d071b49
Merge with stable
--- a/tests/hghave	Tue Jun 05 00:20:53 2012 +0100
+++ b/tests/hghave	Sun Jun 10 16:32:22 2012 +0100
@@ -202,7 +202,7 @@
         os.rmdir(d)
 
 def has_pyflakes():
-    return matchoutput('echo "import re" 2>&1 | pyflakes',
+    return matchoutput("sh -c \"echo 'import re' 2>&1 | pyflakes\"",
                        r"<stdin>:1: 're' imported but unused",
                        True)
 
@@ -241,6 +241,8 @@
     return os.getenv('MSYSTEM')
 
 checks = {
+    "true": (lambda: True, "yak shaving"),
+    "false": (lambda: False, "nail clipper"),
     "baz": (has_baz, "GNU Arch baz client"),
     "bzr": (has_bzr, "Canonical's Bazaar client"),
     "bzr114": (has_bzr114, "Canonical's Bazaar client >= 1.14"),
--- 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