From 8c465f5880b30943dc1b43ecb745ba28f22137e7 Mon Sep 17 00:00:00 2001 From: Julio Merino Date: Tue, 14 Jan 2014 18:32:47 +0000 Subject: [PATCH] Support defining test program metadata from the Makefiles. Introduce a new, per-test-program TEST_METADATA. variable that contains a list of key/value paris describing metadata properties for that test program. These properties are later written into the auto-generated Kyuafile when using the KYUAFILE=auto functionality. This is to avoid having to supply hand-crafted Kyuafiles when the needs for metadata overrides are trivial. While doing this, and because I am documenting TEST_METADATA, take the chance to document the TEST_INTERFACE setting as well. MFC after: 5 days --- share/mk/bsd.test.mk | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/share/mk/bsd.test.mk b/share/mk/bsd.test.mk index 01d74b53890..ee96f77a029 100644 --- a/share/mk/bsd.test.mk +++ b/share/mk/bsd.test.mk @@ -41,6 +41,20 @@ TESTS_SUBDIRS?= # If 'no', no Kyuafile is installed. KYUAFILE?= auto +# Per-test program interface definition. +# +# The name provided here must match one of the interface names supported by +# Kyua as this is later encoded in the Kyuafile test program definitions. +#TEST_INTERFACE.= interface-name + +# Per-test program metadata properties as a list of key/value pairs. +# +# All the variables for a particular program are appended to the program's +# definition in the Kyuafile. This feature can be used to avoid having to +# explicitly supply a Kyuafile in the source directory, allowing the caller +# Makefile to rely on the KYUAFILE=auto behavior defined here. +#TEST_METADATA.+= key="value" + # List of variables to pass to the tests at run-time via the environment. TESTS_ENV?= @@ -102,7 +116,7 @@ Kyuafile.auto: Makefile echo; \ } >Kyuafile.auto.tmp .for _T in ${_TESTS} - @echo "${TEST_INTERFACE.${_T}}_test_program{name=\"${_T}\"}" \ + @echo '${TEST_INTERFACE.${_T}}_test_program{name="${_T}"${TEST_METADATA.${_T}:C/$/,/:tW:C/^/, /W:C/,$//W}}' \ >>Kyuafile.auto.tmp .endfor .for _T in ${TESTS_SUBDIRS:N.WAIT}