From e55bc1f0d75eb16747c8ed900a2b4bf9a08a0f6f Mon Sep 17 00:00:00 2001 From: ngie Date: Tue, 9 Sep 2014 04:00:30 +0000 Subject: MFC r267176, r267181, r268445 (ATF-related commits): Phabric: https://reviews.freebsd.org/D706 Approved by: rpaulo (mentor) Approved by: re (gjb) Reviewed by: jmmv Sponsored by: EMC / Isilon Storage Division r267176: Add the *_TESTS_SH_SED_* functionality to atf.test.mk. This exists already in plain.test.mk and tap.test.mk and should have been added to atf.test.mk too when the feature was first introduced. (It is probably time to address the related TODOs but I will do that separately.) r267181: Move atf-sh from /usr/bin/ to /usr/libexec/ In r266650, we made libatf-c and libatf-c++ private libraries so that no components outside of the source tree could unintendedly depend on them. This change does the same for the "atf-sh library" by moving the atf-sh interpreter from its public location in /usr/bin/ to the private location in /usr/libexec/. Our build system will ensure that our own test programs use the right binary, but users won't be able to depend on atf-sh by "mistake". Committing this now to ride the UPDATING notice added with r267172 today. r268445: Fix atf-sh's integration_test With the move of atf-sh into /usr/libexec in r267181, some of the tests in the integration_test program broke because they could not execute atf-sh from the path any longer. This slipped through because I do have a local atf installation in my home directory that appears in my path, hence the tests could still execute my own version. Fix this by forcing /usr/libexec to appear at the beginning of the path when attempting to execute atf-sh. To make upgrading easy (and to avoid an unnecessary entry in UPDATING), make integration_test depend on the Makefile so that a rebuild of the shell script is triggered. This requires a hack in the *.test.mk files to ensure the Makefile is not treated as a source to the generated program. Ugly, I know, but I don't have a better way of doing this at the moment. Will think of one once I address the TODO in the *.test.mk files that suggests generalizing the file generation functionality. PR: 191052 Reviewed by: Garrett Cooper --- share/mk/atf.test.mk | 9 +++++++-- share/mk/plain.test.mk | 3 ++- share/mk/tap.test.mk | 2 +- 3 files changed, 10 insertions(+), 4 deletions(-) (limited to 'share') diff --git a/share/mk/atf.test.mk b/share/mk/atf.test.mk index c82557c..f7d66bf 100644 --- a/share/mk/atf.test.mk +++ b/share/mk/atf.test.mk @@ -98,10 +98,15 @@ _TESTS+= ${ATF_TESTS_SH} SCRIPTSDIR_${_T}= ${TESTSDIR} TEST_INTERFACE.${_T}= atf CLEANFILES+= ${_T} ${_T}.tmp +# TODO(jmmv): It seems to me that this SED and SRC functionality should +# exist in bsd.prog.mk along the support for SCRIPTS. Move it there if +# this proves to be useful within the tests. +ATF_TESTS_SH_SED_${_T}?= # empty ATF_TESTS_SH_SRC_${_T}?= ${_T}.sh ${_T}: ${ATF_TESTS_SH_SRC_${_T}} - echo '#! /usr/bin/atf-sh' > ${.TARGET}.tmp - cat ${.ALLSRC} >> ${.TARGET}.tmp + echo '#! /usr/libexec/atf-sh' > ${.TARGET}.tmp + cat ${.ALLSRC:N*Makefile*} \ + | sed ${ATF_TESTS_SH_SED_${_T}} >>${.TARGET}.tmp chmod +x ${.TARGET}.tmp mv ${.TARGET}.tmp ${.TARGET} .endfor diff --git a/share/mk/plain.test.mk b/share/mk/plain.test.mk index 99685ef..f26bab3 100644 --- a/share/mk/plain.test.mk +++ b/share/mk/plain.test.mk @@ -57,7 +57,8 @@ CLEANFILES+= ${_T} ${_T}.tmp PLAIN_TESTS_SH_SED_${_T}?= # empty PLAIN_TESTS_SH_SRC_${_T}?= ${_T}.sh ${_T}: ${PLAIN_TESTS_SH_SRC_${_T}} - cat ${.ALLSRC} | sed ${PLAIN_TESTS_SH_SED_${_T}} >${.TARGET}.tmp + cat ${.ALLSRC:N*Makefile*} \ + | sed ${PLAIN_TESTS_SH_SED_${_T}} >${.TARGET}.tmp chmod +x ${.TARGET}.tmp mv ${.TARGET}.tmp ${.TARGET} .endfor diff --git a/share/mk/tap.test.mk b/share/mk/tap.test.mk index 4c05661..058ebdf 100644 --- a/share/mk/tap.test.mk +++ b/share/mk/tap.test.mk @@ -66,7 +66,7 @@ TAP_TESTS_PERL_SRC_${_T}?= ${_T}.pl ${_T}: ${TAP_TESTS_PERL_SRC_${_T}} { \ echo '#! ${TAP_PERL_INTERPRETER}'; \ - cat ${.ALLSRC} | sed ${TAP_TESTS_PERL_SED_${_T}}; \ + cat ${.ALLSRC:N*Makefile*} | sed ${TAP_TESTS_PERL_SED_${_T}}; \ } >${.TARGET}.tmp chmod +x ${.TARGET}.tmp mv ${.TARGET}.tmp ${.TARGET} -- cgit v1.1