I'm trying to build some tests with googleTest which should test some MPI parallel code. Ideally I want our CI server to execute them through ctest
.
My naive approach was to simply call ctest with MPI
:
mpirun -n 3 ctest
However, this results in even trivial tests failing as long as at least two are executed.
Example of a trivial tests:
TEST(TestSuite, DummyTest1) {
EXPECT_TRUE(true);
}
TEST(TestSuite, DummyTest2) {
EXPECT_TRUE(true);
}
Am I supposed to launch ctest
in some other way? Or do I have to approach this completely differently?
Additional info:
- The tests are added via
gtest_discover_tests()
. - Launching the test executable directly with MPI (
mpirun -n 3 testExe
) yields successful tests but I would prefer usingctest
. - Version info:
- googletest: 1.11.0
- MPI: OpenMPI 4.0.3 AND MPICH 3.3.2