I'm parallelizing an already existent application that uses gTest with MPI. In MPI programs, the first thing to do is to initialize the environment with a call to
MPI_Init( int *argc, char ***argv )
At the end of an MPI program the root process should also call MPI_Finalize. How can I write unit-tests for such an application using Google Test?
In particular, how do I access argc, and argv from the tests before gTest modifies them.
Right now I'm doing:
int argc = 0;
char** argv = NULL;
boost::mpi::environment env(argc,argv);
TEST(component_test, test_name) {
// stuff using mpi
}
and feels wrong.