Scott Kruger <[email protected]> writes: >> - What’s the best way to update the test definitions after fiddling >> with /*TEST*/ blocks? It would be nice if gmakegentests.py would run >> automatically when sources are newer than their tests. > > I'll let Jed comment on this. It's not trivial with the current method > of specifying targets (gmake's lisp-like language), and even my > first pedantic implementation (explicitly writing out targets for > each test), I seem to recall it being brittle because of the global > nature of the gmakegentest.py requiring the config.
Feel free to merge this. It's basically the same pattern as how *conf/files is refreshed after makefiles are modified. commit 34ad117f2124fa30b78f1c62f487d84eadd7d6f0 (HEAD -> jed/testsrcs-refresh) Author: Jed Brown <[email protected]> Date: Tue Jan 24 16:27:58 2017 -0700 test: refresh testfiles when testsrcs change Reported-by: Tobin Isaac <[email protected]> diff --git a/gmakefile b/gmakefile index 214f37c..5292ebd 100644 --- a/gmakefile +++ b/gmakefile @@ -130,6 +130,10 @@ srcs.o := $(foreach pkg, $(pkgs), $(call concatlang,$(pkg))) testlangs := c cu cxx F F90 concattestlang = $(foreach lang, $(2), $(testsrcs-$(1).$(lang):%.$(lang)=$(TESTDIR)/%.o)) testsrcs.o := $(foreach pkg, $(pkgs), $(call concattestlang,$(pkg),$(testlangs))) +testsrcs := $(foreach pkg, $(pkgs), $(foreach lang, $(testlangs), $(testsrcs-$(pkg).$(lang)))) +# Refresh testfiles when sources change, but don't balk if the source file is nonexistent (deleted) +$(generatedtest) : $(testsrcs) +$(testsrcs) : define SHARED_RECIPE_DLL @$(RM) $@ dllcmd.${PETSC_ARCH}
signature.asc
Description: PGP signature
