diff options
author | marcel <marcel@FreeBSD.org> | 2013-05-29 19:41:36 +0000 |
---|---|---|
committer | marcel <marcel@FreeBSD.org> | 2013-05-29 19:41:36 +0000 |
commit | fbbd9fba54c1702c0bd1eb59914184cd73f191fa (patch) | |
tree | a76537d5285dbee6695f7761f451f0f96d2d16d0 /contrib/atf | |
parent | d095ed802f385ba9dd5e1d6308ac489c95ae3841 (diff) | |
download | FreeBSD-src-fbbd9fba54c1702c0bd1eb59914184cd73f191fa.zip FreeBSD-src-fbbd9fba54c1702c0bd1eb59914184cd73f191fa.tar.gz |
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>
Diffstat (limited to 'contrib/atf')
-rw-r--r-- | contrib/atf/atf-c++/check_test.cpp | 4 | ||||
-rw-r--r-- | contrib/atf/atf-c++/detail/process_test.cpp | 4 | ||||
-rw-r--r-- | contrib/atf/atf-c++/detail/test_helpers.cpp | 10 | ||||
-rw-r--r-- | contrib/atf/atf-c++/detail/test_helpers.hpp | 2 |
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 fd528e9..a4c4993 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 d13ab94..a40f663 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 42bd711..107b45a 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 059a0a5..1f9c41c 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*); |