summaryrefslogtreecommitdiff
path: root/contrib/atf
diff options
context:
space:
mode:
authorMarcel Moolenaar <marcel@FreeBSD.org>2013-05-29 19:41:36 +0000
committerMarcel Moolenaar <marcel@FreeBSD.org>2013-05-29 19:41:36 +0000
commit5686c6c38a3e1cc78804eaf5f880bda23dcf592f (patch)
treea76537d5285dbee6695f7761f451f0f96d2d16d0 /contrib/atf
parent021a0587d1dfff502c45d59a8fe5289f1d02dcfd (diff)
downloadsrc-test-5686c6c38a3e1cc78804eaf5f880bda23dcf592f.tar.gz
src-test-5686c6c38a3e1cc78804eaf5f880bda23dcf592f.zip
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>
Notes
Notes: svn path=/head/; revision=251108
Diffstat (limited to 'contrib/atf')
-rw-r--r--contrib/atf/atf-c++/check_test.cpp4
-rw-r--r--contrib/atf/atf-c++/detail/process_test.cpp4
-rw-r--r--contrib/atf/atf-c++/detail/test_helpers.cpp10
-rw-r--r--contrib/atf/atf-c++/detail/test_helpers.hpp2
4 files changed, 12 insertions, 8 deletions
diff --git a/contrib/atf/atf-c++/check_test.cpp b/contrib/atf/atf-c++/check_test.cpp
index fd528e9d31a76..a4c499388b8f4 100644
--- a/contrib/atf/atf-c++/check_test.cpp
+++ b/contrib/atf/atf-c++/check_test.cpp
@@ -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] << " "
diff --git a/contrib/atf/atf-c++/detail/process_test.cpp b/contrib/atf/atf-c++/detail/process_test.cpp
index d13ab9453a8cb..a40f663108f30 100644
--- a/contrib/atf/atf-c++/detail/process_test.cpp
+++ b/contrib/atf/atf-c++/detail/process_test.cpp
@@ -64,10 +64,10 @@ exec_process_helpers(const atf::tests::tc& tc, const char* helper_name)
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());
diff --git a/contrib/atf/atf-c++/detail/test_helpers.cpp b/contrib/atf/atf-c++/detail/test_helpers.cpp
index 42bd711dc7d63..107b45a9403fb 100644
--- a/contrib/atf/atf-c++/detail/test_helpers.cpp
+++ b/contrib/atf/atf-c++/detail/test_helpers.cpp
@@ -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
diff --git a/contrib/atf/atf-c++/detail/test_helpers.hpp b/contrib/atf/atf-c++/detail/test_helpers.hpp
index 059a0a5b4b7b8..1f9c41c2fd835 100644
--- a/contrib/atf/atf-c++/detail/test_helpers.hpp
+++ b/contrib/atf/atf-c++/detail/test_helpers.hpp
@@ -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*);