[petsc-dev] Introducing new "test harness" to PETSc

Jed Brown jed at jedbrown.org
Tue Jan 24 17:32:32 CST 2017


Scott Kruger <kruger at txcorp.com> 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 <jed at jedbrown.org>
Date:   Tue Jan 24 16:27:58 2017 -0700

    test: refresh testfiles when testsrcs change

    Reported-by: Tobin Isaac <tisaac at uchicago.edu>

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}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 800 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20170124/9eba27a6/attachment.sig>


More information about the petsc-dev mailing list