summaryrefslogtreecommitdiff
path: root/testsuite/tests/ghci/linking
diff options
context:
space:
mode:
authorTamar Christina <tamar@zhox.com>2016-05-01 17:25:48 +0200
committerTamar Christina <tamar@zhox.com>2016-05-01 19:27:06 +0200
commite6627d1f8964807f19f8773f09cfaacae7ca8ab8 (patch)
tree3c50eeda369b3bc1616abd6820d2f113df464f72 /testsuite/tests/ghci/linking
parentf69e7078930ea0f80dbd3a0d1a4b89db83a32a32 (diff)
downloadhaskell-e6627d1f8964807f19f8773f09cfaacae7ca8ab8.tar.gz
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
Diffstat (limited to 'testsuite/tests/ghci/linking')
-rw-r--r--testsuite/tests/ghci/linking/dyn/Makefile22
-rw-r--r--testsuite/tests/ghci/linking/dyn/all.T6
2 files changed, 20 insertions, 8 deletions
diff --git a/testsuite/tests/ghci/linking/dyn/Makefile b/testsuite/tests/ghci/linking/dyn/Makefile
index b37fdeaf21..38721dd6a5 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 d54c84eec9..b8ef670830 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',