[m-rev.] for review: test case for --lib-linkage option

Julien Fischer juliensf at cs.mu.OZ.AU
Wed Jan 11 16:14:44 AEDT 2006


On Wed, 11 Jan 2006, Peter Wang wrote:

> Estimated hours taken: 2
> Branches: main
>
> tests/mmc_make/Mercury.options:
> tests/mmc_make/Mmakefile:
> tests/mmc_make/linkage_test.exp:
> tests/mmc_make/linkage_test.m:
> tests/mmc_make/lib/linkage_test2.m:
> 	Add a test case for the new `--lib-linkage' option to `mmc --make'.
>
> 	Fix an existing test case (complex_test) in the same directory.  It was
> 	looking for the file `../TESTS_FLAGS' while in the directory
> 	`tests/mmc_make/lib', which doesn't exist.  The workaround used is to
> 	symlink or copy `tests/TESTS_FLAGS' into `tests/mmc_make/TESTS_FLAGS'
> 	as necessary.
>
> Index: tests/mmc_make/Mercury.options
> ===================================================================
> RCS file: /home/mercury1/repository/tests/mmc_make/Mercury.options,v
> retrieving revision 1.1
> diff -u -r1.1 Mercury.options
> --- tests/mmc_make/Mercury.options	23 Jan 2003 00:24:17 -0000	1.1
> +++ tests/mmc_make/Mercury.options	11 Jan 2006 04:26:12 -0000
> @@ -1,4 +1,6 @@
>  LIB_DIRS = install/lib/mercury
> -LIBRARIES-complex_test = complex_numbers
>
> +LIBRARIES-complex_test = complex_numbers
>  MCFLAGS-complex_test = --linkage shared
> +
> +LIBRARIES-linkage_test = linkage_test2
> Index: tests/mmc_make/Mmakefile
> ===================================================================
> RCS file: /home/mercury1/repository/tests/mmc_make/Mmakefile,v
> retrieving revision 1.3
> diff -u -r1.3 Mmakefile
> --- tests/mmc_make/Mmakefile	23 Sep 2003 02:33:12 -0000	1.3
> +++ tests/mmc_make/Mmakefile	11 Jan 2006 04:31:52 -0000
> @@ -11,6 +11,7 @@
>  PROGS =	\
>  		complex_test \
>  		hello \
> +		linkage_test \
>  		rebuild
>
>  # These tests only work if the workspace was compiled with `--use-subdirs'.
> @@ -29,6 +30,8 @@
>
>  complex_test.log: install_libs
>
> +linkage_test.log: install_libs_linkage_test2
> +
>  # Just test that the executable is rebuilt.
>  rebuild.runtest:
>  	$(MCM) --rebuild rebuild
> @@ -39,10 +42,23 @@
>  build_object.runtest: build_object.o
>
>  .PHONY: install_libs
> -install_libs: start_runtests_local
> -	cd lib; \
> +install_libs: TESTS_FLAGS start_runtests_local
> +	( cd lib; \
> +	$(MCM) --no-libgrade --install-prefix $(shell pwd)/install \
> +			libcomplex_numbers.install ) \
> +	|| touch complex_test.failed
> +
> +.PHONY: install_libs_linkage_test2
> +install_libs_linkage_test2: TESTS_FLAGS start_runtests_local
> +	( cd lib; \
>  	$(MCM) --no-libgrade --install-prefix $(shell pwd)/install \
> -			libcomplex_numbers.install
> +			liblinkage_test2.install --lib-linkage static ) \
> +	|| touch linkage_test.failed
> +
> +# Copy/symlink TESTS_FLAGS into the current directory for when
> +# we change into the `lib' subdirectory.
> +TESTS_FLAGS: ../TESTS_FLAGS
> +	ln -s $< $@ || cp $< $@
>

Do you need to delete this copy/symlink when doing a realclean?

Otherwise that looks fine.

Cheers,
Julien.
--------------------------------------------------------------------------
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