summaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
authorThomas Miedema <thomasmiedema@gmail.com>2016-05-25 13:01:42 +0200
committerThomas Miedema <thomasmiedema@gmail.com>2016-05-25 19:25:01 +0200
commitbdc555885b8898684549eca70053c9ce0ec7fa39 (patch)
tree4a16851b6fd0e6132ac528778eeb80f2d13a9606 /testsuite
parenteec88ee07c28a18b1b5b4edfde8e898324264bce (diff)
downloadhaskell-bdc555885b8898684549eca70053c9ce0ec7fa39.tar.gz
Testsuite: introduce TEST_HC_OPTS_INTERACTIVE (#11468)
Refactoring only.
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/mk/test.mk2
-rw-r--r--testsuite/tests/ghci/linking/dyn/Makefile8
-rw-r--r--testsuite/tests/ghci/prog004/Makefile2
-rw-r--r--testsuite/tests/ghci/scripts/Makefile20
-rw-r--r--testsuite/tests/ghci/should_run/Makefile2
-rw-r--r--testsuite/tests/rts/T11223/Makefile30
-rw-r--r--testsuite/tests/th/Makefile2
7 files changed, 34 insertions, 32 deletions
diff --git a/testsuite/mk/test.mk b/testsuite/mk/test.mk
index 66d611c7e9..4091b98ddd 100644
--- a/testsuite/mk/test.mk
+++ b/testsuite/mk/test.mk
@@ -36,6 +36,8 @@ endif
# in nested Makefiles
TEST_HC_OPTS = -fforce-recomp -dcore-lint -dcmm-lint -dno-debug-output -no-user-$(GhcPackageDbFlag) -rtsopts $(EXTRA_HC_OPTS)
+TEST_HC_OPTS_INTERACTIVE = $(TEST_HC_OPTS) --interactive -v0 -ignore-dot-ghci
+
# The warning suppression flag below is a temporary kludge. While working with
# tests that contain tabs, please de-tab them so this flag can be eventually
# removed. See
diff --git a/testsuite/tests/ghci/linking/dyn/Makefile b/testsuite/tests/ghci/linking/dyn/Makefile
index 38721dd6a5..6319f4bc7e 100644
--- a/testsuite/tests/ghci/linking/dyn/Makefile
+++ b/testsuite/tests/ghci/linking/dyn/Makefile
@@ -82,7 +82,7 @@ compile_libAS_impl_gcc:
mkdir bin_impl_gcc
'$(TEST_HC)' $(MY_TEST_HC_OPTS) -odir "bin_impl_gcc" -shared A.c -o "bin_impl_gcc/$(call DLL,ASimpL)"
mv bin_impl_gcc/libASimpL.dll.a bin_impl_gcc/libASx.dll.a
- echo "main" | '$(TEST_HC)' $(TEST_HC_OPTS) --interactive -ignore-dot-ghci -v0 T11072.hs -lASx -L./bin_impl_gcc
+ echo "main" | '$(TEST_HC)' $(TEST_HC_OPTS_INTERACTIVE) T11072.hs -lASx -L./bin_impl_gcc
.PHONY: compile_libAS_impl_msvc
compile_libAS_impl_msvc:
@@ -90,11 +90,11 @@ compile_libAS_impl_msvc:
mkdir bin_impl_msvc
'$(TEST_HC)' $(MY_TEST_HC_OPTS) -odir "bin_impl_msvc" -shared A.c -o "bin_impl_msvc/$(call DLL,ASimpL)"
rm -f bin_impl_msvc/libAS*.a
- echo "main" | '$(TEST_HC)' $(TEST_HC_OPTS) --interactive -ignore-dot-ghci -v0 T11072.hs -lAS -L./bin_impl_msvc -L"./$(shell uname -m)"
+ echo "main" | '$(TEST_HC)' $(TEST_HC_OPTS_INTERACTIVE) T11072.hs -lAS -L./bin_impl_msvc -L"./$(shell uname -m)"
.PHONY: T1407
T1407:
- cat T1407.script | LD_LIBRARY_PATH=. "$(TEST_HC)" $(TEST_HC_OPTS) -ignore-dot-ghci -v0 --interactive -L"T1407dir"
+ cat T1407.script | LD_LIBRARY_PATH=. "$(TEST_HC)" $(TEST_HC_OPTS_INTERACTIVE) -L"T1407dir"
.PHONY: T3242
- echo ":q" | '$(TEST_HC)' $(TEST_HC_OPTS) --interactive -ignore-dot-ghci -v0 -lm
+ echo ":q" | '$(TEST_HC)' $(TEST_HC_OPTS_INTERACTIVE) -lm
diff --git a/testsuite/tests/ghci/prog004/Makefile b/testsuite/tests/ghci/prog004/Makefile
index 49e1f5d25d..a959f82dc1 100644
--- a/testsuite/tests/ghci/prog004/Makefile
+++ b/testsuite/tests/ghci/prog004/Makefile
@@ -8,4 +8,4 @@ ghciprog004:
rm -f ctest.o
echo "int foo(){return 0;}" >ctest.c
'$(TEST_HC)' $(TEST_HC_OPTS) -optc-g -c ctest.c
- echo ":q" | '$(TEST_HC)' $(TEST_HC_OPTS) -v0 --interactive -ignore-dot-ghci ctest.o
+ echo ":q" | '$(TEST_HC)' $(TEST_HC_OPTS_INTERACTIVE) ctest.o
diff --git a/testsuite/tests/ghci/scripts/Makefile b/testsuite/tests/ghci/scripts/Makefile
index 0b70318987..545c4e9e96 100644
--- a/testsuite/tests/ghci/scripts/Makefile
+++ b/testsuite/tests/ghci/scripts/Makefile
@@ -5,32 +5,32 @@ include $(TOP)/mk/test.mk
ghci024:
@echo "~~~~~~~~~~ Testing :set"
printf ":set\n" \
- | '$(TEST_HC)' $(TEST_HC_OPTS) --interactive -v0 -ignore-dot-ghci
+ | '$(TEST_HC)' $(TEST_HC_OPTS_INTERACTIVE)
@echo "~~~~~~~~~~ Testing :set -a"
printf ":set -a\n" \
- | '$(TEST_HC)' $(TEST_HC_OPTS) --interactive -v0 -ignore-dot-ghci \
+ | '$(TEST_HC)' $(TEST_HC_OPTS_INTERACTIVE) \
| grep -E "^([^ ]| -fno-print-explicit-foralls| -Wno-implicit-prelude)"
@echo "~~~~~~~~~~ Testing :show languages"
printf ":show languages\n" \
- | '$(TEST_HC)' $(TEST_HC_OPTS) --interactive -v0 -ignore-dot-ghci
+ | '$(TEST_HC)' $(TEST_HC_OPTS_INTERACTIVE)
@echo "~~~~~~~~~~ Testing :show languages, with -XMagicHash"
printf ":set -XMagicHash\n:show languages\n" \
- | '$(TEST_HC)' $(TEST_HC_OPTS) --interactive -v0 -ignore-dot-ghci
+ | '$(TEST_HC)' $(TEST_HC_OPTS_INTERACTIVE)
@echo "~~~~~~~~~~ Testing :show packages"
printf ":show packages\n" \
- | '$(TEST_HC)' $(TEST_HC_OPTS) --interactive -v0 -ignore-dot-ghci \
+ | '$(TEST_HC)' $(TEST_HC_OPTS_INTERACTIVE) \
| grep -E "^([^ ]| -package|base|ghc-prim|integer|rts|Cabal)" \
| sed "s/Cabal-[0-9.]*/Cabal-VERSION/"
@echo "~~~~~~~~~~ Testing :show packages, including the ghc package"
printf ":set -package ghc\n:show packages\n" \
- | '$(TEST_HC)' $(TEST_HC_OPTS) --interactive -v0 -ignore-dot-ghci \
+ | '$(TEST_HC)' $(TEST_HC_OPTS_INTERACTIVE) \
| grep -E "^([^ ]| -package|base|ghc-prim|integer|rts|Cabal)" \
| sed "s/Cabal-[0-9.]*/Cabal-VERSION/"
.PHONY: ghci037
ghci037:
- '$(TEST_HC)' $(TEST_HC_OPTS) --interactive -v0 -ignore-dot-ghci < ghci037.script
- '$(TEST_HC)' $(TEST_HC_OPTS) --interactive -v0 -ignore-dot-ghci -fno-ghci-sandbox < ghci037.script
+ '$(TEST_HC)' $(TEST_HC_OPTS_INTERACTIVE) < ghci037.script
+ '$(TEST_HC)' $(TEST_HC_OPTS_INTERACTIVE) -fno-ghci-sandbox < ghci037.script
ghci056_setup:
'$(TEST_HC)' $(TEST_HC_OPTS) -c ghci056_c.c
@@ -41,7 +41,7 @@ T6106_prep:
.PHONY: T9367
T9367:
- '$(TEST_HC)' $(TEST_HC_OPTS) --interactive -v0 -ignore-dot-ghci < T9367.script > T9367-raw.run.stdout
+ '$(TEST_HC)' $(TEST_HC_OPTS_INTERACTIVE) < T9367.script > T9367-raw.run.stdout
cmp T9367-raw.run.stdout T9367-raw.stdout
.PHONY: T9762_prep
@@ -52,7 +52,7 @@ T9762_prep:
T10408:
# `-ghci-script`s should be executed in the order they are specified,
# and not be ignored when `-ignore-dot-ghci` is specified.
- '$(TEST_HC)' $(TEST_HC_OPTS) --interactive -v0 -ignore-dot-ghci \
+ '$(TEST_HC)' $(TEST_HC_OPTS_INTERACTIVE) \
-ghci-script T10408A.script -ghci-script T10408B.script < /dev/null
.PHONY: T11389
diff --git a/testsuite/tests/ghci/should_run/Makefile b/testsuite/tests/ghci/should_run/Makefile
index 2558b54d08..1d4be3ec51 100644
--- a/testsuite/tests/ghci/should_run/Makefile
+++ b/testsuite/tests/ghci/should_run/Makefile
@@ -5,5 +5,5 @@ include $(TOP)/mk/test.mk
# Test that threadDelay can be interrupted by ^C.
T3171:
echo "do Control.Concurrent.threadDelay 3000000; putStrLn \"threadDelay was not interrupted\"" | \
- "$(TEST_HC)" $(TEST_HC_OPTS) -ignore-dot-ghci -v0 --interactive & \
+ "$(TEST_HC)" $(TEST_HC_OPTS_INTERACTIVE) & \
sleep 2; kill -INT $$!; wait
diff --git a/testsuite/tests/rts/T11223/Makefile b/testsuite/tests/rts/T11223/Makefile
index 895c6b8681..49207040c7 100644
--- a/testsuite/tests/rts/T11223/Makefile
+++ b/testsuite/tests/rts/T11223/Makefile
@@ -12,21 +12,21 @@ CC=gcc
t_11223_simple_link:
$(RM) -f foo_simple.o foo.hi foo.o
"$(CC)" -c foo.c -o foo_simple.o
- echo main | "$(TEST_HC)" --interactive -v0 $(filter-out -rtsopts, $(TEST_HC_OPTS)) -ignore-dot-ghci foo_simple.o foo.hs
+ echo main | "$(TEST_HC)" $(filter-out -rtsopts, $(TEST_HC_OPTS_INTERACTIVE)) foo_simple.o foo.hs
.PHONY: t_11223_simple_link_lib
t_11223_simple_link_lib:
$(RM) -f foo_lib.o foo.hi foo.o libfoo_lib.a
"$(CC)" -c foo.c -o foo_lib.o
"$(AR)" rs libfoo_lib.a foo_lib.o 2> /dev/null
- echo main | "$(TEST_HC)" --interactive -v0 $(filter-out -rtsopts, $(TEST_HC_OPTS)) -ignore-dot-ghci foo.hs -lfoo_lib -L"$(PWD)"
+ echo main | "$(TEST_HC)" $(filter-out -rtsopts, $(TEST_HC_OPTS_INTERACTIVE)) foo.hs -lfoo_lib -L"$(PWD)"
.PHONY: t_11223_simple_duplicate
t_11223_simple_duplicate:
$(RM) -f foo_dup.o bar_dup.o foo.hi foo.o
"$(CC)" -c foo.c -o foo_dup.o
"$(CC)" -c bar.c -o bar_dup.o
- echo main | "$(TEST_HC)" --interactive -v0 $(filter-out -rtsopts, $(TEST_HC_OPTS)) -ignore-dot-ghci foo_dup.o bar_dup.o foo.hs
+ echo main | "$(TEST_HC)" $(filter-out -rtsopts, $(TEST_HC_OPTS_INTERACTIVE)) foo_dup.o bar_dup.o foo.hs
.PHONY: t_11223_simple_duplicate_lib
t_11223_simple_duplicate_lib:
@@ -34,7 +34,7 @@ t_11223_simple_duplicate_lib:
"$(CC)" -c foo.c -o foo_dup_lib.o
"$(CC)" -c bar.c -o bar_dup_lib.o
"$(AR)" rs libfoo_dup_lib.a foo_dup_lib.o 2> /dev/null
- echo main | "$(TEST_HC)" --interactive -v0 $(filter-out -rtsopts, $(TEST_HC_OPTS)) -ignore-dot-ghci bar_dup_lib.o foo.hs -lfoo_dup_lib -L"$(PWD)"
+ echo main | "$(TEST_HC)" $(filter-out -rtsopts, $(TEST_HC_OPTS_INTERACTIVE)) bar_dup_lib.o foo.hs -lfoo_dup_lib -L"$(PWD)"
.PHONY: t_11223_simple_unused_duplicate_lib
t_11223_simple_unused_duplicate_lib:
@@ -42,7 +42,7 @@ t_11223_simple_unused_duplicate_lib:
"$(CC)" -c foo.c -o foo_dup_lib.o
"$(CC)" -c bar.c -o bar_dup_lib.o
"$(AR)" rs libbar_dup_lib.a bar_dup_lib.o 2> /dev/null
- echo main | "$(TEST_HC)" --interactive -v0 $(filter-out -rtsopts, $(TEST_HC_OPTS)) -ignore-dot-ghci foo_dup_lib.o foo.hs -lbar_dup_lib -L"$(PWD)"
+ echo main | "$(TEST_HC)" $(filter-out -rtsopts, $(TEST_HC_OPTS_INTERACTIVE)) foo_dup_lib.o foo.hs -lbar_dup_lib -L"$(PWD)"
.PHONY: t_11223_link_order_a_b_succeed
t_11223_link_order_a_b_succeed:
@@ -51,7 +51,7 @@ t_11223_link_order_a_b_succeed:
"$(CC)" -c bar.c -o bar_link_lib_1.o
"$(AR)" rs libbar_link_lib_1.a bar_link_lib_1.o 2> /dev/null
"$(AR)" rs libfoo_link_lib_1.a foo_link_lib_1.o 2> /dev/null
- echo main | "$(TEST_HC)" --interactive -v0 $(filter-out -rtsopts, $(TEST_HC_OPTS)) -ignore-dot-ghci foo2.hs -lbar_link_lib_1 -lfoo_link_lib_1 -L"$(PWD)"
+ echo main | "$(TEST_HC)" $(filter-out -rtsopts, $(TEST_HC_OPTS_INTERACTIVE)) foo2.hs -lbar_link_lib_1 -lfoo_link_lib_1 -L"$(PWD)"
.PHONY: t_11223_link_order_b_a_succeed
t_11223_link_order_b_a_succeed:
@@ -60,7 +60,7 @@ t_11223_link_order_b_a_succeed:
"$(CC)" -c bar.c -o bar_link_lib_2.o
"$(AR)" rs libbar_link_lib_2.a bar_link_lib_2.o 2> /dev/null
"$(AR)" rs libfoo_link_lib_2.a foo_link_lib_2.o 2> /dev/null
- echo main | "$(TEST_HC)" --interactive -v0 $(filter-out -rtsopts, $(TEST_HC_OPTS)) -ignore-dot-ghci foo2.hs -lfoo_link_lib_2 -lbar_link_lib_2 -L"$(PWD)"
+ echo main | "$(TEST_HC)" $(filter-out -rtsopts, $(TEST_HC_OPTS_INTERACTIVE)) foo2.hs -lfoo_link_lib_2 -lbar_link_lib_2 -L"$(PWD)"
.PHONY: t_11223_link_order_a_b_2_fail
t_11223_link_order_a_b_2_fail:
@@ -69,7 +69,7 @@ t_11223_link_order_a_b_2_fail:
"$(CC)" -c bar.c -o bar_link_lib_3.o
"$(AR)" rs libbar_link_lib_3.a bar_link_lib_3.o 2> /dev/null
"$(AR)" rs libfoo_link_lib_3.a foo_link_lib_3.o 2> /dev/null
- echo main | "$(TEST_HC)" --interactive -v0 $(filter-out -rtsopts, $(TEST_HC_OPTS)) -ignore-dot-ghci foo3.hs -lbar_link_lib_3 -lfoo_link_lib_3 -L"$(PWD)"
+ echo main | "$(TEST_HC)" $(filter-out -rtsopts, $(TEST_HC_OPTS_INTERACTIVE)) foo3.hs -lbar_link_lib_3 -lfoo_link_lib_3 -L"$(PWD)"
.PHONY: t_11223_link_order_b_a_2_succeed
t_11223_link_order_b_a_2_succeed:
@@ -78,7 +78,7 @@ t_11223_link_order_b_a_2_succeed:
"$(CC)" -c bar.c -o bar_link_lib_4.o
"$(AR)" rs libbar_link_lib_4.a bar_link_lib_4.o 2> /dev/null
"$(AR)" rs libfoo_link_lib_4.a foo_link_lib_4.o 2> /dev/null
- echo main | "$(TEST_HC)" --interactive -v0 $(filter-out -rtsopts, $(TEST_HC_OPTS)) -ignore-dot-ghci foo3.hs -lfoo_link_lib_4 -lbar_link_lib_4 -L"$(PWD)"
+ echo main | "$(TEST_HC)" $(filter-out -rtsopts, $(TEST_HC_OPTS_INTERACTIVE)) foo3.hs -lfoo_link_lib_4 -lbar_link_lib_4 -L"$(PWD)"
# -----------------------------------------------------------------------------
# Testing RTS weak symbols resolution
@@ -88,39 +88,39 @@ t_11223_link_order_b_a_2_succeed:
t_11223_weak_only_link_fail:
$(RM) -f power_w1.o power.hi power.o
"$(CC)" -c power.c -DWEAK -o power_w1.o
- echo main | "$(TEST_HC)" --interactive -v0 $(filter-out -rtsopts, $(TEST_HC_OPTS)) -ignore-dot-ghci power.hs power_w1.o
+ echo main | "$(TEST_HC)" $(filter-out -rtsopts, $(TEST_HC_OPTS_INTERACTIVE)) power.hs power_w1.o
.PHONY: t_11223_weak_only_link_succeed
t_11223_weak_only_link_succeed:
$(RM) -f power_w2.o power3.hi power3.o
"$(CC)" -c power_slow.c -DWEAK -o power_w2.o
- echo main | "$(TEST_HC)" --interactive -v0 $(filter-out -rtsopts, $(TEST_HC_OPTS)) -ignore-dot-ghci power3.hs power_w2.o
+ echo main | "$(TEST_HC)" $(filter-out -rtsopts, $(TEST_HC_OPTS_INTERACTIVE)) power3.hs power_w2.o
.PHONY: t_11223_weak_both_link_order_a_b_succeed
t_11223_weak_both_link_order_a_b_succeed:
$(RM) -f fast_power_w3.o slow_power_w3.o power3.hi power3.o
"$(CC)" -c power_slow.c -DWEAK -o slow_power_w3.o
"$(CC)" -c power.c -DWEAK -o fast_power_w3.o
- echo main | "$(TEST_HC)" --interactive -v0 $(filter-out -rtsopts, $(TEST_HC_OPTS)) -ignore-dot-ghci power3.hs fast_power_w3.o slow_power_w3.o
+ echo main | "$(TEST_HC)" $(filter-out -rtsopts, $(TEST_HC_OPTS_INTERACTIVE)) power3.hs fast_power_w3.o slow_power_w3.o
.PHONY: t_11223_weak_both_link_order_b_a_succeed
t_11223_weak_both_link_order_b_a_succeed:
$(RM) -f fast_power_w4.o slow_power_w4.o power3.hi power3.o
"$(CC)" -c power_slow.c -DWEAK -o slow_power_w4.o
"$(CC)" -c power.c -DWEAK -o fast_power_w4.o
- echo main | "$(TEST_HC)" --interactive -v0 $(filter-out -rtsopts, $(TEST_HC_OPTS)) -ignore-dot-ghci power3.hs slow_power_w4.o fast_power_w4.o
+ echo main | "$(TEST_HC)" $(filter-out -rtsopts, $(TEST_HC_OPTS_INTERACTIVE)) power3.hs slow_power_w4.o fast_power_w4.o
.PHONY: t_11223_weak_single_link_order_a_b_succeed
t_11223_weak_single_link_order_a_b_succeed:
$(RM) -f fast_power_w5.o slow_power_w5.o power3.hi power3.o
"$(CC)" -c power_slow.c -o slow_power_w5.o
"$(CC)" -c power.c -DWEAK -o fast_power_w5.o
- echo main | "$(TEST_HC)" --interactive -v0 $(filter-out -rtsopts, $(TEST_HC_OPTS)) -ignore-dot-ghci power3.hs fast_power_w5.o slow_power_w5.o
+ echo main | "$(TEST_HC)" $(filter-out -rtsopts, $(TEST_HC_OPTS_INTERACTIVE)) power3.hs fast_power_w5.o slow_power_w5.o
.PHONY: t_11223_weak_single_link_order_b_a_succeed
t_11223_weak_single_link_order_b_a_succeed:
$(RM) -f fast_power_w6.o slow_power_w6.o power3.hi power3.o
"$(CC)" -c power_slow.c -DWEAK -o slow_power_w6.o
"$(CC)" -c power.c -o fast_power_w6.o
- echo main | "$(TEST_HC)" --interactive -v0 $(filter-out -rtsopts, $(TEST_HC_OPTS)) -ignore-dot-ghci power3.hs slow_power_w6.o fast_power_w6.o
+ echo main | "$(TEST_HC)" $(filter-out -rtsopts, $(TEST_HC_OPTS_INTERACTIVE)) power3.hs slow_power_w6.o fast_power_w6.o
diff --git a/testsuite/tests/th/Makefile b/testsuite/tests/th/Makefile
index 2d6cc7036d..87a6738160 100644
--- a/testsuite/tests/th/Makefile
+++ b/testsuite/tests/th/Makefile
@@ -45,7 +45,7 @@ TH_Depends:
T8333:
- '$(TEST_HC)' $(TEST_HC_OPTS) $(ghcThWayFlags) --interactive -v0 -ignore-dot-ghci T8333.hs < /dev/null
+ '$(TEST_HC)' $(TEST_HC_OPTS_INTERACTIVE) $(ghcThWayFlags) T8333.hs < /dev/null
# This was an easy way to re-use the stdout testing
# to check the contents of a generated file.