Skip to content

Fix Unit Test framework #670

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions test/UnitTests/Parallel-mpi/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,12 @@ target_include_directories(parallel_mpi_test PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
target_compile_options(parallel_mpi_test PUBLIC ${GTEST_CFLAGS})
include(GoogleTest)
gtest_discover_tests(parallel_mpi_test)

# Add the same test in CTest framework. It allows to run the test directly with the right mpi command. The command
# "ctest --preset linux-gcc-release -L mpi" will run (depending on the mpi implementation and the core number): mpiexec
# -n 8 build/linux-gcc-release/parallel_mpi_test
add_test(NAME ctest_parallel_mpi_test COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS}
${MPIEXEC_PREFLAGS} $<TARGET_FILE:parallel_mpi_test> ${MPIEXEC_POSTFLAGS})

# Add "mpi" label to the test
set_tests_properties(ctest_parallel_mpi_test PROPERTIES LABELS "mpi")
Loading