svn commit: r291886 - user/ngie/make_check/share/mk

Garrett Cooper ngie at FreeBSD.org
Sun Dec 6 05:37:55 UTC 2015


Author: ngie
Date: Sun Dec  6 05:37:54 2015
New Revision: 291886
URL: https://svnweb.freebsd.org/changeset/base/291886

Log:
  - Use LOCALBASE instead of KYUA_PREFIX as it's standard in other areas of the
    tree and matches the ports(7) variable.
  - Provide an override for the directory where Kyuafile can be found.
  - Do a better job of documenting `make check`
  - Remove redundant TESTSDIR default.

Modified:
  user/ngie/make_check/share/mk/bsd.README
  user/ngie/make_check/share/mk/suite.test.mk

Modified: user/ngie/make_check/share/mk/bsd.README
==============================================================================
--- user/ngie/make_check/share/mk/bsd.README	Sun Dec  6 02:41:57 2015	(r291885)
+++ user/ngie/make_check/share/mk/bsd.README	Sun Dec  6 05:37:54 2015	(r291886)
@@ -449,13 +449,17 @@ It has seven targets:
 	all:
 		build the test programs.
 	check:
-		runs the test programs from the object directory; if the
-		Makefile does not itself define the target test, the targets
-		beforecheck and aftercheck may also be used to cause actions
-		immediately before and after the test target is executed.
+		runs the test programs from CHECKDIR with kyua test, if the
+		Makefile does not define the check target.
+
+		The beforecheck and aftercheck targets will be invoked, if
+		defined, to execute commands before and after the check
+		target has been executed, respectively.
 
 		The devel/kyua package must be installed before invoking this
 		target.
+
+		See CHECKDIR for more details.
 	clean:
 		remove the test programs and any object files.
 	cleandir:
@@ -487,6 +491,11 @@ TESTSDIR	Path to the installed tests.  M
 		${TESTSBASE}/${RELDIR:H} , e.g. /usr/tests/bin/ls when
 		included from bin/ls/tests .
 
+CHECKDIR	The value of CHECKDIR defaults to TESTSDIR when make check is
+		run from the top-level directory. Conversely, the value of
+		CHECKDIR defaults to .OBJDIR when make check is not run from
+		the top-level directory.
+
 KYUAFILE	If 'auto' (the default), generate a Kyuafile out of the
 		test programs defined in the Makefile.  If 'yes', then a
 		manually-crafted Kyuafile must be supplied with the
@@ -494,9 +503,9 @@ KYUAFILE	If 'auto' (the default), genera
 		subdirectories providing helper programs or data files
 		only).
 
-KYUA_PREFIX	The --prefix for the kyua package.
+LOCALBASE	The --prefix for the kyua package.
 
-		The value of KYUA_PREFIX defaults to /usr/local .
+		The value of LOCALBASE defaults to /usr/local .
 
 ATF_TESTS_C	The names of the ATF C test programs to build.
 

Modified: user/ngie/make_check/share/mk/suite.test.mk
==============================================================================
--- user/ngie/make_check/share/mk/suite.test.mk	Sun Dec  6 02:41:57 2015	(r291885)
+++ user/ngie/make_check/share/mk/suite.test.mk	Sun Dec  6 05:37:54 2015	(r291886)
@@ -8,10 +8,6 @@
 .error suite.test.mk cannot be included directly.
 .endif
 
-# Directory in which to install tests defined by the current Makefile.
-# Makefiles have to override this to point to a subdirectory of TESTSBASE.
-TESTSDIR?= .
-
 # Name of the test suite these tests belong to.  Should rarely be changed for
 # Makefiles built into the FreeBSD src tree.
 TESTSUITE?= FreeBSD
@@ -54,7 +50,7 @@ KYUAFILE?= auto
 # If kyua is installed from ports, we automatically define a realcheck target
 # below to run the tests using this tool.  The tools are searched for in the
 # hierarchy specified by this variable.
-KYUA_PREFIX?= /usr/local
+LOCALBASE?=	/usr/local
 
 .if ${KYUAFILE:tl} != "no"
 FILES+=	Kyuafile
@@ -88,9 +84,17 @@ Kyuafile: Makefile
 	@mv ${.TARGET}.tmp ${.TARGET}
 .endif
 
-_kyuafile=	${DESTDIR}${TESTSDIR}/Kyuafile
+CHECKDIR?=	${DESTDIR}${TESTSDIR}
 
-KYUA= ${KYUA_PREFIX}/bin/kyua
+KYUA= ${LOCALBASE}/bin/kyua
+${KYUA}:
+	@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}\""
+	@false
 
 # Definition of the "make check" target and supporting variables.
 #
@@ -102,15 +106,6 @@ KYUA= ${KYUA_PREFIX}/bin/kyua
 # are used by tests, it is highly possible for a execution of "make test" to
 # report bogus results unless the new binaries are put in place.
 
-${KYUA}:
-	@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 \$${KYUA_PREFIX} variable, e.g. "
-	@echo "KYUA_PREFIX=\"${KYUA_PREFIX}\""
-	@false
-
 realcheck: .PHONY
 realcheck: ${KYUA}
-	@${KYUA} test -k ${DESTDIR}${TESTSDIR}/Kyuafile
+	@${KYUA} test -k ${CHECKDIR}/Kyuafile


More information about the svn-src-user mailing list