On Feb 19, 2014, at 2:01 PM, Richard
[Please do not mail me a copy of your followup]
boost-users@lists.boost.org spake the secret code <4075154.HSbG0KVyOh@arlin17> thusly:
BOOST_AUTO_TEST_CASE( mpi_functionality_parenv_init ) { MPI_Init(&m_argc,&m_argv); }
BOOST_AUTO_TEST_CASE( mpi_functionality_parenv_finalize ) { MPI_Finalize(); }
These aren't separate test cases, they are setup/teardown for an individual test case.
http://www.open-mpi.org/doc/v1.4/man3/MPI_Init.3.php and http://www.open-mpi.org/doc/v1.4/man3/MPI_Finalize.3.php indicate that these two functions should always be paired.
Furthermore, not even MPI_Init can be called after MPI_Finalize. Therefore, you can't call these pairs of functions once per test case or once per fixture, you can only call them once per process.
Therefore, you probably want to write your own implementation of main() that handles MPI_Init and MPI_Finalize before calling the test runner.
A global fixture seems like a more appropriate solution than implementing main(). BOOST_GLOBAL_FIXTURE http://www.boost.org/doc/libs/1_55_0/libs/test/doc/html/utf/user-guide/fixtu...