Allow tests to provide a Kyuafile when they relied on auto-generation.

When generating a Kyuafile in the KYUAFILE=auto case, use a filename
that is unlikely to clash with the filename used by explicitly-provided
Kyuafiles.

This allows a Makefile to set KYUAFILE=yes and provide a Kyuafile in
the same directory when such Makefile was previously relying on
KYUAFILE=auto.

Fixes issues with new Kyuafiles not being picked up in NO_CLEAN builds
(although manual intervention is required once, unfortunately, as
described in UPDATING).

Reviewed by:	sjg
MFC after:	1 week
This commit is contained in:
Julio Merino 2014-01-10 10:36:14 +00:00
parent 569dfed32c
commit d7efee230d
2 changed files with 22 additions and 9 deletions

View File

@ -31,6 +31,14 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11.x IS SLOW:
disable the most expensive debugging functionality run
"ln -s 'abort:false,junk:false' /etc/malloc.conf".)
20140110:
If a Makefile in a tests/ directory was auto-generating a Kyuafile
instead of providing an explicit one, this would prevent such
Makefile from providing its own Kyuafile in the future during
NO_CLEAN builds. This has been fixed in the Makefiles but manual
intervention is needed to clean an objdir if you use NO_CLEAN:
# find /usr/obj -name Kyuafile | xargs rm -f
20131213:
The behavior of gss_pseudo_random() for the krb5 mechanism
has changed, for applications requesting a longer random string

View File

@ -79,14 +79,20 @@ WITHOUT_MAN=yes
PROG_VARS+= BINDIR
PROGS_TARGETS+= install
.if ${KYUAFILE:tl} != "no"
.if ${KYUAFILE:tl} == "yes"
FILES+= Kyuafile
FILESDIR_Kyuafile= ${TESTSDIR}
.if ${KYUAFILE:tl} == "auto"
CLEANFILES+= Kyuafile Kyuafile.tmp
CLEANFILES+= Kyuafile.auto Kyuafile.auto.tmp
.elif ${KYUAFILE:tl} == "auto"
FILES+= Kyuafile.auto
FILESDIR_Kyuafile.auto= ${TESTSDIR}
FILESNAME_Kyuafile.auto= Kyuafile
Kyuafile: Makefile
CLEANFILES+= Kyuafile.auto Kyuafile.auto.tmp
.NOPATH: Kyuafile.auto
Kyuafile.auto: Makefile
@{ \
echo '-- Automatically generated by bsd.test.mk.'; \
echo; \
@ -94,16 +100,15 @@ Kyuafile: Makefile
echo; \
echo 'test_suite("${TESTSUITE}")'; \
echo; \
} >Kyuafile.tmp
} >Kyuafile.auto.tmp
.for _T in ${_TESTS}
@echo "${TEST_INTERFACE.${_T}}_test_program{name=\"${_T}\"}" \
>>Kyuafile.tmp
>>Kyuafile.auto.tmp
.endfor
.for _T in ${TESTS_SUBDIRS:N.WAIT}
@echo "include(\"${_T}/Kyuafile\")" >>Kyuafile.tmp
@echo "include(\"${_T}/Kyuafile\")" >>Kyuafile.auto.tmp
.endfor
@mv Kyuafile.tmp Kyuafile
.endif
@mv Kyuafile.auto.tmp Kyuafile.auto
.endif
KYUA?= ${KYUA_PREFIX}/bin/kyua