Commit bdc55588 authored by thomie's avatar thomie

Testsuite: introduce TEST_HC_OPTS_INTERACTIVE (#11468)

Refactoring only.
parent eec88ee0
......@@ -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
......
......@@ -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
......@@ -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
......@@ -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
......
......@@ -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
......@@ -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
......@@ -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.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment