[m-dev.] for review: bootchecking the extras

Fergus Henderson fjh at cs.mu.OZ.AU
Tue Nov 21 18:09:48 AEDT 2000


On 21-Nov-2000, Zoltan Somogyi <zs at cs.mu.OZ.AU> wrote:
> Optionally test the extras directory during bootchecks.

It would be a good idea to run the tests in the samples/tests
directory too.  (This could be done as a separate change.)

> +if $extras
> +then
> +	cd $root/extras
> +	if test -f Mmake.params
> +	then
> +		mv Mmake.params Mmake.params.$$
> +	fi

It might be a good idea to use `trap' to ensure that the
extras/Mmake.params file gets restored if you interrupt a bootcheck.

> +		if test -f $testdir/Mmakefile -a ! -f $testdir/NOBOOTTEST
> +		then
> +			(cd $testdir;
> +			mmake realclean $jfactor;
> +				mmake depend    $jfactor &&
> +				mmake           $jfactor &&
> +				mmake check     $jfactor &&
> +				mmake realclean $jfactor ) ||
> +			extras_status=1

The indentation there is a bit odd.

> Index: extras/complex_numbers/Mmakefile
> ===================================================================
> RCS file: /home/mercury1/repository/mercury/extras/complex_numbers/Mmakefile,v
> retrieving revision 1.2
> diff -u -b -r1.2 Mmakefile
> --- extras/complex_numbers/Mmakefile	1998/05/29 09:08:20	1.2
> +++ extras/complex_numbers/Mmakefile	2000/11/21 00:52:01
> @@ -1,3 +1,11 @@
> +-include ../Mmake.params
> +
>  MAIN_TARGET = all
> -depend: complex_numbers.depend
> +
>  all: libcomplex_numbers
> +
> +depend:	complex_numbers.depend

I'm not sure why you reordered those two.  I think it makes more sense
for the `depend' target to be listed first, so that the order in the
Mmakefile matches the order in which the user needs to invoke them.

> +.PHONY: check
> +check:
> +	true

For extras/complex_numbers, there are tests in the `tests' subdirectory.
It would be good to run them.

However, adding stuff to the Mmakefile there to handle the dependencies,
check, clean, etc. targets for the subdirectories too would complicate
the Mmakefile quite a bit.  And this Mmakefile was intended to be an
example of how an Mmakefile can be very short.

I think the only way to preserve that is to move the sources for the
complex_number library into a subdirectory of extras/complex_numbers.
That way the Mmakefile for the library itself remains simple,
and the complex infrastructure is separate, where it belongs.

I'll do that as a separate change.  For now the code above is fine.

> +++ extras/logged_output/Mmakefile	2000/11/21 00:53:21
> +.PHONY: clean
>  depend: main.depend

That should be `.PHONY: depend'.

> +.PHONY: clean
>  clean: main.clean
> +
> +.PHONY: realclean
>  realclean: main.realclean

Those dependencies are not needed; they're added automatically by Mmake.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
                                    |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- 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