mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-20 20:03:44 +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 = .."
37 lines
886 B
Makefile
37 lines
886 B
Makefile
#-----------------------------------------------------------------------------#
|
|
# vim: ts=8 sw=8 noexpandtab ft=make
|
|
#-----------------------------------------------------------------------------#
|
|
#
|
|
# The tests in this directory are always run with `--use-grade-subdirs'.
|
|
|
|
TESTS_DIR = ..
|
|
THIS_DIR = grade_subdirs
|
|
MAYBE_J1 =
|
|
|
|
ifndef WORKSPACE
|
|
PROGS = \
|
|
hello
|
|
else
|
|
# We can only use a workspace if it was built with
|
|
# `--use-grade-subdirs', which in general it won't be.
|
|
PROGS =
|
|
endif
|
|
|
|
# `--use-grade-subdirs' doesn't work with Mmake.
|
|
MMAKE_USE_MMC_MAKE=yes
|
|
|
|
TESTS = $(sort $(PROGS))
|
|
include ../Mmake.common
|
|
|
|
# Module-specific options should go in Mercury.options so they can be found
|
|
# by `mmc --make'.
|
|
include Mercury.options
|
|
|
|
MCFLAGS += --use-grade-subdirs
|
|
|
|
%.runtest: %.res ;
|
|
|
|
hello.out: libhello
|
|
|
|
#-----------------------------------------------------------------------------#
|