--- a/tests/run-tests.py Fri Nov 01 17:14:49 2013 +0000
+++ b/tests/run-tests.py Sun Nov 17 17:30:23 2013 +0000
@@ -103,6 +103,7 @@
requiredtools = [os.path.basename(sys.executable), "diff", "grep", "unzip",
"gunzip", "bunzip2", "sed"]
+createdfiles = []
defaults = {
'jobs': ('HGTEST_JOBS', 1),
@@ -420,6 +421,11 @@
if not options.keep_tmpdir:
vlog("# Cleaning up HGTMP", HGTMP)
shutil.rmtree(HGTMP, True)
+ for f in createdfiles:
+ try:
+ os.remove(f)
+ except OSError:
+ pass
def usecorrectpython():
# some tests run python interpreter. they must use same
@@ -439,6 +445,7 @@
if findprogram(pyexename) != sys.executable:
try:
os.symlink(sys.executable, mypython)
+ createdfiles.append(mypython)
except OSError, err:
# child processes may race, which is harmless
if err.errno != errno.EEXIST:
@@ -498,18 +505,6 @@
usecorrectpython()
- vlog("# Installing dummy diffstat")
- f = open(os.path.join(BINDIR, 'diffstat'), 'w')
- f.write('#!' + sys.executable + '\n'
- 'import sys\n'
- 'files = 0\n'
- 'for line in sys.stdin:\n'
- ' if line.startswith("diff "):\n'
- ' files += 1\n'
- 'sys.stdout.write("files patched: %d\\n" % files)\n')
- f.close()
- os.chmod(os.path.join(BINDIR, 'diffstat'), 0700)
-
if options.py3k_warnings and not options.anycoverage:
vlog("# Updating hg command to enable Py3k Warnings switch")
f = open(os.path.join(BINDIR, 'hg'), 'r')