Skip to content

Commit

Permalink
MFC r289172,r290254:
Browse files Browse the repository at this point in the history
r289172:

Refactor the test/ Makefiles after recent changes to bsd.test.mk (r289158) and
netbsd-tests.test.mk (r289151)

- Eliminate explicit OBJTOP/SRCTOP setting
- Convert all ad hoc NetBSD test integration over to netbsd-tests.test.mk
- Remove unnecessary TESTSDIR setting
- Use SRCTOP where possible for clarity

r290254:

Remove unused variable (SRCDIR)
  • Loading branch information
ngie-eign committed Feb 9, 2017
1 parent 72ef9ff commit 6b37221
Show file tree
Hide file tree
Showing 113 changed files with 67 additions and 304 deletions.
6 changes: 0 additions & 6 deletions bin/cat/tests/Makefile
@@ -1,11 +1,5 @@
# $FreeBSD$

OBJTOP= ${.OBJDIR}/../../..
SRCTOP= ${.CURDIR}/../../..
TESTSRC= ${SRCTOP}/contrib/netbsd-tests/bin/cat

TESTSDIR= ${TESTSBASE}/bin/cat

NETBSD_ATF_TESTS_SH= cat_test

FILESDIR= ${TESTSDIR}
Expand Down
2 changes: 0 additions & 2 deletions bin/date/tests/Makefile
Expand Up @@ -2,8 +2,6 @@

.include <bsd.own.mk>

TESTSDIR= ${TESTSBASE}/bin/date

ATF_TESTS_SH= format_string_test

.include <bsd.test.mk>
6 changes: 0 additions & 6 deletions bin/expr/tests/Makefile
@@ -1,11 +1,5 @@
# $FreeBSD$

OBJTOP= ${.OBJDIR}/../../..
SRCTOP= ${.CURDIR}/../../..
TESTSRC= ${SRCTOP}/contrib/netbsd-tests/bin/expr

TESTSDIR= ${TESTSBASE}/bin/expr

NETBSD_ATF_TESTS_SH= expr_test

ATF_TESTS_SH_SED_expr_test+= -e 's/eval expr/eval expr --/g'
Expand Down
2 changes: 0 additions & 2 deletions bin/ls/tests/Makefile
@@ -1,7 +1,5 @@
# $FreeBSD$

TESTSDIR= ${TESTSBASE}/bin/ls

ATF_TESTS_SH+= ls_tests
# This seems like overkill, but the idea in mind is that all of the testcases
# should be runnable as !root
Expand Down
2 changes: 0 additions & 2 deletions bin/mv/tests/Makefile
Expand Up @@ -2,8 +2,6 @@

.include <bsd.own.mk>

TESTSDIR= ${TESTSBASE}/bin/mv

TAP_TESTS_SH= legacy_test

.include <bsd.test.mk>
2 changes: 0 additions & 2 deletions bin/pax/tests/Makefile
Expand Up @@ -2,8 +2,6 @@

.include <bsd.own.mk>

TESTSDIR= ${TESTSBASE}/bin/pax

TAP_TESTS_PERL= legacy_test

.include <bsd.test.mk>
2 changes: 0 additions & 2 deletions bin/pkill/tests/Makefile
Expand Up @@ -2,8 +2,6 @@

.include <bsd.own.mk>

TESTSDIR= ${TESTSBASE}/bin/pkill

TAP_TESTS_SH= pgrep-F_test
TAP_TESTS_SH+= pgrep-LF_test
TAP_TESTS_SH+= pgrep-P_test
Expand Down
2 changes: 0 additions & 2 deletions bin/sh/tests/Makefile
Expand Up @@ -2,8 +2,6 @@

.include <bsd.own.mk>

TESTSDIR= ${TESTSBASE}/bin/sh

TESTS_SUBDIRS+= builtins
TESTS_SUBDIRS+= errors
TESTS_SUBDIRS+= execution
Expand Down
7 changes: 1 addition & 6 deletions bin/sleep/tests/Makefile
@@ -1,12 +1,7 @@
# $FreeBSD$

TESTSRC= ${.CURDIR}/../../../contrib/netbsd-tests/bin/sleep
.PATH: ${TESTSRC}

.include <bsd.own.mk>

TESTSDIR= ${TESTSBASE}/bin/sleep
ATF_TESTS_SH= sleep_test
ATF_TESTS_SH_SRC_sleep_test= t_sleep.sh
NETBSD_ATF_TESTS_SH= sleep_test

