Support defining test program metadata from the Makefiles.

Introduce a new, per-test-program TEST_METADATA.<program> 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
This commit is contained in:
Julio Merino 2014-01-14 18:32:47 +00:00
parent 8af981a406
commit 8c465f5880
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=260632

View File

@ -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.<test-program>= 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.<test-program>+= 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}