Skip to content

Commit

Permalink
Update serial unit test command for MPI
Browse files Browse the repository at this point in the history
  • Loading branch information
ckendrick committed Sep 24, 2024
1 parent 05358fa commit 6d8e2cf
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
4 changes: 3 additions & 1 deletion unit_tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@ foreach(stem IN LISTS unit_test_stems)
target_compile_features(test_${stem} PRIVATE cxx_std_11)
target_compile_definitions(test_${stem} PRIVATE CAROM_HAS_GTEST)

add_test(NAME test_${stem} COMMAND test_${stem})
# serial tests
set(test_command sh -c "${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} 1 ${MPIEXEC_PREFLAGS} test_${stem}")
add_test(NAME test_${stem} COMMAND ${test_command})
endforeach(stem)

# Add parallel tests
Expand Down
4 changes: 3 additions & 1 deletion unit_tests/test_DEIM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,9 @@ int main(int argc, char* argv[])
{
::testing::InitGoogleTest(&argc, argv);
MPI_Init(&argc, &argv);
return RUN_ALL_TESTS();
int result = RUN_ALL_TESTS();
MPI_Finalize();
return result;
}
#else // #ifndef CAROM_HAS_GTEST
int main()
Expand Down
4 changes: 3 additions & 1 deletion unit_tests/test_GNAT.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,9 @@ int main(int argc, char* argv[])
{
::testing::InitGoogleTest(&argc, argv);
MPI_Init(&argc, &argv);
return RUN_ALL_TESTS();
int result = RUN_ALL_TESTS();
MPI_Finalize();
return result;
}
#else // #ifndef CAROM_HAS_GTEST
int main()
Expand Down
4 changes: 3 additions & 1 deletion unit_tests/test_QDEIM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,9 @@ int main(int argc, char* argv[])
{
::testing::InitGoogleTest(&argc, argv);
MPI_Init(&argc, &argv);
return RUN_ALL_TESTS();
int result = RUN_ALL_TESTS();
MPI_Finalize();
return result;
}
#else // #ifndef CAROM_HAS_GTEST
int main()
Expand Down

0 comments on commit 6d8e2cf

Please sign in to comment.