.include <bsd.test.mk>
2 changes: 0 additions & 2 deletions bin/test/tests/Makefile
Expand Up @@ -2,8 +2,6 @@

.include <bsd.own.mk>

TESTSDIR= ${TESTSBASE}/bin/test

TAP_TESTS_SH= legacy_test
# Some tests in here are silently not run when the tests are executed as
# root. Explicitly tell Kyua to drop privileges.
Expand Down
4 changes: 1 addition & 3 deletions bin/tests/Makefile
Expand Up @@ -2,9 +2,7 @@

.include <bsd.own.mk>

TESTSDIR= ${TESTSBASE}/bin

.PATH: ${.CURDIR:H:H}/tests
.PATH: ${SRCTOP}/tests
KYUAFILE= yes

.include <bsd.test.mk>
4 changes: 1 addition & 3 deletions cddl/lib/tests/Makefile
Expand Up @@ -2,9 +2,7 @@

.include <bsd.own.mk>

TESTSDIR= ${TESTSBASE}/cddl/lib

.PATH: ${.CURDIR:H:H:H}/tests
.PATH: ${SRCTOP}/tests
KYUAFILE= yes

.include <bsd.test.mk>
4 changes: 1 addition & 3 deletions cddl/sbin/tests/Makefile
Expand Up @@ -2,9 +2,7 @@

.include <bsd.own.mk>

TESTSDIR= ${TESTSBASE}/cddl/sbin

.PATH: ${.CURDIR:H:H:H}/tests
.PATH: ${SRCTOP}/tests
KYUAFILE= yes

.include <bsd.test.mk>
4 changes: 1 addition & 3 deletions cddl/tests/Makefile
Expand Up @@ -2,9 +2,7 @@

.include <bsd.own.mk>

TESTSDIR= ${TESTSBASE}/cddl

.PATH: ${.CURDIR:H:H}/tests
.PATH: ${SRCTOP}/tests
KYUAFILE= yes

.include <bsd.test.mk>
4 changes: 1 addition & 3 deletions cddl/usr.bin/tests/Makefile
Expand Up @@ -2,9 +2,7 @@

.include <bsd.own.mk>

TESTSDIR= ${TESTSBASE}/cddl/usr.bin

.PATH: ${.CURDIR:H:H:H}/tests
.PATH: ${SRCTOP}/tests
KYUAFILE= yes

.include <bsd.test.mk>
3 changes: 1 addition & 2 deletions cddl/usr.sbin/dtrace/tests/Makefile
Expand Up @@ -2,10 +2,9 @@

.include <bsd.own.mk>

TESTSDIR= ${TESTSBASE}/cddl/usr.sbin/dtrace
TESTS_SUBDIRS+= common

.PATH: ${.CURDIR:H:H:H:H}/tests
.PATH: ${SRCTOP}/tests
KYUAFILE= YES

.PATH: ${.CURDIR}/tools
Expand Down
4 changes: 1 addition & 3 deletions cddl/usr.sbin/tests/Makefile
Expand Up @@ -2,9 +2,7 @@

.include <bsd.own.mk>

TESTSDIR= ${TESTSBASE}/cddl/usr.sbin

.PATH: ${.CURDIR:H:H:H}/tests
.PATH: ${SRCTOP}/tests
KYUAFILE= yes

.include <bsd.test.mk>
4 changes: 1 addition & 3 deletions gnu/lib/tests/Makefile
Expand Up @@ -2,9 +2,7 @@

.include <bsd.own.mk>

TESTSDIR= ${TESTSBASE}/gnu/lib

.PATH: ${.CURDIR:H:H:H}/tests
.PATH: ${SRCTOP}/tests
KYUAFILE= yes

.include <bsd.test.mk>
4 changes: 1 addition & 3 deletions gnu/tests/Makefile
Expand Up @@ -2,9 +2,7 @@

.include <bsd.own.mk>

TESTSDIR= ${TESTSBASE}/gnu

.PATH: ${.CURDIR:H:H}/tests
.PATH: ${SRCTOP}/tests
KYUAFILE= yes

.include <bsd.test.mk>
11 changes: 4 additions & 7 deletions gnu/usr.bin/diff/tests/Makefile
@@ -1,17 +1,14 @@
# $FreeBSD$

TESTSRC= ${.CURDIR}/../../../../contrib/netbsd-tests/usr.bin/diff
.PATH: ${TESTSRC}
TESTSRC= ${SRCTOP}/contrib/netbsd-tests/usr.bin/diff

