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>
This commit is contained in:
parent
021a0587d1
commit
5686c6c38a
@ -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] << " "
|
||||
|
@ -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());
|
||||
|
@ -82,8 +82,12 @@ 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)
|
||||
{
|
||||
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";
|
||||
}
|
||||
|
@ -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*);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user