summaryrefslogtreecommitdiffstats
path: root/lib/atf/libatf-c
diff options
context:
space:
mode:
authorjmmv <jmmv@FreeBSD.org>2013-11-08 14:33:41 +0000
committerjmmv <jmmv@FreeBSD.org>2013-11-08 14:33:41 +0000
commita1626fee639681689e4cad1607256138d15f47a1 (patch)
treef0e3133bc90ad92cccea3722aa2d458865c00a41 /lib/atf/libatf-c
parent39ac592d96a91fc379d17655201b826e2da0d2e5 (diff)
downloadFreeBSD-src-a1626fee639681689e4cad1607256138d15f47a1.zip
FreeBSD-src-a1626fee639681689e4cad1607256138d15f47a1.tar.gz
Build and install the atf tests.
Reviewed by: freebsd-testing Approved by: rpaulo (mentor)
Diffstat (limited to 'lib/atf/libatf-c')
-rw-r--r--lib/atf/libatf-c/Makefile5
-rw-r--r--lib/atf/libatf-c/Makefile.inc3
-rw-r--r--lib/atf/libatf-c/tests/Makefile62
3 files changed, 70 insertions, 0 deletions
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..db04f1f
--- /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>
OpenPOWER on IntegriCloud