Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 29 May 2013 19:41:36 +0000 (UTC)
From:      Marcel Moolenaar <marcel@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r251108 - in head/contrib/atf/atf-c++: . detail
Message-ID:  <201305291941.r4TJfaWN022025@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: marcel
Date: Wed May 29 19:41:36 2013
New Revision: 251108
URL: http://svnweb.freebsd.org/changeset/base/251108

Log:
  Modify atf::fs::path::get_process_helpers_path API to properly
  handle pathing with detail/ tests. Based on patch pushed upstream to
  ATF project.
  
  Obtained from:	Garrett Cooper <yaneurabeya@gmail.com>

Modified:
  head/contrib/atf/atf-c++/check_test.cpp
  head/contrib/atf/atf-c++/detail/process_test.cpp
  head/contrib/atf/atf-c++/detail/test_helpers.cpp
  head/contrib/atf/atf-c++/detail/test_helpers.hpp

Modified: head/contrib/atf/atf-c++/check_test.cpp
==============================================================================
--- head/contrib/atf/atf-c++/check_test.cpp	Wed May 29 19:16:59 2013	(r251107)
+++ head/contrib/atf/atf-c++/check_test.cpp	Wed May 29 19:41:36 2013	(r251108)
@@ -61,7 +61,7 @@ std::auto_ptr< atf::check::check_result 
 do_exec(const atf::tests::tc* tc, const char* helper_name)
 {
     std::vector< std::string > argv;
-    argv.push_back(get_process_helpers_path(*tc).str());
+    argv.push_back(get_process_helpers_path(*tc, false).str());
     argv.push_back(helper_name);
     std::cout << "Executing " << argv[0] << " " << argv[1] << "\n";
 
@@ -74,7 +74,7 @@ std::auto_ptr< atf::check::check_result 
 do_exec(const atf::tests::tc* tc, const char* helper_name, const char *carg2)
 {
     std::vector< std::string > argv;
-    argv.push_back(get_process_helpers_path(*tc).str());
+    argv.push_back(get_process_helpers_path(*tc, false).str());
     argv.push_back(helper_name);
     argv.push_back(carg2);
     std::cout << "Executing " << argv[0] << " " << argv[1] << " "

Modified: head/contrib/atf/atf-c++/detail/process_test.cpp
==============================================================================
--- head/contrib/atf/atf-c++/detail/process_test.cpp	Wed May 29 19:16:59 2013	(r251107)
+++ head/contrib/atf/atf-c++/detail/process_test.cpp	Wed May 29 19:41:36 2013	(r251108)
@@ -64,10 +64,10 @@ exec_process_helpers(const atf::tests::t
     using atf::process::exec;
 
     std::vector< std::string > argv;
-    argv.push_back(get_process_helpers_path(tc).leaf_name());
+    argv.push_back(get_process_helpers_path(tc, true).leaf_name());
     argv.push_back(helper_name);
 
-    return exec(get_process_helpers_path(tc),
+    return exec(get_process_helpers_path(tc, true),
                 atf::process::argv_array(argv),
                 atf::process::stream_inherit(),
                 atf::process::stream_inherit());

Modified: head/contrib/atf/atf-c++/detail/test_helpers.cpp
==============================================================================
--- head/contrib/atf/atf-c++/detail/test_helpers.cpp	Wed May 29 19:16:59 2013	(r251107)
+++ head/contrib/atf/atf-c++/detail/test_helpers.cpp	Wed May 29 19:41:36 2013	(r251108)
@@ -82,10 +82,14 @@ header_check(const char *hdrname)
 }
 
 atf::fs::path
-get_process_helpers_path(const atf::tests::tc& tc)
+get_process_helpers_path(const atf::tests::tc& tc, bool is_detail)
 {
-    return atf::fs::path(tc.get_config_var("srcdir")) /
-           ".." / "atf-c" / "detail" / "process_helpers";
+    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";
 }
 
 bool

Modified: head/contrib/atf/atf-c++/detail/test_helpers.hpp
==============================================================================
--- head/contrib/atf/atf-c++/detail/test_helpers.hpp	Wed May 29 19:16:59 2013	(r251107)
+++ head/contrib/atf/atf-c++/detail/test_helpers.hpp	Wed May 29 19:41:36 2013	(r251108)
@@ -86,7 +86,7 @@ class tc;
 
 void header_check(const char*);
 void build_check_cxx_o(const atf::tests::tc&, const char*, const char*, bool);
-atf::fs::path get_process_helpers_path(const atf::tests::tc&);
+atf::fs::path get_process_helpers_path(const atf::tests::tc&, bool);
 bool grep_file(const char*, const char*);
 bool grep_string(const std::string&, const char*);
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201305291941.r4TJfaWN022025>