19 const std::string option_prefix=
"--gtest_output=xml";
20 const size_t prefix_len=option_prefix.size();
21 const std::string srank=std::to_string(irank);
23 for (
int i=1; i<argc; ++i) {
24 std::string arg(argv[i]);
25 if (arg.compare(0,prefix_len,option_prefix)!=0)
continue;
26 arg.replace(0,prefix_len,
"",0);
29 arg_new=
":test_details"+srank+
".xml";
31 if (arg[0]!=
':')
continue;
32 if (arg[arg.size()-1]==
'/') {
33 arg_new=arg.substr(0,arg.size()-1)+srank+
"/";
36 arg_new=arg.substr(0,arg.size()-ext.size())
40 std::string new_argv_i=option_prefix+arg_new;
41 argv[i]=
new char[new_argv_i.size()+1];
43 keeper_.push_back(argv[i]);
44 strcpy(argv[i],new_argv_i.c_str());
50 for(
char* p : keeper_) {
void operator()(unsigned int irank, int argc, char **argv)
Tweaks (argc,argv) to redirect GTest XML output to different files.
virtual ~gtest_par_xml_output()
std::string get_extension(const std::string &filename)
Returns the file name extension.