Skip to content
Snippets Groups Projects
Commit 86f3e91a authored by Stéphane Del Pino's avatar Stéphane Del Pino
Browse files

Plug MPI tests even when MPI is not used to build the code

This allows to test Messenger functionalities even for sequential builds
parent 3dbec436
No related branches found
No related tags found
1 merge request!11Feature/mpi
...@@ -13,12 +13,10 @@ add_executable (unit_tests ...@@ -13,12 +13,10 @@ add_executable (unit_tests
test_TinyVector.cpp test_TinyVector.cpp
) )
if (${PASTIS_HAS_MPI})
add_executable (mpi_unit_tests add_executable (mpi_unit_tests
mpi_test_main.cpp mpi_test_main.cpp
mpi_test_Messenger.cpp mpi_test_Messenger.cpp
) )
endif()
target_include_directories(Catch2 INTERFACE ${CATCH_INCLUDE_DIR}) target_include_directories(Catch2 INTERFACE ${CATCH_INCLUDE_DIR})
...@@ -28,7 +26,6 @@ target_link_libraries (unit_tests ...@@ -28,7 +26,6 @@ target_link_libraries (unit_tests
Catch2 Catch2
) )
if (${PASTIS_HAS_MPI})
target_link_libraries (mpi_unit_tests target_link_libraries (mpi_unit_tests
PastisUtils PastisUtils
kokkos kokkos
...@@ -36,7 +33,6 @@ if (${PASTIS_HAS_MPI}) ...@@ -36,7 +33,6 @@ if (${PASTIS_HAS_MPI})
${MPI_CXX_LINK_FLAGS} ${MPI_CXX_LIBRARIES} ${MPI_CXX_LINK_FLAGS} ${MPI_CXX_LIBRARIES}
Catch2 Catch2
) )
endif()
enable_testing() enable_testing()
...@@ -48,9 +44,10 @@ if (${PASTIS_HAS_MPI}) ...@@ -48,9 +44,10 @@ if (${PASTIS_HAS_MPI})
${MPIEXEC_PREFLAGS} ${MPIEXEC_PREFLAGS}
${PASTIS_BINARY_DIR}/mpi_unit_tests ${PASTIS_BINARY_DIR}/mpi_unit_tests
${MPIEXEC_POSTFLAGS}) ${MPIEXEC_POSTFLAGS})
else()
add_test(mpi_unit_tests ${PASTIS_BINARY_DIR}/mpi_unit_tests)
endif()
# Should patch ParseAndAddCatchTests macro to allow additional command parameter # Should patch ParseAndAddCatchTests macro to allow additional command parameter
# to launch tests # to launch tests
set_tests_properties("mpi_unit_tests" PROPERTIES FAIL_REGULAR_EXPRESSION "No tests ran" set_tests_properties("mpi_unit_tests" PROPERTIES FAIL_REGULAR_EXPRESSION "No tests ran" LABELS "mpi")
LABELS "mpi")
endif()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment