[PATCH 2 of 2] run-tests: remove files that we potentially create outside of $TMPDIR
Augie Fackler
raf at durin42.com
Sat Nov 16 17:35:25 UTC 2013
On Fri, Nov 15, 2013 at 11:09:17PM -0500, Sean Farley wrote:
> # HG changeset patch
> # User Sean Farley <sean.michael.farley at gmail.com>
> # Date 1384574231 18000
> # Fri Nov 15 22:57:11 2013 -0500
> # Node ID 8431e9b86bb35fa95e19e5566a77bfc0e12cb1de
> # Parent 32b6b92916e9c4f0c5a0b9e40efcbecdb0b7afac
> run-tests: remove files that we potentially create outside of $TMPDIR
queueing these, thanks
>
> diff --git a/tests/run-tests.py b/tests/run-tests.py
> --- a/tests/run-tests.py
> +++ b/tests/run-tests.py
> @@ -101,10 +101,11 @@
> if 'java' in sys.platform:
> IMPL_PATH = 'JYTHONPATH'
>
> requiredtools = [os.path.basename(sys.executable), "diff", "grep", "unzip",
> "gunzip", "bunzip2", "sed"]
> +createdfiles = []
>
> defaults = {
> 'jobs': ('HGTEST_JOBS', 1),
> 'timeout': ('HGTEST_TIMEOUT', 180),
> 'port': ('HGTEST_PORT', 20059),
> @@ -418,10 +419,15 @@
>
> def cleanup(options):
> 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
> # interpreter we use or bad things will happen.
> pyexename = sys.platform == 'win32' and 'python.exe' or 'python'
> @@ -437,10 +443,11 @@
> if err.errno != errno.ENOENT:
> raise
> 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:
> raise
> else:
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel
More information about the Mercurial-devel
mailing list