Skip to content

Commit

Permalink
Add supporting changes for `Add limited sandbox capability to "make c…
Browse files Browse the repository at this point in the history
…heck"`

Non-tests/... changes:
- Add HAS_TESTS= to Makefiles with libraries and programs to enable iteration
  and propagate the appropriate environment down to *.test.mk.

tests/... changes:
- Add appropriate support Makefile.inc's to set HAS_TESTS in a minimal manner,
  since tests/... is a special subdirectory tree compared to the others.

MFC after:	2 months
MFC with:	r322511
Reviewed by:	arch (silence), testing (silence)
Differential Revision:	D12014
  • Loading branch information
ngie-eign committed Aug 14, 2017
2 parents d42d7dc + dabaa52 commit 18951ee
Show file tree
Hide file tree
Showing 113 changed files with 129 additions and 0 deletions.
1 change: 1 addition & 0 deletions bin/cat/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
PACKAGE=runtime
PROG= cat

HAS_TESTS=
SUBDIR.${MK_TESTS}+= tests

.include <bsd.prog.mk>
1 change: 1 addition & 0 deletions bin/chmod/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
PACKAGE=runtime
PROG= chmod

HAS_TESTS=
SUBDIR.${MK_TESTS}+= tests

.include <bsd.prog.mk>
1 change: 1 addition & 0 deletions bin/date/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ PACKAGE=runtime
PROG= date
SRCS= date.c netdate.c vary.c

HAS_TESTS=
SUBDIR.${MK_TESTS}+= tests

.include <bsd.prog.mk>
1 change: 1 addition & 0 deletions bin/dd/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ test: ${PROG} gen

@rm -f gen 1M_zeroes* obs_zeroes

HAS_TESTS=
SUBDIR.${MK_TESTS}+= tests

.include <bsd.prog.mk>
1 change: 1 addition & 0 deletions bin/echo/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
PACKAGE=runtime
PROG= echo

HAS_TESTS=
SUBDIR.${MK_TESTS}+= tests

.include <bsd.prog.mk>
1 change: 1 addition & 0 deletions bin/expr/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ CFLAGS+= -fwrapv

NO_WMISSING_VARIABLE_DECLARATIONS=

HAS_TESTS=
SUBDIR.${MK_TESTS}+= tests

.include <bsd.prog.mk>
1 change: 1 addition & 0 deletions bin/ln/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ MAN= ln.1 symlink.7
LINKS= ${BINDIR}/ln ${BINDIR}/link
MLINKS= ln.1 link.1

HAS_TESTS=
SUBDIR.${MK_TESTS}+= tests

.include <bsd.prog.mk>
1 change: 1 addition & 0 deletions bin/ls/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ CFLAGS+= -DCOLORLS
LIBADD+= termcapw
.endif

HAS_TESTS=
SUBDIR.${MK_TESTS}+= tests

.include <bsd.prog.mk>
1 change: 1 addition & 0 deletions bin/mv/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
PACKAGE=runtime
PROG= mv

HAS_TESTS=
SUBDIR.${MK_TESTS}+= tests

.include <bsd.prog.mk>
1 change: 1 addition & 0 deletions bin/pax/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ SRCS= ar_io.c ar_subs.c buf_subs.c cache.c cpio.c file_subs.c ftree.c \
gen_subs.c getoldopt.c options.c pat_rep.c pax.c sel_subs.c \
tables.c tar.c tty_subs.c

HAS_TESTS=
SUBDIR.${MK_TESTS}+= tests

.include <bsd.prog.mk>
1 change: 1 addition & 0 deletions bin/pkill/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ MLINKS= pkill.1 pgrep.1
SYMLINKS= ../..${BINDIR}/pkill /usr/bin/pkill
SYMLINKS+= ../..${BINDIR}/pgrep /usr/bin/pgrep

HAS_TESTS=
SUBDIR.${MK_TESTS}+= tests

