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 = .."
A long time ago, test directories such as hard_coded had subdirectories
such as hard_coded/typeclasses. These have since been flattened out
(e.g. hard_coded/typeclasses is now just typeclasses), but there were
still remnants of the old approach. This diff deletes those remnants.
tests/*/Mmakefile:
Delete the TESTS_DIR and the SUBDIRS mmake variables; TESTS_DIR
was always set to "..", and SUBDIRS to the empty string.
Delete any references to the make variable NOT_WORKING, since
it is never used.
tests/Mmake.common:
Document that Mmakefiles in test directories don't have to set
TESTS_DIR and SUBDIRS anymore. Fix the formatting of the documentation
of the make variables they do still have to set.
Delete the targets and actions for handling subdirectories of
test directories, since there aren't any.
tests/Mmakefile:
Simplify some code.
tests/Mmake.common:
Don't invoke any actions in the clean_local and realclean_local
targets, since if using mmc --make, the builtin mmake rules
have actions for those targets as well, and make can't handle
more than one action for a target having actions. Replace those
actions with dependencies on other, unique targets that have
the actions instead.
tests/*/Mmakefile:
Avoid actions in clean_local and realclean_local targets the same way.
Sort the test names in some directories that didn't already do so.
Delete some obsolete comments.
Fix style.
tests/valid/Mmake.valid.common:
As for the Mmakefiles above, and also move the definition of a make
variable before it is needed.
tests/Mmake.common:
Replace the -j1 in the runtests_local target used by all the test
directories with $(MAYBE_J1).
tests/*/Mmakefile:
Define MAYBE_J1 it as the empty string in test directories in which
different tests don't share source files.
Define MAYBE_J1 as -j1 in test directories in which
different tests do share source files.
tests/submodules/sub2_a.m:
Add this copy of sub_a.m to allow tests in the submodules directory
to be done in parallel.
tests/submodules/accessibility2.m:
Import sub2_a.m instead of sub_a.m.
tests/warnings/ambig_types_high_level.m:
Add this copy of ambig_types.m to allow tests in the warnings directory
to be done in parallel.
tests/warnings/ambig_high_level.m:
Import ambig_types_high_level.m instead of ambig_types.m.
This file-specific setting will override a default setting of expandtabs
in $HOME/.vimrc.
*/Makefile:
*/Mmakefile:
As above.
tests/hard_coded/.gitignore:
Don't ignore the purity subdir. This ignore must have been left over
from when purity.m was a test in hard_coded, not hard_coded/purity,
and it ignored an executable, not a directory.
Estimated hours taken: 0.1
Branches: main
tests/misc_tests/Mmakefile:
Use an MDEMANGLE variable, rather than hard-coding `mdemangle'.
This makes it easier to run the tests using profiler/demangle_test
rather than util/mdemangle.
Estimated hours taken: 16
Branches: main
util/mdemangle.c:
profiler/demangle.m:
Add support for demangling code produced by the MLDS back-end.
XXX util/mdemangle.c it doesn't handle internal labels yet
tests/misc_tests/Mmakefile:
tests/misc_tests/mdemangle_test_hl.inp:
tests/misc_tests/mdemangle_test_hl.exp:
Add a test case.
The test is not enabled, since we don't yet pass it;
demangling works OK for many cases, but fails
for cases involving internal labels.
Estimated hours taken: 30
Branches: main
Improve the test framework to make it easier to find out which tests
failed and to reduce disk usage (important in debug grades).
Allow the tests to be run with `mmc --make' (still some failures).
Allow the user to run only the failing tests from a previous
run by using `mmake ERROR_FILE=runtests.errs', where runtests.errs
is the log file from the previous run.
tests/Mmake.common:
tests/*/Mmakefile:
Move common code (such as the code to deal with subdirectories)
to Mmake.common.
Run the tests using `mmake runtests' rather than using slightly
different runtests scripts in each directory.
Add to the output from `mmake runtests' to make it easier to
identify which tests failed in which grades.
Move per-module options into Mercury.options files so they
can be read by `mmc --make'.
Remove the last of the NU-Prolog support.
Consistently use the main module name when listing tests.
Some directories (e.g. invalid) were using the source file
name.
tests/process_log.awk:
Collect the parts of the output relating to failing tests.
tests/generate_exp:
tests/handle_options:
tests/subdir_runtests:
tests/startup:
tests/shutdown:
tests/*/runtests:
tests/recompilation/TESTS:
Removed.
tests/recompilation/test_functions:
Make sure the old result file is removed before starting
each test.
Put the mmake output for tests which are supposed to fail
into a different file for each test.
tests/warnings/Mmakefile:
Use %.c rather than $(cs_subdir)%.c in a rule.
The $(cs_subdir) part doesn't work with `mmc --make',
and isn't necessary any more (modules.m generates a rule
`module.c: $(cs_subdir)module.c').
tests/README:
Updated.
tools/bootcheck:
tools/test_mercury:
Use `mmake runtests' instead of the `runtests' script.
Add a `-f' (`--failing-tests') option to bootcheck which
runs only the failing tests from the last run.
tools/test_mercury:
tools/run_all_tests_from_cron:
Use the new framework to summarize test failures.
Estimated hours taken: 1
tools/bootcheck:
If the new --test-params option is given, copy the stage 2 Mmake.params
file to the tests directory. This capability is required to test
changes such as compiling the library without special preds and
the test cases with special preds. You get a lot of spurious errors
if a test case assumes that since it was compiled with special
preds, all other modules it is linked with are also compiled with
special preds, and thus makes calls to non-existent special preds
for the types defined in the library.
tests/*/Mmakefile:
tests/*/*/Mmakefile:
Include Mmake.params from the top level tests directory if it exists.
Estimated hours taken: 0.5
Fix bugs that were stopping *.res and *.out files being cleaned up properly.
tests/Mmake.common:
tests/general/accumulator/Mmakefile:
tests/invalid/Mmakefile:
tests/misc_tests/Mmakefile:
tests/tabling/Mmakefile:
tests/term/Mmakefile:
tests/valid/Mmakefile:
tests/warnings/Mmakefile:
Make cleaning tasks depend on (real)clean_local rather than
(real)clean. This is because tests/startup and tests/shutdown
use the *_local targets.
tests/general/Mmakefile:
Fix bugs in the recursive mmake calls.
Estimated hours taken: 0.2
tests/misc_tests/Mmakefile:
Explicitly specify --no-line-numbers for the pretty_print_test,
since my recent change made --line-numbers the default.
Estimated hours taken: 0.5
tests/misc_tests/Mmakefile:
tests/misc_tests/pretty_print_test.exp:
Update the expected output for the pretty_print_test
test case to reflect the actual output, and re-enable
that test case. Arguably the extra parentheses in
the output are undesirable, but they're needed to
protect against the parser getting confused by
the relative precedence of `:' and `/' for
module-qualified symbols (e.g. in `.int' files).
Also arguably the precedence of `:' is wrong,
but it's probably not worth fixing this now since
we plan to replace `:' with `.'.
Also change the rule for `clean_ugly' to avoid hard-coding
the path name `/bin/rm' and to instead use just `rm'.
In some environments (e.g. Windows with gnu-win32),
`rm' might not be in `/bin'.
Estimated hours taken: 2
Mmakefile:
Remove .ugly files as part of the clean rule. Without this,
the .ugly file does not get remade, and the test is useless
(it does not invoke the compiler at all).
Temporarily disable the test (pretty_print_test) that uses a
.ugly file, since it does not work.
Estimated hours taken: 1.5
compiler/mercury_to_mercury.m:
Tidy up the output of typeclass and instance declarations.
Previously there were a number of minor problems (instance
declarations not implemented, unnecessary parentheses,
newlines in wrong places).
tests/misc_tests/Mmakefile:
tests/misc_tests/pretty_print_test.m:
tests/misc_tests/pretty_print_test.exp:
Add a test case for pretty-printing.
Estimated hours taken: 0.5
tests/misc_tests/Mmakefile:
Turn off tracing tests in `fast' and `jump' grades. The
stack_layouts they rely on don't yet work in these grades.
Estimated hours taken: 1.5
This change fixes a bug in the tracer's handling of the virtual registers
that are not real registers.
runtime/mercury_regs.h:
Make the saved_reg macro refer only to the given save area,
not to the machine registers or to the fake_reg array.
runtime/mercury_trace.c:
Make sure we save both real and fake registers in the save area.
Make the internal functions and variables static, and make sure
everything is prefixed by MR_. Use string concatenation in several
places to make the code shorter.
tests/misc_tests/debugger_regs.{m,inp,exp}:
A regression test case to make sure the tracer is handling high
register numbers properly.
Estimated hours taken: 0.1
tests/misc_tests/Mmakefile:
A small bug fix: add `./' at the start of the invocation of
debugger_test, so that it works even if you don't have `.'
in your PATH.
Estimated hours taken: 0.5
tests/misc_tests/Mmakefile:
tests/misc_tests/debugger_test.m:
tests/misc_tests/debugger_test.inp:
tests/misc_tests/debugger_test.exp:
Add a test case for the `--generate-trace' debugger.