run-tests: use os.path.realpath() to find hg's setup.py.
authorGreg Ward <greg-hg@gerg.ca>
Tue, 23 Jun 2009 22:20:54 -0400
changeset 8943 09ff905cdc86
parent 8942 51038bb526ea
child 8944 dda4ad7c9ea9
run-tests: use os.path.realpath() to find hg's setup.py. Needed for running out-of-tree test suites without --with-hg/--local.
tests/run-tests.py
--- a/tests/run-tests.py	Wed Jun 24 03:05:01 2009 +0200
+++ b/tests/run-tests.py	Tue Jun 23 22:20:54 2009 -0400
@@ -266,7 +266,9 @@
     pure = options.pure and "--pure" or ""
 
     # Run installer in hg root
-    os.chdir(os.path.join(os.path.dirname(sys.argv[0]), '..'))
+    script = os.path.realpath(sys.argv[0])
+    hgroot = os.path.dirname(os.path.dirname(script))
+    os.chdir(hgroot)
     cmd = ('%s setup.py %s clean --all'
            ' install --force --prefix="%s" --install-lib="%s"'
            ' --install-scripts="%s" >%s 2>&1'