[m-dev.] for review: uniform interface to tests

Fergus Henderson fjh at cs.mu.OZ.AU
Wed Jul 7 22:57:01 AEST 1999


On 07-Jul-1999, Mark Anthony BROWN <dougl at cs.mu.OZ.AU> wrote:
> Provide a more uniform interface to the test directories.  Before this
> change, the tests directory as well as direct descendents had `runtests'
> scripts to execute the tests.  These would run `mmake', which in turn
> would recursively run `mmake' in any subdirectories.  The subdirectories
> did not have their own `runtests' scripts.
> 
> This change adds a `runtests' script to those subdirectories that did
> not have them before.  The scripts have the same meaning as they did
> previously---run all tests in the current directory and below, and
> return a status of 0 only if all tests pass.  However, the Mmake
> targets 'check', 'dep', 'depend', 'realclean', 'clean' and 'all'  now
> work in the current directory only.  The targets that also invoke Mmake
> recursively in subdirectories are now called `check_subdirs',
> `dep_subdirs', etc.
> 
> The rationale for this change is so that each directory in the tests
> is treated the same, regardless of whether it is a top-level
> directory or not.  This means, for example, that any test directory can
> be used as an argument to the `--test-dir' option to tools/bootcheck.

I thought about this a bit more.  I think it would be better if the targets
`check', `dep', etc. were always recursive, for consistency with the way
that most people structure their Makefiles, and with the way our top-level
Makefile is structured, and with the way that `cvs' works.

Instead of changing the semantics of these targets, I think it would be
better to add new targets `check_local', `dep_local', etc.  that acted
only on the directory itself, not on subdirs.  This is analogous with
the "local directory only" option (`-l') to cvs.  It also satisfies the
goal you mentioned above of treating each directory the same, regardless
of whether it is a top-level directory or not.

With this scheme you would have e.g.

	.PHONY: foo
	foo: foo_local foo_subdirs

	.PHONY: foo_local
	foo_local:
		...

	.PHONY: foo_subdirs
	foo_subdirs:
		...

and each directory's runtests would invoke the runtests in the subdirs,
if any, and then do `mmake check_local'.

> tests/subdir_runtests:
>       New script to recursively call runtests scripts in subdirectories.

The log message should say that most of the code for this script originally
came from tests/runtests.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>  |  of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3        |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list