.include <bsd.own.mk>

TESTSDIR= ${TESTSBASE}/gnu/usr.bin/diff
ATF_TESTS_SH= diff_test
NETBSD_ATF_TESTS_SH= diff_test
ATF_TESTS_SH_SED_diff_test= -e 's/t_diff/`basename $$0`/g'
ATF_TESTS_SH_SRC_diff_test= t_diff.sh

FILESDIR= ${TESTSDIR}
FILES+= d_mallocv1.in
FILES+= d_mallocv2.in

.include <netbsd-tests.test.mk>

.include <bsd.test.mk>
4 changes: 1 addition & 3 deletions gnu/usr.bin/tests/Makefile
Expand Up @@ -2,9 +2,7 @@

.include <bsd.own.mk>

TESTSDIR= ${TESTSBASE}/gnu/usr.bin

.PATH: ${.CURDIR:H:H:H}/tests
.PATH: ${SRCTOP}/tests
KYUAFILE= yes

.include <bsd.test.mk>
3 changes: 1 addition & 2 deletions lib/atf/libatf-c++/tests/Makefile
Expand Up @@ -2,10 +2,9 @@

.include <bsd.init.mk>

TESTSDIR= ${TESTSBASE}/lib/atf/libatf-c++
TESTS_SUBDIRS= detail

ATF= ${.CURDIR:H:H:H:H}/contrib/atf
ATF= ${SRCTOP}/contrib/atf
.PATH: ${ATF}/atf-c++
.PATH: ${ATF}/atf-c++/detail

Expand Down
2 changes: 1 addition & 1 deletion lib/atf/libatf-c++/tests/detail/Makefile
Expand Up @@ -4,7 +4,7 @@

TESTSDIR= ${TESTSBASE}/lib/atf/libatf-c++/detail

ATF= ${.CURDIR:H:H:H:H:H}/contrib/atf
ATF= ${SRCTOP}/contrib/atf
.PATH: ${ATF}/atf-c++/detail

CFLAGS+= -DATF_C_TESTS_BASE='"${TESTSBASE}/lib/atf/libatf-c"'
Expand Down
3 changes: 1 addition & 2 deletions lib/atf/libatf-c/tests/Makefile
Expand Up @@ -2,10 +2,9 @@

.include <bsd.init.mk>

TESTSDIR= ${TESTSBASE}/lib/atf/libatf-c
TESTS_SUBDIRS= detail

ATF= ${.CURDIR:H:H:H:H}/contrib/atf
ATF= ${SRCTOP}/contrib/atf
.PATH: ${ATF}/atf-c
.PATH: ${ATF}/atf-c/detail

Expand Down
2 changes: 1 addition & 1 deletion lib/atf/libatf-c/tests/detail/Makefile
Expand Up @@ -4,7 +4,7 @@

TESTSDIR= ${TESTSBASE}/lib/atf/libatf-c/detail

ATF= ${.CURDIR:H:H:H:H:H}/contrib/atf
ATF= ${SRCTOP}/contrib/atf
.PATH: ${ATF}/atf-c/detail

CFLAGS+= -DATF_INCLUDEDIR='"${INCLUDEDIR}"'
Expand Down
2 changes: 1 addition & 1 deletion lib/atf/tests/Makefile
Expand Up @@ -4,7 +4,7 @@

TESTSDIR= ${TESTSBASE}/lib/atf

.PATH: ${.CURDIR:H:H:H}/tests
.PATH: ${SRCTOP}/tests
KYUAFILE= yes

SUBDIR= test-programs
Expand Down
2 changes: 1 addition & 1 deletion lib/atf/tests/test-programs/Makefile
Expand Up @@ -5,7 +5,7 @@
TESTSDIR= ${TESTSBASE}/lib/atf/test-programs
KYUAFILE= yes

ATF= ${.CURDIR:H:H:H:H}/contrib/atf
ATF= ${SRCTOP}/contrib/atf
.PATH: ${ATF}/test-programs

CFLAGS+= -I${ATF}
Expand Down
2 changes: 0 additions & 2 deletions lib/libc/tests/Makefile
Expand Up @@ -2,8 +2,6 @@

.include <bsd.own.mk>

TESTSDIR= ${TESTSBASE}/lib/libc

SUBDIR= tls_dso

