diff options
author | sjg <sjg@FreeBSD.org> | 2014-04-27 08:13:43 +0000 |
---|---|---|
committer | sjg <sjg@FreeBSD.org> | 2014-04-27 08:13:43 +0000 |
commit | 0c7e03a54c8e7ddc9c3fe710f83d9ca53173692e (patch) | |
tree | b92e741b68057a24e381faa9809f32030d65574c /lib/atf | |
parent | c244fcbcaa61dc2a15995e7dbdf3ae8107bc2111 (diff) | |
parent | 69c3e6933b6946c49fe99b19986f018d71621980 (diff) | |
download | FreeBSD-src-0c7e03a54c8e7ddc9c3fe710f83d9ca53173692e.zip FreeBSD-src-0c7e03a54c8e7ddc9c3fe710f83d9ca53173692e.tar.gz |
Merge head
Diffstat (limited to 'lib/atf')
-rw-r--r-- | lib/atf/Makefile | 10 | ||||
-rw-r--r-- | lib/atf/Makefile.inc | 3 | ||||
-rw-r--r-- | lib/atf/common.mk | 19 | ||||
-rw-r--r-- | lib/atf/libatf-c++/Makefile | 26 | ||||
-rw-r--r-- | lib/atf/libatf-c++/Makefile.inc | 3 | ||||
-rw-r--r-- | lib/atf/libatf-c++/tests/Makefile | 31 | ||||
-rw-r--r-- | lib/atf/libatf-c++/tests/Makefile.inc | 3 | ||||
-rw-r--r-- | lib/atf/libatf-c++/tests/detail/Makefile | 32 | ||||
-rw-r--r-- | lib/atf/libatf-c/Makefile | 22 | ||||
-rw-r--r-- | lib/atf/libatf-c/Makefile.inc | 3 | ||||
-rw-r--r-- | lib/atf/libatf-c/tests/Makefile | 38 | ||||
-rw-r--r-- | lib/atf/libatf-c/tests/Makefile.inc | 3 | ||||
-rw-r--r-- | lib/atf/libatf-c/tests/detail/Makefile | 34 | ||||
-rw-r--r-- | lib/atf/tests/Makefile | 12 | ||||
-rw-r--r-- | lib/atf/tests/test-programs/Makefile | 24 |
15 files changed, 254 insertions, 9 deletions
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..40da946 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} @@ -40,6 +38,7 @@ CFLAGS+= -DATF_BUILD_CPPFLAGS='"${_CPPFLAGS}"' CFLAGS+= -DATF_BUILD_CXX='"${CXX}"' CFLAGS+= -DATF_BUILD_CXXFLAGS='"${_CXXFLAGS}"' CFLAGS+= -DATF_CONFDIR='"${CONFDIR}/atf"' +CFLAGS+= -DATF_C_TESTS_BASE='"${TESTSBASE}/lib/atf/libatf-c"' CFLAGS+= -DATF_INCLUDEDIR='"${INCLUDEDIR}"' CFLAGS+= -DATF_LIBDIR='"${LIBDIR}"' CFLAGS+= -DATF_LIBEXECDIR='"${LIBEXECDIR}"' diff --git a/lib/atf/common.mk b/lib/atf/common.mk new file mode 100644 index 0000000..6338207 --- /dev/null +++ b/lib/atf/common.mk @@ -0,0 +1,19 @@ +# $FreeBSD$ +# +# Common Makefile code for all components of ATF. +# + +.if !defined(ATF) +.error "ATF must be defined and point to the contrib/atf directory" +.endif + +# Depend on the atf-version target to generate a file that contains the +# version number of the currently imported ATF release and that only +# changes on new imports. +atf-version: atf-version-real + @cmp -s atf-version atf-version-real \ + || cp atf-version-real atf-version +atf-version-real: .PHONY + @grep 'define VERSION' ${ATF}/bconfig.h \ + | cut -d '"' -f 2 >atf-version-real +CLEANFILES+= atf-version atf-version-real diff --git a/lib/atf/libatf-c++/Makefile b/lib/atf/libatf-c++/Makefile index 37d6073..d52e496 100644 --- a/lib/atf/libatf-c++/Makefile +++ b/lib/atf/libatf-c++/Makefile @@ -28,7 +28,7 @@ .include <bsd.init.mk> LIB= atf-c++ -SHLIB_MAJOR= 1 +SHLIB_MAJOR= 2 # libatf-c++ depends on the C version of the ATF library to build. DPADD= ${LIBATFC} @@ -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 @@ -52,13 +53,11 @@ SRCS= application.cpp \ config.cpp \ env.cpp \ exceptions.cpp \ - expand.cpp \ fs.cpp \ - parser.cpp \ process.cpp \ tests.cpp \ text.cpp \ - ui.cpp + utils.cpp INCS= build.hpp \ check.hpp \ @@ -73,4 +72,23 @@ INCSDIR_atf-c++.hpp= ${INCLUDEDIR} MAN= atf-c++-api.3 +all: atf-c++.pc +atf-c++.pc: atf-c++.pc.in atf-version + sed -e 's,__CXX__,${CXX},g' \ + -e 's,__INCLUDEDIR__,${INCLUDEDIR},g' \ + -e 's,__LIBDIR__,${LIBDIR},g' \ + -e "s,__ATF_VERSION__,$$(cat atf-version),g" \ + <${ATF}/atf-c++/atf-c++.pc.in >atf-c++.pc + +beforeinstall: + ${INSTALL} -C -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ + atf-c++.pc ${DESTDIR}${LIBDATADIR}/pkgconfig + ${INSTALL} -C -o ${SHAREOWN} -g ${SHAREGRP} -m ${SHAREMODE} \ + ${ATF}/atf-c++/atf-c++.m4 ${DESTDIR}${SHAREDIR}/aclocal + +.if ${MK_TESTS} != "no" +SUBDIR= tests +.endif + +.include "../common.mk" .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..c5a1d24 --- /dev/null +++ b/lib/atf/libatf-c++/tests/Makefile @@ -0,0 +1,31 @@ +# $FreeBSD$ + +.include <bsd.init.mk> + +TESTSDIR= ${TESTSBASE}/lib/atf/libatf-c++ +TESTS_SUBDIRS= detail + +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 + +.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 + +.include <bsd.test.mk> diff --git a/lib/atf/libatf-c++/tests/Makefile.inc b/lib/atf/libatf-c++/tests/Makefile.inc new file mode 100644 index 0000000..265f86d --- /dev/null +++ b/lib/atf/libatf-c++/tests/Makefile.inc @@ -0,0 +1,3 @@ +# $FreeBSD$ + +.include "../Makefile.inc" diff --git a/lib/atf/libatf-c++/tests/detail/Makefile b/lib/atf/libatf-c++/tests/detail/Makefile new file mode 100644 index 0000000..b3fd4dc --- /dev/null +++ b/lib/atf/libatf-c++/tests/detail/Makefile @@ -0,0 +1,32 @@ +# $FreeBSD$ + +.include <bsd.init.mk> + +TESTSDIR= ${TESTSBASE}/lib/atf/libatf-c++/detail + +ATF= ${.CURDIR:H:H:H:H:H}/contrib/atf +.PATH: ${ATF}/atf-c++/detail + +CFLAGS+= -I${ATF} + +.for _T in application_test \ + env_test \ + exceptions_test \ + fs_test \ + process_test \ + sanity_test \ + text_test +ATF_TESTS_CXX+= ${_T} +SRCS.${_T}= ${_T}.cpp test_helpers.cpp +.endfor + +.for p in version_helper +PROGS_CXX+= ${p} +SRCS.${p}= ${p}.cpp +MAN.${p}= # defined +BINDIR.${p}= ${TESTSDIR} +.endfor +version_helper.o: atf-version + +.include "../../../common.mk" +.include <bsd.test.mk> diff --git a/lib/atf/libatf-c/Makefile b/lib/atf/libatf-c/Makefile index 26fba5c..69c4611 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,25 @@ INCSDIR_atf-c.h= ${INCLUDEDIR} MAN= atf-c-api.3 +all: atf-c.pc +atf-c.pc: atf-c.pc.in atf-version + sed -e 's,__CC__,${CC},g' \ + -e 's,__INCLUDEDIR__,${INCLUDEDIR},g' \ + -e 's,__LIBDIR__,${LIBDIR},g' \ + -e "s,__ATF_VERSION__,$$(cat atf-version),g" \ + <${ATF}/atf-c/atf-c.pc.in >atf-c.pc + +beforeinstall: + ${INSTALL} -C -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ + atf-c.pc ${DESTDIR}${LIBDATADIR}/pkgconfig + ${INSTALL} -C -o ${SHAREOWN} -g ${SHAREGRP} -m ${SHAREMODE} \ + ${ATF}/atf-c/atf-common.m4 ${DESTDIR}${SHAREDIR}/aclocal + ${INSTALL} -C -o ${SHAREOWN} -g ${SHAREGRP} -m ${SHAREMODE} \ + ${ATF}/atf-c/atf-c.m4 ${DESTDIR}${SHAREDIR}/aclocal + +.if ${MK_TESTS} != "no" +SUBDIR= tests +.endif + +.include "../common.mk" .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..1a091d3 --- /dev/null +++ b/lib/atf/libatf-c/tests/Makefile @@ -0,0 +1,38 @@ +# $FreeBSD$ + +.include <bsd.init.mk> + +TESTSDIR= ${TESTSBASE}/lib/atf/libatf-c +TESTS_SUBDIRS= detail + +ATF= ${.CURDIR:H:H:H:H}/contrib/atf +.PATH: ${ATF}/atf-c +.PATH: ${ATF}/atf-c/detail + +CFLAGS+= -I${ATF} + +# 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.clang+= -Wno-duplicate-decl-specifier + +FILESDIR= ${TESTSDIR} +FILES= macros_h_test.c +FILES+= unused_test.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 + +.include <bsd.test.mk> diff --git a/lib/atf/libatf-c/tests/Makefile.inc b/lib/atf/libatf-c/tests/Makefile.inc new file mode 100644 index 0000000..265f86d --- /dev/null +++ b/lib/atf/libatf-c/tests/Makefile.inc @@ -0,0 +1,3 @@ +# $FreeBSD$ + +.include "../Makefile.inc" diff --git a/lib/atf/libatf-c/tests/detail/Makefile b/lib/atf/libatf-c/tests/detail/Makefile new file mode 100644 index 0000000..aa85aa3 --- /dev/null +++ b/lib/atf/libatf-c/tests/detail/Makefile @@ -0,0 +1,34 @@ +# $FreeBSD$ + +.include <bsd.init.mk> + +TESTSDIR= ${TESTSBASE}/lib/atf/libatf-c/detail + +ATF= ${.CURDIR:H:H:H:H:H}/contrib/atf +.PATH: ${ATF}/atf-c/detail + +CFLAGS+= -I${ATF} + +.for _T in dynstr_test \ + env_test \ + fs_test \ + list_test \ + map_test \ + process_test \ + sanity_test \ + text_test \ + user_test +ATF_TESTS_C+= ${_T} +SRCS.${_T}= ${_T}.c test_helpers.c +.endfor + +.for p in process_helpers version_helper +PROGS+= ${p} +SRCS.${p}= ${p}.c +MAN.${p}= # defined +BINDIR.${p}= ${TESTSDIR} +.endfor +version_helper.o: atf-version + +.include "../../../common.mk" +.include <bsd.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..b0c1c23 --- /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 meta_data_test result_test srcdir_test +ATF_TESTS_SH+= ${_T} +ATF_TESTS_SH_SRC_${_T}= common.sh ${_T}.sh +.endfor + +.include <bsd.test.mk> |