##// END OF EJS Templates
run-tests.py: make tests use same python interpreter as test harness....
Vadim Gelfer -
r2570:2264b2b0 default
parent child Browse files
Show More
@@ -79,6 +79,23 b' def cleanup_exit():'
79 print "# Cleaning up HGTMP", HGTMP
79 print "# Cleaning up HGTMP", HGTMP
80 shutil.rmtree(HGTMP, True)
80 shutil.rmtree(HGTMP, True)
81
81
82 def use_correct_python():
83 # some tests run python interpreter. they must use same
84 # interpreter we use or bad things will happen.
85 exedir, exename = os.path.split(sys.executable)
86 if exename == 'python':
87 path = find_program('python')
88 if os.path.dirname(path) == exedir:
89 return
90 vlog('# Making python executable in test path use correct Python')
91 my_python = os.path.join(BINDIR, 'python')
92 try:
93 os.symlink(sys.executable, my_python)
94 except AttributeError:
95 # windows fallback
96 shutil.copyfile(sys.executable, my_python)
97 shutil.copymode(sys.executable, my_python)
98
82 def install_hg():
99 def install_hg():
83 vlog("# Performing temporary installation of HG")
100 vlog("# Performing temporary installation of HG")
84 installerrs = os.path.join("tests", "install.err")
101 installerrs = os.path.join("tests", "install.err")
@@ -102,6 +119,8 b' def install_hg():'
102 os.environ["PATH"] = "%s%s%s" % (BINDIR, os.pathsep, os.environ["PATH"])
119 os.environ["PATH"] = "%s%s%s" % (BINDIR, os.pathsep, os.environ["PATH"])
103 os.environ["PYTHONPATH"] = PYTHONDIR
120 os.environ["PYTHONPATH"] = PYTHONDIR
104
121
122 use_correct_python()
123
105 if coverage:
124 if coverage:
106 vlog("# Installing coverage wrapper")
125 vlog("# Installing coverage wrapper")
107 os.environ['COVERAGE_FILE'] = COVERAGE_FILE
126 os.environ['COVERAGE_FILE'] = COVERAGE_FILE
General Comments 0
You need to be logged in to leave comments. Login now