Commit Graph

21 Commits

Author SHA1 Message Date
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
Zoltan Somogyi
afe2887882 Remove stale references to test subdirs.
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.
2020-04-14 11:23:12 +10:00
Zoltan Somogyi
8a764392d9 Avoid warnings from make in test directories.
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.
2015-09-08 05:57:53 +10:00
Zoltan Somogyi
73f0a36719 Allow the use of -jN in many test directories.
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.
2015-02-19 06:02:45 +11:00
Zoltan Somogyi
d33273d033 Tell vim not to expand tabs in Makefiles.
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.
2015-01-08 22:07:29 +11:00
Fergus Henderson
4869a7f564 Use an MDEMANGLE variable, rather than hard-coding `mdemangle'.
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.
2002-09-12 11:41:51 +00:00
Fergus Henderson
672995c903 Add support for demangling code produced by the MLDS back-end.
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.
2002-09-05 11:37:54 +00:00
Simon Taylor
47a4d62dc1 Improve the test framework to make it easier to find out which tests
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.
2002-08-17 13:52:35 +00:00
Zoltan Somogyi
66ac848b1e If the new --test-params option is given, copy the stage 2 Mmake.params
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.
2000-04-05 06:12:04 +00:00
Mark Brown
784dc26cab Fix bugs that were stopping *.res and *.out files being cleaned up properly.
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.
1999-07-14 17:04:41 +00:00
Zoltan Somogyi
9a2a5e0d68 Explicitly specify --no-line-numbers for the pretty_print_test,
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.
1999-04-17 08:08:10 +00:00
Fergus Henderson
2dd14c4726 Delete some long obsolete references to `.mod' files.
Estimated hours taken: 0.25

tests/general/Mmakefile:
tests/hard_coded/Mmakefile:
tests/hard_coded/typeclasses/Mmakefile:
tests/misc_tests/Mmakefile:
	Delete some long obsolete references to `.mod' files.
1998-07-27 11:09:35 +00:00
Fergus Henderson
91386b16f1 Update the expected output for the pretty_print_test
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'.
1998-04-27 11:07:54 +00:00
Zoltan Somogyi
33a8e6e05a Remove .ugly files as part of the clean rule.
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.
1998-04-27 08:49:46 +00:00
Zoltan Somogyi
67d8308260 Same as previous message. 1998-04-08 11:36:13 +00:00
Fergus Henderson
ffaf587910 Tidy up the output of typeclass and instance declarations.
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.
1998-02-16 17:23:20 +00:00
Tyson Dowd
564d92c4c5 Turn off tracing tests in fast' and jump' grades.
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.
1998-02-08 08:08:21 +00:00
Zoltan Somogyi
9797aa4029 This change fixes a bug in the tracer's handling of the virtual registers
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.
1998-02-04 03:55:54 +00:00
Fergus Henderson
e71755cdcb A small bug fix: add `./' at the start of the invocation of
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.
1998-01-25 20:32:40 +00:00
Fergus Henderson
ad19f9c4e1 Add a test case for the `--generate-trace' debugger.
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.
1998-01-25 08:44:37 +00:00
Fergus Henderson
6e06050558 Rename Mmake' as Mmakefile', since using the name `Mmake'
Estimated hours taken: 0.25

*/Mmake:
	Rename `Mmake' as `Mmakefile', since using the name `Mmake'
	causes problems on case-insensitive file systems.
1997-09-29 18:05:38 +00:00