aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulio Merino <jmmv@FreeBSD.org>2014-01-10 23:41:01 +0000
committerJulio Merino <jmmv@FreeBSD.org>2014-01-10 23:41:01 +0000
commitb17b15d8ea55f8cb4c5a3bdfae755c545d10aea2 (patch)
tree053446401422ce3978c4348969f0db285c9abc62
parent762c167edefe606d9e9fcf2b3455a54ceb0a32f2 (diff)
Notes
-rw-r--r--contrib/atf/atf-c++/detail/test_helpers.cpp29
-rw-r--r--lib/atf/Makefile.inc1
2 files changed, 24 insertions, 6 deletions
diff --git a/contrib/atf/atf-c++/detail/test_helpers.cpp b/contrib/atf/atf-c++/detail/test_helpers.cpp
index dc35da96be030..92f588d725b7f 100644
--- a/contrib/atf/atf-c++/detail/test_helpers.cpp
+++ b/contrib/atf/atf-c++/detail/test_helpers.cpp
@@ -40,6 +40,18 @@
#include "process.hpp"
#include "test_helpers.hpp"
+// Path to the directory containing the libatf-c tests, used to locate the
+// process_helpers program. If NULL (the default), the code will use a
+// relative path. Otherwise, the provided path will be used; this is so
+// that we can locate the helpers binary if the installation uses a
+// different layout than the one we provide (as is the case in FreeBSD).
+#if defined(ATF_C_TESTS_BASE)
+static const char* atf_c_tests_base = ATF_C_TESTS_BASE;
+#else
+static const char* atf_c_tests_base = NULL;
+#endif
+#undef ATF_C_TESTS_BASE
+
void
build_check_cxx_o_aux(const atf::fs::path& sfile, const char* failmsg,
const bool expect_pass)
@@ -80,12 +92,17 @@ header_check(const char *hdrname)
atf::fs::path
get_process_helpers_path(const atf::tests::tc& tc, bool is_detail)
{
- if (is_detail)
- return atf::fs::path(tc.get_config_var("srcdir")) /
- ".." / ".." / "atf-c" / "detail" / "process_helpers";
- else
- return atf::fs::path(tc.get_config_var("srcdir")) /
- ".." / "atf-c" / "detail" / "process_helpers";
+ const char* helper = "detail/process_helpers";
+ if (atf_c_tests_base == NULL) {
+ if (is_detail)
+ return atf::fs::path(tc.get_config_var("srcdir")) /
+ ".." / ".." / "atf-c" / helper;
+ else
+ return atf::fs::path(tc.get_config_var("srcdir")) /
+ ".." / "atf-c" / helper;
+ } else {
+ return atf::fs::path(atf_c_tests_base) / helper;
+ }
}
void
diff --git a/lib/atf/Makefile.inc b/lib/atf/Makefile.inc
index 15e7517f0bc5f..40da94673e121 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}"'