Files
mercury/tests/misc_tests/Mmakefile
Zoltan Somogyi 1f45f91886 Make "mmake runtests" work again.
My commit afe2887882 broke 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 after afe2887 runs 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 = .."
2020-06-10 01:05:15 +10:00

54 lines
1.5 KiB
Makefile

#-----------------------------------------------------------------------------#
# vim: ts=8 sw=8 noexpandtab ft=make
#-----------------------------------------------------------------------------#
TESTS_DIR = ..
THIS_DIR = misc_tests
MAYBE_J1 =
PROGS =
TESTS = \
mdemangle_test-nodepend \
pretty_print_test-nodepend
# XXX we do not yet pass mdemangle_test_hl
# (util/mdemangle.c doesn't correctly demangle internal labels)
# TESTS += mdemangle_test_hl-nodepend
include ../Mmake.common
# Module-specific options should go in Mercury.options so they
# can be found by `mmc --make'.
include Mercury.options
%.runtest: %.res ;
#-----------------------------------------------------------------------------#
MDEMANGLE = mdemangle
mdemangle_test.out: mdemangle_test.inp
$(MDEMANGLE) < mdemangle_test.inp > mdemangle_test.out 2>&1
mdemangle_test_hl.out: mdemangle_test_hl.inp
$(MDEMANGLE) < mdemangle_test_hl.inp > mdemangle_test_hl.out 2>&1
pretty_print_test.out: pretty_print_test.ugly
cp pretty_print_test.ugly pretty_print_test.out
#-----------------------------------------------------------------------------#
mdemangle_test.realclean:
rm -f mdemangle_test.out mdemangle_test.res
mdemangle_test_hl.realclean:
rm -f mdemangle_test_hl.out mdemangle_test_hl.res
pretty_print_test.realclean:
rm -f pretty_print_test.ugly pretty_print_test.out
rm -f pretty_print_test.res
clean_local: mdemangle_test.realclean pretty_print_test.realclean
#-----------------------------------------------------------------------------#