diff options
author | Thomas Miedema <thomasmiedema@gmail.com> | 2016-06-02 15:10:28 +0200 |
---|---|---|
committer | Thomas Miedema <thomasmiedema@gmail.com> | 2016-06-02 15:27:04 +0200 |
commit | 36d254afadb49a855dea031c036b1a371a567f16 (patch) | |
tree | 6857c614d0e835576de8b4ef7b9155876474af80 | |
parent | 99ace837a364a5faa207280576c6ffbda4fe262a (diff) | |
download | haskell-36d254afadb49a855dea031c036b1a371a567f16.tar.gz |
Testsuite: run tests in /tmp/ghctest-xxx instead of /tmp/ghctest/xxx
This fixes a bug of not being able to create files or directories in
/tmp/ghctest if it was created by a different user.
Trac ticket #11980.
-rw-r--r-- | testsuite/driver/runtests.py | 16 |
1 files changed, 1 insertions, 15 deletions
diff --git a/testsuite/driver/runtests.py b/testsuite/driver/runtests.py index 629a85e18d..c62c5a76d2 100644 --- a/testsuite/driver/runtests.py +++ b/testsuite/driver/runtests.py @@ -276,25 +276,11 @@ else: # set stdout to unbuffered (is this the best way to do it?) sys.stdout = os.fdopen(sys.__stdout__.fileno(), "w", 0) -# Create a unique temporary directory inside '/tmp/ghctest'. -ghctestdir = os.path.join(tempfile.gettempdir(), 'ghctest') -# Don't start from scratch (i.e. don't rmtree(ghctestdir)). Running -# 'make test' while another 'make test' hasn't completed yet should work. -#shutil.rmtree(ghctestdir, ignore_errors=True) -mkdirp(ghctestdir) -tempdir = normalise_slashes_(tempfile.mkdtemp('', '', dir=ghctestdir)) +tempdir = normalise_slashes_(tempfile.mkdtemp('', 'ghctest-')) def cleanup_and_exit(exitcode): if config.cleanup: shutil.rmtree(tempdir, ignore_errors=True) - try: - os.rmdir(ghctestdir) - except OSError as e: - if e.errno == errno.ENOTEMPTY: - # Only delete ghctestdir if it is empty. - pass - else: - raise exit(exitcode) # First collect all the tests to be run |