.include <bsd.prog.mk>
1 change: 1 addition & 0 deletions bin/pwait/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
PACKAGE=runtime
PROG= pwait

HAS_TESTS=
SUBDIR.${MK_TESTS}+= tests

.include <bsd.prog.mk>
1 change: 1 addition & 0 deletions bin/sh/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ syntax.c syntax.h: mksyntax
token.h: mktokens
sh ${.CURDIR}/mktokens

HAS_TESTS=
SUBDIR.${MK_TESTS}+= tests

.include <bsd.prog.mk>
1 change: 1 addition & 0 deletions bin/sleep/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
PACKAGE=runtime
PROG= sleep

HAS_TESTS=
SUBDIR.${MK_TESTS}+= tests

.include <bsd.prog.mk>
1 change: 1 addition & 0 deletions bin/test/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ PROG= test
LINKS= ${BINDIR}/test ${BINDIR}/[
MLINKS= test.1 [.1

HAS_TESTS=
SUBDIR.${MK_TESTS}+= tests

.include <bsd.prog.mk>
1 change: 1 addition & 0 deletions lib/atf/libatf-c++/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ INCSDIR_atf-c++.hpp= ${INCLUDEDIR}
MAN= atf-c++.3
MLINKS+= atf-c++.3 atf-c-api++.3 # Backwards compatibility.

HAS_TESTS=
SUBDIR.${MK_TESTS}+= tests

.include "../common.mk"
Expand Down
1 change: 1 addition & 0 deletions lib/atf/libatf-c/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ INCSDIR_atf-c.h= ${INCLUDEDIR}
MAN= atf-c.3
MLINKS+= atf-c.3 atf-c-api.3 # Backwards compatibility.

HAS_TESTS=
SUBDIR.${MK_TESTS}+= tests

.include "../common.mk"
Expand Down
1 change: 1 addition & 0 deletions lib/libarchive/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,7 @@ MLINKS+= archive_write_set_options.3 archive_write_set_format_option.3
MLINKS+= archive_write_set_options.3 archive_write_set_option.3
MLINKS+= libarchive.3 archive.3

HAS_TESTS=
SUBDIR.${MK_TESTS}+= tests

.include <bsd.lib.mk>
1 change: 1 addition & 0 deletions lib/libc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ libkern.${LIBC_ARCH}:: ${KMSRCS}
${CP} ${.ALLSRC} ${DESTDIR}/sys/libkern/${LIBC_ARCH}
.endif

HAS_TESTS=
SUBDIR.${MK_TESTS}+= tests

.include <bsd.lib.mk>
Expand Down
1 change: 1 addition & 0 deletions lib/libcam/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ SHLIB_MAJOR= 7

.include <src.opts.mk>

HAS_TESTS=
SUBDIR.${MK_TESTS}+= tests

.include <bsd.lib.mk>
1 change: 1 addition & 0 deletions lib/libcasper/services/cap_dns/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ LIBADD= nv

CFLAGS+=-I${.CURDIR}

HAS_TESTS=
SUBDIR.${MK_TESTS}+= tests

.include <bsd.lib.mk>
1 change: 1 addition & 0 deletions lib/libcasper/services/cap_grp/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ LIBADD= nv

CFLAGS+=-I${.CURDIR}

HAS_TESTS=
SUBDIR.${MK_TESTS}+= tests

.include <bsd.lib.mk>
1 change: 1 addition & 0 deletions lib/libcasper/services/cap_pwd/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ LIBADD= nv

CFLAGS+=-I${.CURDIR}

HAS_TESTS=
SUBDIR.${MK_TESTS}+= tests

.include <bsd.lib.mk>
1 change: 1 addition & 0 deletions lib/libcasper/services/cap_sysctl/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ LIBADD= nv

CFLAGS+=-I${.CURDIR}

HAS_TESTS=
SUBDIR.${MK_TESTS}+= tests

.include <bsd.lib.mk>
1 change: 1 addition & 0 deletions lib/libcrypt/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ WARNS?= 2

PRECIOUSLIB=

HAS_TESTS=
SUBDIR.${MK_TESTS}+= tests

.include <bsd.lib.mk>
1 change: 1 addition & 0 deletions lib/libkvm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ MLINKS+=kvm_read.3 kvm_read2.3 kvm_read.3 kvm_write.3

.include <src.opts.mk>

HAS_TESTS=
SUBDIR.${MK_TESTS}= tests

.include <bsd.lib.mk>
1 change: 1 addition & 0 deletions lib/libmp/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ CFLAGS+= -I${SRCTOP}/crypto
VERSION_DEF= ${SRCTOP}/lib/libc/Versions.def
SYMBOL_MAPS= ${.CURDIR}/Symbol.map

HAS_TESTS=
SUBDIR.${MK_TESTS}+= tests

.include <bsd.lib.mk>
1 change: 1 addition & 0 deletions lib/libnv/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ SRCS+= msgio.c
SRCS+= nvlist.c
SRCS+= nvpair.c

HAS_TESTS=
SUBDIR.${MK_TESTS}+= tests

.include <bsd.lib.mk>
1 change: 1 addition & 0 deletions lib/libpathconv/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ SRCS= abs2rel.c rel2abs.c
#VERSION_DEF= ${SRCTOP/lib/libc/Versions.def
#SYMBOL_MAPS= ${.CURDIR}/Symbol.map

HAS_TESTS=
SUBDIR.${MK_TESTS}+= tests

.include <bsd.lib.mk>
1 change: 1 addition & 0 deletions lib/libproc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ SHLIB_MAJOR= 4

MAN=

HAS_TESTS=
SUBDIR.${MK_TESTS}+= tests

.include <bsd.lib.mk>
1 change: 1 addition & 0 deletions lib/librt/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ PRECIOUSLIB=
VERSION_DEF=${SRCTOP}/lib/libc/Versions.def
SYMBOL_MAPS=${.CURDIR}/Symbol.map

HAS_TESTS=
SUBDIR.${MK_TESTS}+= tests

.include <bsd.lib.mk>
1 change: 1 addition & 0 deletions lib/libsbuf/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ VERSION_DEF= ${.CURDIR}/Version.def

.PATH: ${SRCTOP}/sys/kern

HAS_TESTS=
SUBDIR.${MK_TESTS}+= tests

.include <bsd.lib.mk>
1 change: 1 addition & 0 deletions lib/libthr/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ SYMLINKS+=lib${LIB}.so ${LIBDIR}/libpthread.so
SYMLINKS+=lib${LIB}_p.a ${LIBDIR}/libpthread_p.a
.endif

HAS_TESTS=
SUBDIR.${MK_TESTS}+= tests

.include <bsd.lib.mk>
1 change: 1 addition & 0 deletions lib/libutil/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ MLINKS+=pw_util.3 pw_copy.3 \
pw_util.3 pw_tempname.3 \
pw_util.3 pw_tmp.3

HAS_TESTS=
SUBDIR.${MK_TESTS}+= tests

.include <bsd.lib.mk>
1 change: 1 addition & 0 deletions lib/libxo/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ MLINKS= xo_attr.3 xo_attr_h.3 \
xo_syslog.3 xo_set_logmask.3 \
xo_syslog.3 xo_vsyslog.3

HAS_TESTS=
SUBDIR.${MK_TESTS}+= tests

.include <bsd.lib.mk>
1 change: 1 addition & 0 deletions lib/msun/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ MLINKS+=trunc.3 truncf.3 trunc.3 truncl.3

.include <src.opts.mk>

HAS_TESTS=
SUBDIR.${MK_TESTS}+= tests

.include <bsd.lib.mk>
1 change: 1 addition & 0 deletions libexec/atf/atf-check/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ CFLAGS+= -DATF_SHELL='"/bin/sh"'

LIBADD= atf_cxx

HAS_TESTS=
SUBDIR.${MK_TESTS}+= tests

.include <bsd.prog.mk>
1 change: 1 addition & 0 deletions libexec/atf/atf-sh/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ FILESGROUPS= SUBR
SUBRDIR= ${SHAREDIR}/atf
SUBR= libatf-sh.subr

HAS_TESTS=
SUBDIR.${MK_TESTS}+= tests

.include "../../../lib/atf/common.mk"
Expand Down
1 change: 1 addition & 0 deletions libexec/rtld-elf/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ beforeinstall:

.PATH: ${.CURDIR}/${RTLD_ARCH}

HAS_TESTS=
SUBDIR.${MK_TESTS}+= tests

.include <bsd.prog.mk>
Expand Down
1 change: 1 addition & 0 deletions sbin/devd/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ CFLAGS+=-I. -I${.CURDIR}

CLEANFILES= y.output

HAS_TESTS=
SUBDIR.${MK_TESTS}+= tests

.include <bsd.prog.mk>
1 change: 1 addition & 0 deletions sbin/dhclient/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ LIBADD= util

WARNS?= 2

HAS_TESTS=
SUBDIR.${MK_TESTS}+= tests

.include <bsd.prog.mk>
1 change: 1 addition & 0 deletions sbin/growfs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ NO_WCAST_ALIGN= yes

LIBADD= util

HAS_TESTS=
SUBDIR.${MK_TESTS}+= tests

.include <bsd.prog.mk>
1 change: 1 addition & 0 deletions sbin/ifconfig/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ MAN= ifconfig.8
CFLAGS+= -Wall -Wmissing-prototypes -Wcast-qual -Wwrite-strings -Wnested-externs
WARNS?= 2

HAS_TESTS=
SUBDIR.${MK_TESTS}+= tests

.include <bsd.prog.mk>
1 change: 1 addition & 0 deletions sbin/mdconfig/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ MAN= mdconfig.8

LIBADD= util geom

HAS_TESTS=
SUBDIR.${MK_TESTS}+= tests

.include <bsd.prog.mk>
1 change: 1 addition & 0 deletions sbin/pfctl/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ YFLAGS=

LIBADD= m md

HAS_TESTS=
SUBDIR.${MK_TESTS}+= tests

.include <bsd.prog.mk>
1 change: 1 addition & 0 deletions share/examples/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,7 @@ SUBDIR+=pf
.endif
.endif

HAS_TESTS=
SUBDIR.${MK_TESTS}+= tests

SUBDIR_PARALLEL=
Expand Down
1 change: 1 addition & 0 deletions share/zoneinfo/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ afterinstall:
echo "Run tzsetup(8) manually to update /etc/localtime."; \
fi

HAS_TESTS=
SUBDIR.${MK_TESTS}+= tests

.include <bsd.prog.mk>
1 change: 1 addition & 0 deletions tests/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@ afterinstall: install-tests-local
install-tests-local: .PHONY
${INSTALL_SYMLINK} ../local/tests ${DESTDIR}${TESTSDIR}/local

.include "Makefile.inc0"
.include <bsd.test.mk>
8 changes: 8 additions & 0 deletions tests/Makefile.inc0
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# $FreeBSD$

# tests/... doesn't conform to bsd.lib.mk and bsd.prog.mk, so specify a sane
# default for MK_CHECK_USE_SANDBOX. src.opts.mk will override the value if the
# user sets it to no.
MK_CHECK_USE_SANDBOX= yes

.include <bsd.opts.mk>
3 changes: 3 additions & 0 deletions tests/etc/Makefile.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# $FreeBSD$

.include "${SRCTOP}/tests/Makefile.inc0"
Loading

0 comments on commit 18951ee

Please sign in to comment.