diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index e6bfb691be2567a5b15235b6b547f3e43cbead6a..b817c9a8949e73deb4dc3165e5f6e438f1aef3ab 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -13,12 +13,10 @@ add_executable (unit_tests test_TinyVector.cpp ) -if (${PASTIS_HAS_MPI}) - add_executable (mpi_unit_tests - mpi_test_main.cpp - mpi_test_Messenger.cpp - ) -endif() +add_executable (mpi_unit_tests + mpi_test_main.cpp + mpi_test_Messenger.cpp + ) target_include_directories(Catch2 INTERFACE ${CATCH_INCLUDE_DIR}) @@ -28,15 +26,13 @@ target_link_libraries (unit_tests Catch2 ) -if (${PASTIS_HAS_MPI}) - target_link_libraries (mpi_unit_tests - PastisUtils - kokkos - ${PARMETIS_LIBRARIES} - ${MPI_CXX_LINK_FLAGS} ${MPI_CXX_LIBRARIES} - Catch2 - ) -endif() +target_link_libraries (mpi_unit_tests + PastisUtils + kokkos + ${PARMETIS_LIBRARIES} + ${MPI_CXX_LINK_FLAGS} ${MPI_CXX_LIBRARIES} + Catch2 + ) enable_testing() @@ -48,9 +44,10 @@ if (${PASTIS_HAS_MPI}) ${MPIEXEC_PREFLAGS} ${PASTIS_BINARY_DIR}/mpi_unit_tests ${MPIEXEC_POSTFLAGS}) +else() + add_test(mpi_unit_tests ${PASTIS_BINARY_DIR}/mpi_unit_tests) +endif() # Should patch ParseAndAddCatchTests macro to allow additional command parameter # to launch tests - set_tests_properties("mpi_unit_tests" PROPERTIES FAIL_REGULAR_EXPRESSION "No tests ran" - LABELS "mpi") -endif() +set_tests_properties("mpi_unit_tests" PROPERTIES FAIL_REGULAR_EXPRESSION "No tests ran" LABELS "mpi")