From 762c167edefe606d9e9fcf2b3455a54ceb0a32f2 Mon Sep 17 00:00:00 2001 From: Julio Merino Date: Fri, 10 Jan 2014 23:38:33 +0000 Subject: [PATCH] Respect the original layout of the atf-{c,c++} tests. Put test programs for internal modules into a 'detail' subdirectory of the libatf-c and libatf-c++ test directories, just as the upstream distribution does. This is necessary because the tests assume such layout to find the process_helper program, and currently fail because of this divergence. MFC after: 1 week --- etc/mtree/BSD.tests.dist | 4 ++++ lib/atf/libatf-c++/tests/Makefile | 18 +------------- lib/atf/libatf-c++/tests/Makefile.inc | 3 +++ lib/atf/libatf-c++/tests/detail/Makefile | 26 ++++++++++++++++++++ lib/atf/libatf-c/tests/Makefile | 23 +----------------- lib/atf/libatf-c/tests/Makefile.inc | 3 +++ lib/atf/libatf-c/tests/detail/Makefile | 30 ++++++++++++++++++++++++ tools/build/mk/OptionalObsoleteFiles.inc | 20 ++++++++++++++++ 8 files changed, 88 insertions(+), 39 deletions(-) create mode 100644 lib/atf/libatf-c++/tests/Makefile.inc create mode 100644 lib/atf/libatf-c++/tests/detail/Makefile create mode 100644 lib/atf/libatf-c/tests/Makefile.inc create mode 100644 lib/atf/libatf-c/tests/detail/Makefile diff --git a/etc/mtree/BSD.tests.dist b/etc/mtree/BSD.tests.dist index b7ebbb9949a6..2d5d8a98cddd 100644 --- a/etc/mtree/BSD.tests.dist +++ b/etc/mtree/BSD.tests.dist @@ -49,8 +49,12 @@ lib atf libatf-c + detail + .. .. libatf-c++ + detail + .. .. test-programs .. diff --git a/lib/atf/libatf-c++/tests/Makefile b/lib/atf/libatf-c++/tests/Makefile index db10fce8dceb..1ab5fdaa6e4c 100644 --- a/lib/atf/libatf-c++/tests/Makefile +++ b/lib/atf/libatf-c++/tests/Makefile @@ -3,6 +3,7 @@ .include 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 diff --git a/lib/atf/libatf-c++/tests/Makefile.inc b/lib/atf/libatf-c++/tests/Makefile.inc new file mode 100644 index 000000000000..265f86d1ed55 --- /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 000000000000..e4ed1a5f2727 --- /dev/null +++ b/lib/atf/libatf-c++/tests/detail/Makefile @@ -0,0 +1,26 @@ +# $FreeBSD$ + +.include + +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 diff --git a/lib/atf/libatf-c/tests/Makefile b/lib/atf/libatf-c/tests/Makefile index a5c2836f677c..14b199f591bb 100644 --- a/lib/atf/libatf-c/tests/Makefile +++ b/lib/atf/libatf-c/tests/Makefile @@ -3,6 +3,7 @@ .include 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 diff --git a/lib/atf/libatf-c/tests/Makefile.inc b/lib/atf/libatf-c/tests/Makefile.inc new file mode 100644 index 000000000000..265f86d1ed55 --- /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 000000000000..82bbf6f0d7cb --- /dev/null +++ b/lib/atf/libatf-c/tests/detail/Makefile @@ -0,0 +1,30 @@ +# $FreeBSD$ + +.include + +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 diff --git a/tools/build/mk/OptionalObsoleteFiles.inc b/tools/build/mk/OptionalObsoleteFiles.inc index 0b886b42f96b..eb23eddafa26 100644 --- a/tools/build/mk/OptionalObsoleteFiles.inc +++ b/tools/build/mk/OptionalObsoleteFiles.inc @@ -4066,6 +4066,26 @@ OLD_FILES+=usr/share/man/man8/telnetd.8.gz .if ${MK_TESTS} == yes OLD_FILES+=usr/tests/lib/atf/libatf-c/test_helpers_test OLD_FILES+=usr/tests/lib/atf/test-programs/fork_test +OLD_FILES+=usr/tests/lib/atf/libatf-c++/application_test +OLD_FILES+=usr/tests/lib/atf/libatf-c++/env_test +OLD_FILES+=usr/tests/lib/atf/libatf-c++/exceptions_test +OLD_FILES+=usr/tests/lib/atf/libatf-c++/expand_test +OLD_FILES+=usr/tests/lib/atf/libatf-c++/fs_test +OLD_FILES+=usr/tests/lib/atf/libatf-c++/parser_test +OLD_FILES+=usr/tests/lib/atf/libatf-c++/process_test +OLD_FILES+=usr/tests/lib/atf/libatf-c++/sanity_test +OLD_FILES+=usr/tests/lib/atf/libatf-c++/text_test +OLD_FILES+=usr/tests/lib/atf/libatf-c++/ui_test +OLD_FILES+=usr/tests/lib/atf/libatf-c/dynstr_test +OLD_FILES+=usr/tests/lib/atf/libatf-c/env_test +OLD_FILES+=usr/tests/lib/atf/libatf-c/fs_test +OLD_FILES+=usr/tests/lib/atf/libatf-c/list_test +OLD_FILES+=usr/tests/lib/atf/libatf-c/map_test +OLD_FILES+=usr/tests/lib/atf/libatf-c/process_helpers +OLD_FILES+=usr/tests/lib/atf/libatf-c/process_test +OLD_FILES+=usr/tests/lib/atf/libatf-c/sanity_test +OLD_FILES+=usr/tests/lib/atf/libatf-c/text_test +OLD_FILES+=usr/tests/lib/atf/libatf-c/user_test .else # ATF libraries. OLD_FILES+=usr/bin/atf-sh