Files
mercury/tests/recompilation
Zoltan Somogyi a23ea3e151 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-11 22:28:02 +10:00
..
2020-06-11 22:28:02 +10:00

This directory contains tests for the `--smart-recompilation' option.
The output with `--verbose-recompilation' is checked to make sure
that recompilation occurs when expected.

Most of the tests consist of two modules, a main module and a module
imported from the main module. The `.1' or `.2' after
the file name is a version number.
The tests are run as follows:
	Compile the program using the `.1' versions of each module.
	Check the expected output.
	Update the imported module to version `.2'.
	Check the expected output.	
	Check that the `.err' files contain the correct
	`--verbose-recompilation' messages.

Tests with names ending in `_nr' result in no recompilation
of the main module after the change to the imported module.

Tests with names ending in `_r' should recompile the main module.

Tests with names ending in `_re' should recompile the main module,
reporting an error in the recompilation.