TESTS_SUBDIRS= c063
Expand Down
6 changes: 3 additions & 3 deletions lib/libc/tests/Makefile.netbsd-tests
@@ -1,8 +1,8 @@
# $FreeBSD$

OBJTOP?= ${.OBJDIR:H:H:H:H}
SRCTOP?= ${.CURDIR:H:H:H:H}
TESTSRC?= ${SRCTOP}/contrib/netbsd-tests/lib/libc/${.CURDIR:T}
TESTSRC:= ${SRCTOP}/contrib/netbsd-tests/${RELDIR:C/libc\/tests/libc/}

TESTSDIR:= ${TESTSBASE}/${RELDIR:C/libc\/tests/libc/}

WARNS?= 2

Expand Down
2 changes: 0 additions & 2 deletions lib/libc/tests/c063/Makefile
@@ -1,7 +1,5 @@
# $FreeBSD$

TESTSDIR= ${TESTSBASE}/lib/libc/c063

#TODO: t_o_search

NETBSD_ATF_TESTS_C= faccessat_test
Expand Down
2 changes: 0 additions & 2 deletions lib/libc/tests/db/Makefile
@@ -1,7 +1,5 @@
# $FreeBSD$

TESTSDIR= ${TESTSBASE}/lib/libc/db

BINDIR= ${TESTSDIR}

PROGS= h_db
Expand Down
2 changes: 0 additions & 2 deletions lib/libc/tests/gen/Makefile
Expand Up @@ -2,8 +2,6 @@

.include <bsd.own.mk>

TESTSDIR= ${TESTSBASE}/lib/libc/gen

ATF_TESTS_C+= arc4random_test
ATF_TESTS_C+= fmtcheck2_test
ATF_TESTS_C+= fmtmsg_test
Expand Down
6 changes: 0 additions & 6 deletions lib/libc/tests/gen/execve/Makefile
@@ -1,13 +1,7 @@
# $FreeBSD$

OBJTOP= ${.OBJDIR:H:H:H:H:H}
SRCTOP= ${.CURDIR:H:H:H:H:H}
TESTSRC= ${SRCTOP}/contrib/netbsd-tests/lib/libc/gen/${.CURDIR:T}

.include <bsd.own.mk>

TESTSDIR= ${TESTSBASE}/lib/libc/gen/execve

NETBSD_ATF_TESTS_C= execve_test

.include "../../Makefile.netbsd-tests"
Expand Down
6 changes: 0 additions & 6 deletions lib/libc/tests/gen/posix_spawn/Makefile
@@ -1,13 +1,7 @@
# $FreeBSD$

OBJTOP= ${.OBJDIR:H:H:H:H:H}
SRCTOP= ${.CURDIR:H:H:H:H:H}
TESTSRC= ${SRCTOP}/contrib/netbsd-tests/lib/libc/gen/${.CURDIR:T}

.include <bsd.own.mk>

TESTSDIR= ${TESTSBASE}/lib/libc/gen/posix_spawn

BINDIR= ${TESTSDIR}

NETBSD_ATF_TESTS_C= fileactions_test
Expand Down
6 changes: 2 additions & 4 deletions lib/libc/tests/hash/Makefile
Expand Up @@ -2,8 +2,6 @@

.include <bsd.own.mk>

TESTSDIR= ${TESTSBASE}/lib/libc/hash

NETBSD_ATF_TESTS_C=

.if ${MK_OPENSSL} != "no"
Expand All @@ -29,8 +27,8 @@ LDADD+= -lmd
DPADD.sha2_test+= ${LIBCRYPTO}
LDADD.sha2_test+= -lcrypto

CFLAGS.sha2_test+= -I${.CURDIR}/../../../../crypto/openssh/openbsd-compat
CFLAGS.sha2_test+= -I${.CURDIR}/../../../../crypto/openssh
CFLAGS.sha2_test+= -I${SRCTOP}/crypto/openssh/openbsd-compat
CFLAGS.sha2_test+= -I${SRCTOP}/crypto/openssh

.include "../Makefile.netbsd-tests"

Expand Down
2 changes: 0 additions & 2 deletions lib/libc/tests/inet/Makefile
Expand Up @@ -2,8 +2,6 @@

.include <bsd.own.mk>

TESTSDIR= ${TESTSBASE}/lib/libc/inet

NETBSD_ATF_TESTS_C= inet_network_test

.include "../Makefile.netbsd-tests"
Expand Down

0 comments on commit 6b37221

Please sign in to comment.