diff options
author | Thomas Miedema <thomasmiedema@gmail.com> | 2018-08-06 19:48:39 +0200 |
---|---|---|
committer | Krzysztof Gogolewski <krz.gogolewski@gmail.com> | 2018-08-06 19:48:40 +0200 |
commit | 29dfb63624442a27119c1a218fc3dae71afb16de (patch) | |
tree | 3b14f05a01de03e78c5e88e37ffaa3398bb05db9 /testsuite/driver | |
parent | e94cc29ef65d27536a9430c4c84665b6f6b7d65b (diff) | |
download | haskell-29dfb63624442a27119c1a218fc3dae71afb16de.tar.gz |
Strip ../ from testdir (fixes #15469)
Test Plan: Harbormaster
Reviewers: bgamari
Reviewed By: bgamari
Subscribers: rwbarton, carter
GHC Trac Issues: #15469
Differential Revision: https://phabricator.haskell.org/D5039
Diffstat (limited to 'testsuite/driver')
-rw-r--r-- | testsuite/driver/testlib.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/testsuite/driver/testlib.py b/testsuite/driver/testlib.py index f99c6eddb4..ef2b8dd40f 100644 --- a/testsuite/driver/testlib.py +++ b/testsuite/driver/testlib.py @@ -14,6 +14,7 @@ import copy import glob import sys from math import ceil, trunc +from pathlib import PurePath import collections import subprocess @@ -618,8 +619,9 @@ def newTestDir(tempdir, dir): testdir_suffix = '.run' def _newTestDir(name, opts, tempdir, dir): + testdir = os.path.join('', *(p for p in PurePath(dir).parts if p != '..')) opts.srcdir = os.path.join(os.getcwd(), dir) - opts.testdir = os.path.join(tempdir, dir, name + testdir_suffix) + opts.testdir = os.path.join(tempdir, testdir, name + testdir_suffix) opts.compiler_always_flags = config.compiler_always_flags # ----------------------------------------------------------------------------- |