Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 19 Apr 2013 23:17:50 -0700
From:      Garrett Cooper <yaneurabeya@gmail.com>
To:        arch@FreeBSD.org, toolchain@FreeBSD.org
Cc:        "Simon J. Gerraty" <sjg@juniper.net>
Subject:   [RFC] [Optionally] build tests with buildworld
Message-ID:  <CAGHfRMCTRM4sFS09jLp3DegJ5U0xujHmaw0YuAW1JTOuTqHGaw@mail.gmail.com>

next in thread | raw e-mail | index | archive | help

[-- Attachment #1 --]
Hi arch@ and toolchain@,
    One of the items that I'm proposing be added to Makefile.inc1 in
order to make building and installing tests on CURRENT (ATF and
otherwise) is a build knob called TESTS_WITH_WORLD (the name can be
modified), which allows me to build and install various tests on my
git branch like the example ATF tests I produced, pjdfstest, some of
the prove tests from tools/regression, etc (there are other
outstanding changes, but this was the key one that I need feedback on
just to be safe).
    The effective change is attached (Gmail will no doubt mangle it,
so please let me know if you want another copy). I made the change to
Makefile.inc1 in order to ensure that the change was self-contained
and because it was the simplest, cleanest way to do things without
introducing a lot of unwanted complexity.
    I'm asking for feedback on the following items:
    1. Does the change make functional sense? If not, why?
    2. Do the semantics (variable names, whether or not they're
defined) need to be modified to match MK_* semantics or be made more
consistent in any particular way? If so, why?
    3. Will anyone have serious heartburn (already have a similar
change implemented, think it's done in a backwards manner) if this
change is implemented? If so, why?
Thanks!
-Garrett

PS Please CC me on all replies as I'm not subscribed to the list.

[-- Attachment #2 --]
Index: Makefile.inc1
===================================================================
--- Makefile.inc1	(revision 249665)
+++ Makefile.inc1	(working copy)
@@ -91,6 +91,11 @@
 .if ${MK_OFED} != "no"
 SUBDIR+=contrib/ofed
 .endif
+.if defined(.PARSEDIR) # bsd.test.mk doesn't work with !bmake
+.if defined(TESTS_WITH_WORLD)
+SUBDIR+=tests
+.endif
+.endif
 #
 # We must do etc/ last for install/distribute to work.
 #
@@ -277,6 +282,13 @@
 		VERSION="${VERSION}" \
 		INSTALL="sh ${.CURDIR}/tools/install.sh" \
 		PATH=${TMPPATH}
+
+# make hierarchy
+HMAKE=		${MAKE} LOCAL_MTREE=${LOCAL_MTREE}
+.if defined(NO_ROOT)
+HMAKE+=		METALOG=${METALOG} -DNO_ROOT
+.endif
+
 .if ${MK_CDDL} == "no"
 WMAKEENV+=	NO_CTF=1
 .endif
@@ -378,6 +390,14 @@
 IMAKE_MTREE=	MTREE_CMD="nmtree ${MTREEFLAGS}"
 .endif
 
+.if defined(.PARSEDIR) # bsd.test.mk doesn't work with !bmake
+.if defined(TESTS_WITH_WORLD) && !defined(NO_TESTS)
+HMAKE+=		-DWITH_TESTS
+IMAKE+=		-DWITH_TESTS
+WMAKE+=		-DWITH_TESTS
+.endif
+.endif
+
 # kernel stage
 KMAKEENV=	${WMAKEENV}
 KMAKE=		${KMAKEENV} ${MAKE} ${.MAKEFLAGS} ${KERNEL_FLAGS} KERNEL=${INSTKERNNAME}
@@ -488,8 +508,9 @@
 	@echo ">>> stage 4.2: building libraries"
 	@echo "--------------------------------------------------------------"
 	${_+_}cd ${.CURDIR}; \
-	    ${WMAKE} -DNO_FSCHG -DWITHOUT_HTML -DWITHOUT_INFO -DNO_LINT \
-	    -DWITHOUT_MAN -DNO_PROFILE libraries
+	    ${WMAKE:N-DWITH_TESTS} \
+	    -DNO_FSCHG -DWITHOUT_HTML -DWITHOUT_INFO -DNO_LINT \
+	    -DWITHOUT_MAN -DNO_PROFILE -DNO_TESTS libraries
 _depend:
 	@echo
 	@echo "--------------------------------------------------------------"
@@ -1320,12 +1341,7 @@
 # hierarchy - ensure that all the needed directories are present
 #
 hierarchy hier:
-.if defined(NO_ROOT)
-	cd ${.CURDIR}/etc; ${MAKE} LOCAL_MTREE=${LOCAL_MTREE} \
-	    -DNO_ROOT METALOG=${METALOG} distrib-dirs
-.else
-	cd ${.CURDIR}/etc; ${MAKE} LOCAL_MTREE=${LOCAL_MTREE} distrib-dirs
-.endif
+	cd ${.CURDIR}/etc && ${HMAKE} distrib-dirs
 
 #
 # libraries - build all libraries, and install them under ${DESTDIR}.

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAGHfRMCTRM4sFS09jLp3DegJ5U0xujHmaw0YuAW1JTOuTqHGaw>