[commit: ghc] ghc-8.0: Fix aggressive cleanup of T1407 (5a6f4ac)

git at git.haskell.org git at git.haskell.org
Wed Aug 31 23:23:46 UTC 2016


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

On branch  : ghc-8.0
Link       : http://ghc.haskell.org/trac/ghc/changeset/5a6f4ac9874cffbf396e444cc29d60ed1d214b14/ghc

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

commit 5a6f4ac9874cffbf396e444cc29d60ed1d214b14
Author: Tamar Christina <tamar at zhox.com>
Date:   Sun May 1 17:25:48 2016 +0200

    Fix aggressive cleanup of T1407
    
    Summary:
    The aggressive cleanup routine of T1407 is removing files that don't belong to it.
    Constrain the test to only removing files it should by putting all it's generated
    binaries in it's own output folder.
    
    Test Plan: make test -C testsuite/tests/ghci/linking/dyn
    
    Reviewers: austin, bgamari
    
    Reviewed By: bgamari
    
    Subscribers: thomie, #ghc_windows_task_force
    
    Differential Revision: https://phabricator.haskell.org/D2165
    
    GHC Trac Issues: #1407
    
    (cherry picked from commit e6627d1f8964807f19f8773f09cfaacae7ca8ab8)


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

5a6f4ac9874cffbf396e444cc29d60ed1d214b14
 testsuite/tests/ghci/linking/dyn/Makefile | 22 +++++++++++++++++-----
 testsuite/tests/ghci/linking/dyn/all.T    |  6 +++---
 2 files changed, 20 insertions(+), 8 deletions(-)

diff --git a/testsuite/tests/ghci/linking/dyn/Makefile b/testsuite/tests/ghci/linking/dyn/Makefile
index b37fdea..38721dd 100644
--- a/testsuite/tests/ghci/linking/dyn/Makefile
+++ b/testsuite/tests/ghci/linking/dyn/Makefile
@@ -26,6 +26,16 @@ endif
 
 MY_TEST_HC_OPTS = $(filter-out -rtsopts,$(TEST_HC_OPTS)) $(CFLAGS)
 
+# --------------------------------------------------------------
+# Note: libAS.def is not used directly in these tests but is
+#       included for completeness. libAS.def is the input to
+#       the Microsoft tool "lib.exe" that can be used to
+#       create the import libraries using the short format
+#       that the `compile_libAS_impl_msvc' target uses.
+#
+#       See #11072
+# --------------------------------------------------------------
+
 .PHONY: load_short_name
 load_short_name:
 	rm -rf bin_short
@@ -34,10 +44,12 @@ load_short_name:
 	rm -f bin_short/*.a
 	echo ":q" | "$(TEST_HC)" --interactive -ignore-dot-ghci -L"./bin_short" -lA -v0
 
-.PHONY: compile_libAS
-compile_libAS:
-	'$(TEST_HC)' $(MY_TEST_HC_OPTS) -shared A.c -o $(call DLL,AS)
-	rm -f libAS*.a
+.PHONY: compile_libT1407
+compile_libT1407:
+	rm -rf T1407dir
+	mkdir T1407dir
+	'$(TEST_HC)' $(MY_TEST_HC_OPTS) -odir "T1407dir" -shared A.c -o "T1407dir/$(call DLL,AS)"
+	rm -f T1407dir/libAS*.a
 
 .PHONY: compile_libT10458
 compile_libT10458:
@@ -82,7 +94,7 @@ compile_libAS_impl_msvc:
 
 .PHONY: T1407
 T1407:
-	cat T1407.script | LD_LIBRARY_PATH=. "$(TEST_HC)" $(TEST_HC_OPTS) -ignore-dot-ghci -v0 --interactive -L.
+	cat T1407.script | LD_LIBRARY_PATH=. "$(TEST_HC)" $(TEST_HC_OPTS) -ignore-dot-ghci -v0 --interactive -L"T1407dir"
 
 .PHONY: T3242
 	echo ":q" | '$(TEST_HC)' $(TEST_HC_OPTS) --interactive -ignore-dot-ghci -v0 -lm
diff --git a/testsuite/tests/ghci/linking/dyn/all.T b/testsuite/tests/ghci/linking/dyn/all.T
index d54c84e..b8ef670 100644
--- a/testsuite/tests/ghci/linking/dyn/all.T
+++ b/testsuite/tests/ghci/linking/dyn/all.T
@@ -6,9 +6,9 @@ test('load_short_name',
 
 test('T1407',
      [unless(doing_ghci, skip),
-     extra_clean(['libAS.*']),
-     pre_cmd('$MAKE -s --no-print-directory compile_libAS'),
-     extra_hc_opts('-L.')],
+     extra_clean(['T1407dir/libAS.*']),
+     pre_cmd('$MAKE -s --no-print-directory compile_libT1407'),
+     extra_hc_opts('-L$PWD/T1407dir')],
      run_command, ['$MAKE --no-print-directory -s T1407'])
 
 test('T3242',



More information about the ghc-commits mailing list