diff options
author | jmmv <jmmv@FreeBSD.org> | 2013-12-28 23:08:58 +0000 |
---|---|---|
committer | jmmv <jmmv@FreeBSD.org> | 2013-12-28 23:08:58 +0000 |
commit | 17b80845b0ba13495186831d3505af8c20eeb6ac (patch) | |
tree | f67dde62985332519d0ad6763cdb1b68c9793ab3 | |
parent | b8ce141a401c502407ab3e076ccfc3b428c8ac61 (diff) | |
download | FreeBSD-src-17b80845b0ba13495186831d3505af8c20eeb6ac.zip FreeBSD-src-17b80845b0ba13495186831d3505af8c20eeb6ac.tar.gz |
Plug the ATF tests into the build.
This is a MFC into stable/10 of:
- r257849 Add libatf-c++ to the prebuild libs.
- r257853 Build and install the atf tests.
- r258233 Move all atf directories to the tests mtree.
- r258285 Fix the build of some ATF tests.
This change is "make tinderbox" clean on ref10-amd64 with the default
settings of WITHOUT_TESTS. It is likely for the WITH_TESTS build to
still be broken because not all relevant changes have been merged yet.
30 files changed, 299 insertions, 27 deletions
diff --git a/Makefile.inc1 b/Makefile.inc1 index 13c676a..05eb661 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -494,7 +494,7 @@ _worldtmp: .endif .if ${MK_TESTS} != "no" mtree -deU -f ${.CURDIR}/etc/mtree/BSD.tests.dist \ - -p ${WORLDTMP}${TESTSBASE} >/dev/null + -p ${WORLDTMP}/usr >/dev/null .endif .for _mtree in ${LOCAL_MTREE} mtree -deU -f ${.CURDIR}/${_mtree} -p ${WORLDTMP} > /dev/null @@ -1480,7 +1480,7 @@ _prebuild_libs= ${_kerberos5_lib_libasn1} \ ${_kerberos5_lib_libhx509} ${_kerberos5_lib_libkrb5} \ ${_kerberos5_lib_libroken} \ ${_kerberos5_lib_libwind} \ - ${_lib_atf_libatf_c} \ + ${_lib_atf} \ lib/libbz2 ${_libcom_err} lib/libcrypt \ lib/libelf lib/libexpat \ ${_lib_libgssapi} ${_lib_libipx} \ @@ -1495,7 +1495,7 @@ _prebuild_libs= ${_kerberos5_lib_libasn1} \ ${_secure_lib_libssh} ${_secure_lib_libssl} .if ${MK_TESTS} != "no" -_lib_atf_libatf_c= lib/atf/libatf-c +_lib_atf= lib/atf .endif .if ${MK_LIBTHR} != "no" diff --git a/etc/Makefile b/etc/Makefile index d763df6..70a1e2a 100644 --- a/etc/Makefile +++ b/etc/Makefile @@ -321,7 +321,7 @@ MTREES+= mtree/BSD.debug.dist /usr/lib MTREES+= mtree/BSD.groff.dist /usr .endif .if ${MK_TESTS} != "no" -MTREES+= mtree/BSD.tests.dist ${TESTSBASE} +MTREES+= mtree/BSD.tests.dist /usr .endif .if ${MK_SENDMAIL} != "no" MTREES+= mtree/BSD.sendmail.dist / diff --git a/etc/mtree/BSD.include.dist b/etc/mtree/BSD.include.dist index 76cdf94..160e9d9 100644 --- a/etc/mtree/BSD.include.dist +++ b/etc/mtree/BSD.include.dist @@ -9,10 +9,6 @@ .. arpa .. - atf-c - .. - atf-c++ - .. bsm .. bsnmp diff --git a/etc/mtree/BSD.tests.dist b/etc/mtree/BSD.tests.dist index 37f37e9..85a0811 100644 --- a/etc/mtree/BSD.tests.dist +++ b/etc/mtree/BSD.tests.dist @@ -5,8 +5,44 @@ /set type=dir uname=root gname=wheel mode=0755 . - lib - libcrypt + include + atf-c + .. + atf-c++ + .. + .. + share + atf + .. + doc + atf + .. + .. + .. + tests + lib + atf + libatf-c + .. + libatf-c++ + .. + test-programs + .. + .. + libcrypt + .. + .. + libexec + atf + atf-check + .. + .. + .. + usr.bin + atf + atf-sh + .. + .. .. .. .. diff --git a/etc/mtree/BSD.usr.dist b/etc/mtree/BSD.usr.dist index bb50c5e..e7e6f99 100644 --- a/etc/mtree/BSD.usr.dist +++ b/etc/mtree/BSD.usr.dist @@ -120,8 +120,6 @@ sbin .. share - atf - .. bsdconfig media .. @@ -165,8 +163,6 @@ doc IPv6 .. - atf - .. atm .. legal @@ -1447,6 +1443,4 @@ .. src nochange .. - tests - .. .. diff --git a/lib/atf/Makefile b/lib/atf/Makefile index 0da9aa8..a191f0d 100644 --- a/lib/atf/Makefile +++ b/lib/atf/Makefile @@ -27,9 +27,13 @@ .include <bsd.own.mk> -SUBDIR= \ - libatf-c \ - libatf-c++ +SUBDIR= libatf-c \ + libatf-c++ \ + ${_tests} + +.if ${MK_TESTS} != "no" +_tests= tests +.endif .ORDER: ${SUBDIR} diff --git a/lib/atf/Makefile.inc b/lib/atf/Makefile.inc index 937187a..15e7517 100644 --- a/lib/atf/Makefile.inc +++ b/lib/atf/Makefile.inc @@ -25,8 +25,6 @@ # # $FreeBSD$ -ATF= ${.CURDIR}/../../../contrib/atf - _CFLAGS:= ${CFLAGS} _CPPFLAGS:= ${CPPFLAGS} _CXXFLAGS:= ${CXXFLAGS} diff --git a/lib/atf/libatf-c++/Makefile b/lib/atf/libatf-c++/Makefile index 37d6073..96f620b 100644 --- a/lib/atf/libatf-c++/Makefile +++ b/lib/atf/libatf-c++/Makefile @@ -36,6 +36,7 @@ LDADD= -latf-c LDFLAGS+= -L${.OBJDIR}/../libatf-c +ATF= ${.CURDIR:H:H:H}/contrib/atf .PATH: ${ATF} .PATH: ${ATF}/atf-c++ .PATH: ${ATF}/atf-c++/detail @@ -73,4 +74,8 @@ INCSDIR_atf-c++.hpp= ${INCLUDEDIR} MAN= atf-c++-api.3 +.if ${MK_TESTS} != "no" +SUBDIR= tests +.endif + .include <bsd.lib.mk> diff --git a/lib/atf/libatf-c++/Makefile.inc b/lib/atf/libatf-c++/Makefile.inc new file mode 100644 index 0000000..265f86d --- /dev/null +++ b/lib/atf/libatf-c++/Makefile.inc @@ -0,0 +1,3 @@ +# $FreeBSD$ + +.include "../Makefile.inc" diff --git a/lib/atf/libatf-c++/tests/Makefile b/lib/atf/libatf-c++/tests/Makefile new file mode 100644 index 0000000..db10fce --- /dev/null +++ b/lib/atf/libatf-c++/tests/Makefile @@ -0,0 +1,47 @@ +# $FreeBSD$ + +.include <bsd.init.mk> + +TESTSDIR= ${TESTSBASE}/lib/atf/libatf-c++ + +ATF= ${.CURDIR:H:H:H:H}/contrib/atf +.PATH: ${ATF}/atf-c++ +.PATH: ${ATF}/atf-c++/detail + +CFLAGS+= -I${ATF} + +FILESDIR= ${TESTSDIR} +FILES= macros_hpp_test.cpp +FILES+= unused_test.cpp + +# Tests in atf-c++. +.for _T in atf_c++_test \ + build_test \ + check_test \ + config_test \ + macros_test \ + tests_test \ + utils_test +ATF_TESTS_CXX+= ${_T} +SRCS.${_T}= ${_T}.cpp test_helpers.cpp +.endfor + +ATF_TESTS_SH= pkg_config_test + +# Tests in atf-c++/detail. + +.for _T in application_test \ + env_test \ + exceptions_test \ + expand_test \ + fs_test \ + parser_test \ + process_test \ + sanity_test \ + text_test \ + ui_test +ATF_TESTS_CXX+= ${_T} +SRCS.${_T}= ${_T}.cpp test_helpers.cpp +.endfor + +.include <atf.test.mk> diff --git a/lib/atf/libatf-c/Makefile b/lib/atf/libatf-c/Makefile index 26fba5c..b197958 100644 --- a/lib/atf/libatf-c/Makefile +++ b/lib/atf/libatf-c/Makefile @@ -30,6 +30,7 @@ LIB= atf-c SHLIB_MAJOR= 1 +ATF= ${.CURDIR:H:H:H}/contrib/atf .PATH: ${ATF} .PATH: ${ATF}/atf-c .PATH: ${ATF}/atf-c/detail @@ -73,4 +74,8 @@ INCSDIR_atf-c.h= ${INCLUDEDIR} MAN= atf-c-api.3 +.if ${MK_TESTS} != "no" +SUBDIR= tests +.endif + .include <bsd.lib.mk> diff --git a/lib/atf/libatf-c/Makefile.inc b/lib/atf/libatf-c/Makefile.inc new file mode 100644 index 0000000..265f86d --- /dev/null +++ b/lib/atf/libatf-c/Makefile.inc @@ -0,0 +1,3 @@ +# $FreeBSD$ + +.include "../Makefile.inc" diff --git a/lib/atf/libatf-c/tests/Makefile b/lib/atf/libatf-c/tests/Makefile new file mode 100644 index 0000000..856c3d7 --- /dev/null +++ b/lib/atf/libatf-c/tests/Makefile @@ -0,0 +1,62 @@ +# $FreeBSD$ + +.include <bsd.init.mk> + +TESTSDIR= ${TESTSBASE}/lib/atf/libatf-c + +ATF= ${.CURDIR:H:H:H:H}/contrib/atf +.PATH: ${ATF}/atf-c +.PATH: ${ATF}/atf-c/detail + +CFLAGS+= -I${ATF} + +.if ${COMPILER_TYPE} == "clang" +# macros_test.c contains a double 'const const' which will be gone with +# the import of atf-0.18. +# TODO(jmmv): Remove this workaround once we do that update. +CFLAGS+= -Wno-duplicate-decl-specifier +.endif + +FILESDIR= ${TESTSDIR} +FILES= macros_h_test.c +FILES+= unused_test.c + +# Tests in atf-c. + +.for _T in atf_c_test \ + build_test \ + check_test \ + config_test \ + error_test \ + macros_test \ + tc_test \ + tp_test \ + utils_test +ATF_TESTS_C+= ${_T} +SRCS.${_T}= ${_T}.c test_helpers.c +.endfor + +ATF_TESTS_SH= pkg_config_test + +# Tests in atf-c/detail. + +.for _T in dynstr_test \ + env_test \ + fs_test \ + list_test \ + map_test \ + process_test \ + sanity_test \ + test_helpers_test \ + text_test \ + user_test +ATF_TESTS_C+= ${_T} +SRCS.${_T}= ${_T}.c test_helpers.c +.endfor + +PROGS+= process_helpers +SRCS.process_helpers= process_helpers.c +MAN.process_helpers= # defined +BINDIR.process_helpers= ${TESTSDIR} + +.include <atf.test.mk> diff --git a/lib/atf/tests/Makefile b/lib/atf/tests/Makefile new file mode 100644 index 0000000..7bc96c9 --- /dev/null +++ b/lib/atf/tests/Makefile @@ -0,0 +1,12 @@ +# $FreeBSD$ + +.include <bsd.own.mk> + +TESTSDIR= ${TESTSBASE}/lib/atf + +.PATH: ${.CURDIR:H:H:H}/tests +KYUAFILE= yes + +SUBDIR= test-programs + +.include <bsd.test.mk> diff --git a/lib/atf/tests/test-programs/Makefile b/lib/atf/tests/test-programs/Makefile new file mode 100644 index 0000000..f1ba9f5 --- /dev/null +++ b/lib/atf/tests/test-programs/Makefile @@ -0,0 +1,24 @@ +# $FreeBSD$ + +.include <bsd.init.mk> + +TESTSDIR= ${TESTSBASE}/lib/atf/test-programs +KYUAFILE= yes + +ATF= ${.CURDIR:H:H:H:H}/contrib/atf +.PATH: ${ATF}/test-programs + +CFLAGS+= -I${ATF} + +ATF_TESTS_C= c_helpers + +ATF_TESTS_CXX= cpp_helpers +SRCS.cpp_helpers= cpp_helpers.cpp + +ATF_TESTS_SH= sh_helpers +.for _T in config_test expect_test fork_test meta_data_test result_test srcdir_test +ATF_TESTS_SH+= ${_T} +ATF_TESTS_SH_SRC_${_T}= common.sh ${_T}.sh +.endfor + +.include <atf.test.mk> diff --git a/libexec/Makefile b/libexec/Makefile index 576335f..cf5c120 100644 --- a/libexec/Makefile +++ b/libexec/Makefile @@ -28,6 +28,7 @@ SUBDIR= ${_atf} \ talkd \ tcpd \ ${_telnetd} \ + ${_tests} \ tftpd \ ${_tftp-proxy} \ ulog-helper \ @@ -74,6 +75,7 @@ _telnetd= telnetd .if ${MK_TESTS} != "no" _atf= atf +_tests= tests .endif .include <bsd.subdir.mk> diff --git a/libexec/atf/Makefile b/libexec/atf/Makefile index dc222c3..6749db5 100644 --- a/libexec/atf/Makefile +++ b/libexec/atf/Makefile @@ -25,6 +25,6 @@ # # $FreeBSD$ -SUBDIR= atf-check +SUBDIR= atf-check tests .include <bsd.subdir.mk> diff --git a/libexec/atf/Makefile.inc b/libexec/atf/Makefile.inc index a28f546..392bbb2 100644 --- a/libexec/atf/Makefile.inc +++ b/libexec/atf/Makefile.inc @@ -25,8 +25,6 @@ # # $FreeBSD$ -ATF = ${.CURDIR}/../../../contrib/atf - CFLAGS+= -DHAVE_CONFIG_H WARNS?= 3 diff --git a/libexec/atf/atf-check/Makefile b/libexec/atf/atf-check/Makefile index fafb1e4..0cfa863 100644 --- a/libexec/atf/atf-check/Makefile +++ b/libexec/atf/atf-check/Makefile @@ -27,6 +27,7 @@ .include <bsd.init.mk> +ATF= ${.CURDIR:H:H:H}/contrib/atf .PATH: ${ATF}/atf-sh BINDIR= /usr/libexec @@ -42,4 +43,8 @@ LDFLAGS+= -L${.OBJDIR}/../../../lib/atf/libatf-c++ LDFLAGS+= -L${.OBJDIR}/../../../lib/atf/libatf-c LDADD+= -latf-c++ -latf-c +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif + .include <bsd.prog.mk> diff --git a/libexec/atf/atf-check/Makefile.inc b/libexec/atf/atf-check/Makefile.inc new file mode 100644 index 0000000..265f86d --- /dev/null +++ b/libexec/atf/atf-check/Makefile.inc @@ -0,0 +1,3 @@ +# $FreeBSD$ + +.include "../Makefile.inc" diff --git a/libexec/atf/atf-check/tests/Makefile b/libexec/atf/atf-check/tests/Makefile new file mode 100644 index 0000000..0f237e6 --- /dev/null +++ b/libexec/atf/atf-check/tests/Makefile @@ -0,0 +1,12 @@ +# $FreeBSD$ + +.include <bsd.init.mk> + +TESTSDIR= ${TESTSBASE}/libexec/atf/atf-check + +ATF= ${.CURDIR:H:H:H:H}/contrib/atf +.PATH: ${ATF}/atf-sh + +ATF_TESTS_SH= atf-check_test + +.include <atf.test.mk> diff --git a/libexec/atf/tests/Makefile b/libexec/atf/tests/Makefile new file mode 100644 index 0000000..7aa9601 --- /dev/null +++ b/libexec/atf/tests/Makefile @@ -0,0 +1,10 @@ +# $FreeBSD$ + +.include <bsd.own.mk> + +TESTSDIR= ${TESTSBASE}/libexec/atf + +.PATH: ${.CURDIR:H:H:H}/tests +KYUAFILE= yes + +.include <bsd.test.mk> diff --git a/libexec/tests/Makefile b/libexec/tests/Makefile new file mode 100644 index 0000000..665efab --- /dev/null +++ b/libexec/tests/Makefile @@ -0,0 +1,10 @@ +# $FreeBSD$ + +.include <bsd.own.mk> + +TESTSDIR= ${TESTSBASE}/libexec + +.PATH: ${.CURDIR:H:H}/tests +KYUAFILE= yes + +.include <bsd.test.mk> diff --git a/usr.bin/Makefile b/usr.bin/Makefile index cbee3fb..0a6145b 100644 --- a/usr.bin/Makefile +++ b/usr.bin/Makefile @@ -160,6 +160,7 @@ SUBDIR= alias \ tar \ tcopy \ tee \ + ${_tests} \ tftp \ time \ tip \ @@ -330,6 +331,7 @@ SUBDIR+= telnet .if ${MK_TESTS} != "no" _atf= atf +_tests= tests .endif .if ${MK_TEXTPROC} != "no" diff --git a/usr.bin/atf/Makefile b/usr.bin/atf/Makefile index 0ea47aa..054cdf2 100644 --- a/usr.bin/atf/Makefile +++ b/usr.bin/atf/Makefile @@ -25,6 +25,6 @@ # # $FreeBSD$ -SUBDIR= atf-sh +SUBDIR= atf-sh tests .include <bsd.subdir.mk> diff --git a/usr.bin/atf/Makefile.inc b/usr.bin/atf/Makefile.inc index 6572cfe..a79cd6d 100644 --- a/usr.bin/atf/Makefile.inc +++ b/usr.bin/atf/Makefile.inc @@ -1,6 +1,4 @@ # $FreeBSD$ -ATF= ${.CURDIR}/../../../contrib/atf - BINDIR?= /usr/bin WARNS?= 3 diff --git a/usr.bin/atf/atf-sh/Makefile b/usr.bin/atf/atf-sh/Makefile index 8112098..1688b19 100644 --- a/usr.bin/atf/atf-sh/Makefile +++ b/usr.bin/atf/atf-sh/Makefile @@ -27,6 +27,7 @@ .include <bsd.init.mk> +ATF= ${.CURDIR:H:H:H}/contrib/atf .PATH: ${ATF}/atf-sh PROG_CXX= atf-sh @@ -44,4 +45,8 @@ FILESGROUPS= SUBR SUBRDIR= ${SHAREDIR}/atf SUBR= libatf-sh.subr +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif + .include <bsd.prog.mk> diff --git a/usr.bin/atf/atf-sh/tests/Makefile b/usr.bin/atf/atf-sh/tests/Makefile new file mode 100644 index 0000000..664f25a --- /dev/null +++ b/usr.bin/atf/atf-sh/tests/Makefile @@ -0,0 +1,18 @@ +# $FreeBSD$ + +.include <bsd.init.mk> + +TESTSDIR= ${TESTSBASE}/usr.bin/atf/atf-sh + +ATF= ${.CURDIR:H:H:H:H}/contrib/atf +.PATH: ${ATF}/atf-sh + +ATF_TESTS_SH+= atf_check_test +ATF_TESTS_SH+= config_test +ATF_TESTS_SH+= integration_test +ATF_TESTS_SH+= misc_helpers +ATF_TESTS_SH+= normalize_test +ATF_TESTS_SH+= tc_test +ATF_TESTS_SH+= tp_test + +.include <atf.test.mk> diff --git a/usr.bin/atf/tests/Makefile b/usr.bin/atf/tests/Makefile new file mode 100644 index 0000000..3ff9f93 --- /dev/null +++ b/usr.bin/atf/tests/Makefile @@ -0,0 +1,10 @@ +# $FreeBSD$ + +.include <bsd.own.mk> + +TESTSDIR= ${TESTSBASE}/usr.bin/atf + +.PATH: ${.CURDIR:H:H:H}/tests +KYUAFILE= yes + +.include <bsd.test.mk> diff --git a/usr.bin/tests/Makefile b/usr.bin/tests/Makefile new file mode 100644 index 0000000..f8ead88 --- /dev/null +++ b/usr.bin/tests/Makefile @@ -0,0 +1,10 @@ +# $FreeBSD$ + +.include <bsd.own.mk> + +TESTSDIR= ${TESTSBASE}/usr.bin + +.PATH: ${.CURDIR:H:H}/tests +KYUAFILE= yes + +.include <bsd.test.mk> |