svn commit: r260526 - in head: contrib/atf/atf-c++/detail lib/atf

Julio Merino jmmv at FreeBSD.org
Fri Jan 10 23:41:02 UTC 2014


Author: jmmv
Date: Fri Jan 10 23:41:01 2014
New Revision: 260526
URL: http://svnweb.freebsd.org/changeset/base/260526

Log:
  Fix path to the process_helpers for the libatf-c++ tests.
  
  Because we respect the FreeBSD src tree layout under /usr/tests, and because
  the layout of the tests in the atf distfile does not match the former, the
  tests for atf-c++ were not able to find the process_helper binary.
  
  Fix this by explicitly hardcoding the right path in the FreeBSD test suite.
  
  Obtained from:	atf (git 1f0e878f7f127741a3762883ef24aef317e239d5)
  MFC after:	1 week

Modified:
  head/contrib/atf/atf-c++/detail/test_helpers.cpp
  head/lib/atf/Makefile.inc

Modified: head/contrib/atf/atf-c++/detail/test_helpers.cpp
==============================================================================
--- head/contrib/atf/atf-c++/detail/test_helpers.cpp	Fri Jan 10 23:38:33 2014	(r260525)
+++ head/contrib/atf/atf-c++/detail/test_helpers.cpp	Fri Jan 10 23:41:01 2014	(r260526)
@@ -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

Modified: head/lib/atf/Makefile.inc
==============================================================================
--- head/lib/atf/Makefile.inc	Fri Jan 10 23:38:33 2014	(r260525)
+++ head/lib/atf/Makefile.inc	Fri Jan 10 23:41:01 2014	(r260526)
@@ -38,6 +38,7 @@ CFLAGS+=	-DATF_BUILD_CPPFLAGS='"${_CPPFL
 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}"'


More information about the svn-src-all mailing list