Add support for TEST_METADATA
Allow Makefiles to define generic metadata settings that apply to all test programs defined by a Makefile. The generic TEST_METADATA variable extends the per-test program settings already supported via TEST_METADATA.<program>. This feature will be useful to easily apply some settings to all programs in a directory. In particular, Kyua 0.12 will support parallel execution of test programs and a bunch of them will need to be tagged as is_exclusive to indicate that they cannot be run in parallel with anything else due to their side-effects. It will be reasonable to set this setting on whole directories. MFC after: 1 week
This commit is contained in:
parent
7eba87cee9
commit
6e2b0363ca
@ -34,12 +34,19 @@ KYUAFILE?= auto
|
|||||||
# Kyua as this is later encoded in the Kyuafile test program definitions.
|
# Kyua as this is later encoded in the Kyuafile test program definitions.
|
||||||
#TEST_INTERFACE.<test-program>= interface-name
|
#TEST_INTERFACE.<test-program>= interface-name
|
||||||
|
|
||||||
|
# Metadata properties applicable to all test programs.
|
||||||
|
#
|
||||||
|
# All the variables for a test program defined in the Makefile are appended
|
||||||
|
# to the test 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"
|
||||||
|
|
||||||
# Per-test program metadata properties as a list of key/value pairs.
|
# 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
|
# These per-test program settings _extend_ the values provided in the
|
||||||
# definition in the Kyuafile. This feature can be used to avoid having to
|
# unqualified TEST_METADATA variable.
|
||||||
# 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"
|
#TEST_METADATA.<test-program>+= key="value"
|
||||||
|
|
||||||
# Path to the prefix of the installed Kyua CLI, if any.
|
# Path to the prefix of the installed Kyua CLI, if any.
|
||||||
@ -61,6 +68,10 @@ FILESNAME_Kyuafile.auto= Kyuafile
|
|||||||
|
|
||||||
CLEANFILES+= Kyuafile.auto Kyuafile.auto.tmp
|
CLEANFILES+= Kyuafile.auto Kyuafile.auto.tmp
|
||||||
|
|
||||||
|
.for _T in ${_TESTS}
|
||||||
|
_TEST_METADATA.${_T}= ${TEST_METADATA} ${TEST_METADATA.${_T}}
|
||||||
|
.endfor
|
||||||
|
|
||||||
.NOPATH: Kyuafile.auto
|
.NOPATH: Kyuafile.auto
|
||||||
Kyuafile.auto: Makefile
|
Kyuafile.auto: Makefile
|
||||||
@{ \
|
@{ \
|
||||||
@ -72,7 +83,7 @@ Kyuafile.auto: Makefile
|
|||||||
echo; \
|
echo; \
|
||||||
} >Kyuafile.auto.tmp
|
} >Kyuafile.auto.tmp
|
||||||
.for _T in ${_TESTS}
|
.for _T in ${_TESTS}
|
||||||
@echo '${TEST_INTERFACE.${_T}}_test_program{name="${_T}"${TEST_METADATA.${_T}:C/$/,/:tW:C/^/, /W:C/,$//W}}' \
|
@echo '${TEST_INTERFACE.${_T}}_test_program{name="${_T}"${_TEST_METADATA.${_T}:C/$/,/:tW:C/^/, /W:C/,$//W}}' \
|
||||||
>>Kyuafile.auto.tmp
|
>>Kyuafile.auto.tmp
|
||||||
.endfor
|
.endfor
|
||||||
.for _T in ${TESTS_SUBDIRS:N.WAIT}
|
.for _T in ${TESTS_SUBDIRS:N.WAIT}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user