c++ - Unit-testing MPI Programs with gtest -
i'm parallelizing existent application uses gtest mpi. in mpi programs, first thing initialize environment call
mpi_init( int *argc, char ***argv )
at end of mpi program root process should call mpi_finalize. how can write unit-tests such application using google test?
in particular, how access argc, , argv tests before gtest modifies them.
right 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.
are sure want access argc
, argv
values before googletest? modified remove googletest specific arguments such --gtest_filter
application not see them.
i think want using following snippet main
:
int main(int argc, char* argv[]) { int result = 0; ::testing::initgoogletest(&argc, argv); mpi_init(&argc, &argv); result = run_all_tests(); mpi_finalize(); return result; }
Comments
Post a Comment