ALPSCore reference
Public Member Functions | List of all members
alps::gtest_par_xml_output Class Reference

Functor class to tweak (argc,argv). More...

#include <gtest_par_xml_output.hpp>

Collaboration diagram for alps::gtest_par_xml_output:
Collaboration graph

Public Member Functions

virtual ~gtest_par_xml_output ()
 
void operator() (unsigned int irank, int argc, char **argv)
 Tweaks (argc,argv) to redirect GTest XML output to different files. More...
 

Detailed Description

Functor class to tweak (argc,argv).

Its intended use is for unit tests that use Google Test and are run in parallel via MPI. Suggested use:

int main(int argc, char**argv) {
  alps::mpi::environment env(argc, argv);
  gtest_par_xml_output tweak; // holds the memory
  tweak(argc, argv, alps::mpi::communicator().rank() ); // does tweaking
  ::testing::InitGoogleTest(&argc, argv);

..... destructor releases the memory }

Definition at line 31 of file gtest_par_xml_output.hpp.

Constructor & Destructor Documentation

alps::gtest_par_xml_output::~gtest_par_xml_output ( )
virtual

Definition at line 48 of file gtest_par_xml_output.cpp.

Member Function Documentation

void alps::gtest_par_xml_output::operator() ( unsigned int  irank,
int  argc,
char **  argv 
)

Tweaks (argc,argv) to redirect GTest XML output to different files.

Parameters
irank: A number added to XML output file name (usually, MPI rank)
argc: main()'s argc
argv: main()'s argv

This method scans argv[] for '–gtest=xml' argument and tweaks it by adding irank to the output file name (preserving the last extension, if any).

Definition at line 15 of file gtest_par_xml_output.cpp.


The documentation for this class was generated from the following files: