diff options
| author | Kyle Evans <kevans@FreeBSD.org> | 2021-01-14 06:34:29 +0000 |
|---|---|---|
| committer | Kyle Evans <kevans@FreeBSD.org> | 2021-01-14 06:37:48 +0000 |
| commit | 986deea5b518ee5bf6b8b1486056a21819bd8bd2 (patch) | |
| tree | d68fe0c04f48b8b3d4e87da18ea61eda3f2e3369 | |
| parent | 9a01a25516367d1deeb48484d38a66137b01ebb0 (diff) | |
| download | src-986deea5b518ee5bf6b8b1486056a21819bd8bd2.tar.gz src-986deea5b518ee5bf6b8b1486056a21819bd8bd2.zip | |
build: `make check`: use a PATH search instead for Kyua
which(1) accepts both relative/absolute paths as well as lone binary
names. Set KYUA to kyua and use which(1) to confirm that it can find one;
if it cannot, just advise the user to set KYUA directly to the kyua binary
rather than assuming a relative location from LOCALBASE.
This allows `make check` to be operated with the version of kyua in base
without losing the flexibility of specifying another one.
ngie@ notes that the original intention was to avoid redundant $PATH lookups
and improve the determinism of the target. A future change will likely push
us back to this state, perhaps in the form of reverting this entirely and
just switching to using kyua in base. Accepting any in $PATH should be
considered a transitional move, at least until it's declared otherwise,
since kyua was only semi-recently added to base.
Reviewed-by: brooks, emaste, lwhsu, ngie
Differential-Revision: https://reviews.freebsd.org/D28045
| -rw-r--r-- | share/mk/suite.test.mk | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/share/mk/suite.test.mk b/share/mk/suite.test.mk index 69cd02d684de..e772ccd1b292 100644 --- a/share/mk/suite.test.mk +++ b/share/mk/suite.test.mk @@ -77,7 +77,7 @@ Kyuafile: Makefile @mv ${.TARGET}.tmp ${.TARGET} .endif -KYUA= ${LOCALBASE}/bin/kyua +KYUA?= kyua # Definition of the "make check" target and supporting variables. # @@ -90,13 +90,13 @@ KYUA= ${LOCALBASE}/bin/kyua # report bogus results unless the new binaries are put in place. realcheck: .PHONY - @if [ ! -x ${KYUA} ]; then \ + if ! which -s "${KYUA}"; then \ echo; \ echo "kyua binary not installed at expected location (${.TARGET})"; \ echo; \ echo "Please install via pkg install, or specify the path to the kyua"; \ - echo "package via the \$${LOCALBASE} variable, e.g. "; \ - echo "LOCALBASE=\"${LOCALBASE}\""; \ + echo "binary via the \$${KYUA} variable, e.g., "; \ + echo "KYUA=\"${LOCALBASE}/bin/kyua\""; \ false; \ fi @env ${TESTS_ENV:Q} ${KYUA} test -k ${DESTDIR}${TESTSDIR}/Kyuafile |
