[commit: ghc] wip/ghc-8.8-merges: testsuite: Remove directories that already exist when seeding extra_files (b9b02b7)

git at git.haskell.org git at git.haskell.org
Thu Feb 21 15:09:16 UTC 2019


Repository : ssh://git@git.haskell.org/ghc

On branch  : wip/ghc-8.8-merges
Link       : http://ghc.haskell.org/trac/ghc/changeset/b9b02b70a4abad29646490c79db141434f757256/ghc

>---------------------------------------------------------------

commit b9b02b70a4abad29646490c79db141434f757256
Author: Ben Gamari <ben at smart-cactus.org>
Date:   Sun Jan 20 22:36:22 2019 -0500

    testsuite: Remove directories that already exist when seeding extra_files
    
    Otherwise the testsuite driver crashes when run multiple times with CLEANUP=NO
    on a test containing such extra_files.


>---------------------------------------------------------------

b9b02b70a4abad29646490c79db141434f757256
 testsuite/driver/testlib.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/testsuite/driver/testlib.py b/testsuite/driver/testlib.py
index ba4f6a5..4a87f0a 100644
--- a/testsuite/driver/testlib.py
+++ b/testsuite/driver/testlib.py
@@ -882,6 +882,8 @@ def do_test(name, way, func, args, files):
         if os.path.isfile(src):
             link_or_copy_file(src, dst)
         elif os.path.isdir(src):
+            if os.path.exists(dst):
+                shutil.rmtree(dst)
             os.mkdir(dst)
             lndir(src, dst)
         else:



More information about the ghc-commits mailing list