mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-19 03:13:40 +00:00
My commitafe2887882broke the ability to run the test suite outside of a bootcheck by executing "mmake runtests" in the tests directory. This diff fixes that. tests/Mmake.common: Don't define "TESTS_DIR = ..". While every single tests/*/Mmakefile defined it as such, I overlooked the fact that tests/Mmakefile itself defined it ".", referring to the same directory from a different starting point. Document this easily-overlooked fact. Rename the old runtests target, which afterafe2887runs the tests in a single directory, as runtests_dir, to leave the target name "runtests" itself free for tests/Mmakefile to use. tests/Mmakefile: Define "TESTS_DIR = .", and add a target "runtests" which invokes "mmake runtests_dir" in each test directory. tools/bootcheck: Invoke "mmake runtests_dir" instead of "mmake runtests" in each test directory. Initialize a variable just before it is used. tests/*/Mmakefile: Add back the definition "TESTS_DIR = .."
74 lines
1.7 KiB
Makefile
74 lines
1.7 KiB
Makefile
#-----------------------------------------------------------------------------#
|
|
# vim: ts=8 sw=8 noexpandtab ft=make
|
|
#-----------------------------------------------------------------------------#
|
|
|
|
TESTS_DIR = ..
|
|
THIS_DIR = accumulator
|
|
MAYBE_J1 =
|
|
|
|
#-----------------------------------------------------------------------------#
|
|
|
|
# Any program added here should also be added to the `.cvsignore' file.
|
|
|
|
ACCUMULATOR_PROGS = \
|
|
base \
|
|
call_in_base \
|
|
chain \
|
|
commutative \
|
|
construct_test \
|
|
deconstruct_test \
|
|
dcg \
|
|
disj \
|
|
func \
|
|
highorder \
|
|
heuristic \
|
|
identity \
|
|
inter \
|
|
ite \
|
|
nonrec \
|
|
out_to_in \
|
|
qsort \
|
|
simple \
|
|
split \
|
|
swap
|
|
|
|
PROGS = $(ACCUMULATOR_PROGS)
|
|
|
|
TESTS = $(PROGS)
|
|
include ../Mmake.common
|
|
|
|
# Module-specific options should go in Mercury.options so they
|
|
# can be found by `mmc --make'.
|
|
include Mercury.options
|
|
|
|
%.runtest: %.res ;
|
|
|
|
#-----------------------------------------------------------------------------#
|
|
|
|
ACC_FLAGS = \
|
|
-d accum \
|
|
--introduce-accumulators \
|
|
--optimize-constructor-last-call \
|
|
--intermodule-optimization
|
|
|
|
# Optimizations to turn off/on.
|
|
# Deforestation optimizes away the opportunities for accumulator introduction
|
|
# in many of the test cases, so turn it off.
|
|
OPT_FLAGS = \
|
|
--trace-optimized --excess-assign --common-struct --no-deforestation
|
|
|
|
# Ensure that the accumulator introduction flags are passed
|
|
# after EXTRA_MCFLAGS, so that we can override things set in EXTRA_MCFLAGS.
|
|
ALL_MCFLAGS += $(OPT_FLAGS) $(ACC_FLAGS)
|
|
|
|
EXPS = $(PROGS:%=%.exp)
|
|
|
|
exp: $(EXPS)
|
|
|
|
realclean_local: clean_hlds_dump
|
|
|
|
clean_hlds_dump:
|
|
-rm -f *hlds_dump*
|
|
|
|
#-----------------------------------------------------------------------------#
|