[m-rev.] for review: improve test framework

Fergus Henderson fjh at cs.mu.OZ.AU
Thu Aug 15 19:14:33 AEST 2002


On 15-Aug-2002, Zoltan Somogyi <zs at cs.mu.OZ.AU> wrote:
> On 15-Aug-2002, Fergus Henderson <fjh at cs.mu.OZ.AU> wrote:
> > > In think one of the problems with the current system is that you can't run the
> > > tests in e.g. the hard_coded directory without also running the tests in the
> > > hard_coded/exceptions, hard_coded/purity, hard_coded/sub-modules and
> > > hard_coded/typeclasses directories.
> > 
> > Sure you can.
> > 
> > 	cd hard_coded
> > 	mmake depend_local
> > 	mmake check_local
> 
> I meant from bootcheck. The three lines above don't set up the environment
> variables right.

For that, I generally use a command such as the following:

	mmake MC="mymc ceres2" ML="myml ceres2" check_local

Here "mymc" and "myml" are scripts that run mmc and ml with the
environment set up for the specified workspace (i.e. in this
case ~/ws/ceres2).  These are trivial scripts which just set
the WORKSPACE environment variable and then invoke lmc or lml
respectively:

	#!/bin/sh
	# Usage: mymc <workspace>
	WORKSPACE=$HOME/ws/$1
	export WORKSPACE
	shift
	exec $WORKSPACE/tools/lmc "$@"

	#!/bin/sh
	# Usage: myml <workspace>
	WORKSPACE=$HOME/ws/$1
	export WORKSPACE
	shift
	$WORKSPACE/tools/lml "$@"

Alternatively, you could just set WORKSPACE manually, i.e.

	export WORKSPACE=~/ws/ceres2
	export PATH=$WORKSPACE/tools:$PATH
	mmake MC=lmc ML=lml check_local

but this is a trifle more tedious.

Hmm... I see that I have not yet gotten around to committing `lml' into our
repository.  I will do so.

> > > I think it would be simpler as well as more flexible if we listed all the
> > > directories containing test cases in the top level tests directory,
> > > regardless of whether they are direct or indirect subdirectories of the tests
> > > directory.
> > 
> > That would mean there was no way to say "run all the tests in this
> > directory and any of its subdirectories".
> 
> Two different options in bootcheck, one saying "execute the tests in this
> directory only" and one saying "execute the tests in this directory and its
> subdirectories" should be easy enough to arrange,

That would be fine with me.

> and so would "mmake check_local_and_subdirs".

We already have that, although it is spelt as just "mmake check",
because that's the name specified in the GNU coding guidelines.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list