[m-rev.] for review: simplify the use of mdbrc by test cases
Peter Wang
novalazy at gmail.com
Tue Oct 26 14:42:03 AEDT 2021
On Sun, 04 Oct 2020 03:23:37 +1100 "Zoltan Somogyi" <zoltan.somogyi at runbox.com> wrote:
> For review by anyone.
>
> Zoltan.
> ZZZ
> Simplify the setup of mdbrc for tests.
>
> We used to set up *two* mdbrc files for use by test cases:
> scripts/test_mdbrc, and tests/mdbrc. Tools/bootcheck said
> the tests should use the former, while tests/Mmake.common
> said they should use the latter. This diff deletes the latter,
> and uniformly uses the former.
>
> The setup code was also scattered, with parts being done by
> the configure script, and part being done by tools/bootcheck.
> Move it all to scripts/Mmakefile, since that is the natural
> place to put code to build scripts/test_mdbrc.
>
> Mmakefile:
> Fix the action for cleaning up the tests directory.
> This started out as the reason for this whole change.
> As it happens, a *working* action for cleaning up the tests
> broke things, because it deleted an autoconfigured file
> (tests/mdbrc) that there was no rule for rebuilding.
> This issue is what required the rest of this diff.
>
> When doing "mmake clean/realclean", clean the extras as well.
>
> diff --git a/Mmakefile b/Mmakefile
> index a66838b..0dcfa8b 100644
> --- a/Mmakefile
> +++ b/Mmakefile
> @@ -929,7 +929,7 @@ bindist: WORK_IN_PROGRESS TODO
>
> #-----------------------------------------------------------------------------#
>
> -clean: clean_tests clean_subdirs
> +clean: clean_tests clean_subdirs clean_extras
>
> .PHONY: clean_subdirs
> clean_subdirs:
> @@ -941,14 +941,20 @@ clean_subdirs:
> .PHONY: clean_tests
> clean_tests:
> +if test -d tests; then \
> - (cd tests; $(SUBDIR_MMAKE) clean) \
> + (cd tests; $(MMAKE) $(MMAKEFLAGS) clean) \
> fi
Do you remember if you deliberately changed $(SUBDIR_MMAKE) to $(MMAKE)
for some reason? (here and elsewhere)
The top-level Makefile defines MMAKE as
MMAKE= MMAKE_DIR=`pwd`/scripts scripts/mmake
so "make realclean" is broken, but "mmake realclean" works.
Peter
More information about the reviews
mailing list