diff options
author | jmmv <jmmv@FreeBSD.org> | 2014-03-06 13:20:38 +0000 |
---|---|---|
committer | jmmv <jmmv@FreeBSD.org> | 2014-03-06 13:20:38 +0000 |
commit | 16411e2c8037afd4bccaee5ea6892c2b98c2193e (patch) | |
tree | 67423e5f21e64a707fbeb882b3c143610ee4511f /lib/atf | |
parent | 1d275c07c24a6ac00d3d1401553e8ccf196a4ad7 (diff) | |
download | FreeBSD-src-16411e2c8037afd4bccaee5ea6892c2b98c2193e.zip FreeBSD-src-16411e2c8037afd4bccaee5ea6892c2b98c2193e.tar.gz |
MFC various fixes for the ATF tests.
- r260505 Allow tests to provide a Kyuafile when they relied on auto-generation.
- r260525 Respect the original layout of the atf-{c,c++} tests.
- r260526 Fix path to the process_helpers for the libatf-c++ tests.
- r260576 Generate and install pkg-config files for atf.
- r260577 Add atf pkg-config files from the vendor branch.
- r260584 Prevent misc_helpers from running as a test.
Diffstat (limited to 'lib/atf')
-rw-r--r-- | lib/atf/Makefile.inc | 1 | ||||
-rw-r--r-- | lib/atf/common.mk | 19 | ||||
-rw-r--r-- | lib/atf/libatf-c++/Makefile | 13 | ||||
-rw-r--r-- | lib/atf/libatf-c++/tests/Makefile | 18 | ||||
-rw-r--r-- | lib/atf/libatf-c++/tests/Makefile.inc | 3 | ||||
-rw-r--r-- | lib/atf/libatf-c++/tests/detail/Makefile | 26 | ||||
-rw-r--r-- | lib/atf/libatf-c/Makefile | 13 | ||||
-rw-r--r-- | lib/atf/libatf-c/tests/Makefile | 23 | ||||
-rw-r--r-- | lib/atf/libatf-c/tests/Makefile.inc | 3 | ||||
-rw-r--r-- | lib/atf/libatf-c/tests/detail/Makefile | 30 |
10 files changed, 110 insertions, 39 deletions
diff --git a/lib/atf/Makefile.inc b/lib/atf/Makefile.inc index 15e7517..40da946 100644 --- a/lib/atf/Makefile.inc +++ b/lib/atf/Makefile.inc @@ -38,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 f1d9dcf..ff05da7 100644 --- a/lib/atf/libatf-c++/Makefile +++ b/lib/atf/libatf-c++/Makefile @@ -76,8 +76,21 @@ 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 + .if ${MK_TESTS} != "no" SUBDIR= tests .endif +.include "../common.mk" .include <bsd.lib.mk> diff --git a/lib/atf/libatf-c++/tests/Makefile b/lib/atf/libatf-c++/tests/Makefile index db10fce..1ab5fda 100644 --- a/lib/atf/libatf-c++/tests/Makefile +++ b/lib/atf/libatf-c++/tests/Makefile @@ -3,6 +3,7 @@ .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++ @@ -14,7 +15,6 @@ 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 \ @@ -28,20 +28,4 @@ SRCS.${_T}= ${_T}.cpp test_helpers.cpp 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++/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..e4ed1a5 --- /dev/null +++ b/lib/atf/libatf-c++/tests/detail/Makefile @@ -0,0 +1,26 @@ +# $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 \ + 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 b197958..829f8ff 100644 --- a/lib/atf/libatf-c/Makefile +++ b/lib/atf/libatf-c/Makefile @@ -74,8 +74,21 @@ 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 + .if ${MK_TESTS} != "no" SUBDIR= tests .endif +.include "../common.mk" .include <bsd.lib.mk> diff --git a/lib/atf/libatf-c/tests/Makefile b/lib/atf/libatf-c/tests/Makefile index a5c2836..14b199f 100644 --- a/lib/atf/libatf-c/tests/Makefile +++ b/lib/atf/libatf-c/tests/Makefile @@ -3,6 +3,7 @@ .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 @@ -19,8 +20,6 @@ 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 \ @@ -36,24 +35,4 @@ SRCS.${_T}= ${_T}.c test_helpers.c 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 \ - 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/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..82bbf6f --- /dev/null +++ b/lib/atf/libatf-c/tests/detail/Makefile @@ -0,0 +1,30 @@ +# $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 + +PROGS+= process_helpers +SRCS.process_helpers= process_helpers.c +MAN.process_helpers= # defined +BINDIR.process_helpers= ${TESTSDIR} + +.include <atf.test.mk> |