Skip to content
Snippets Groups Projects
Commit 35382400 authored by Linus Seelinger's avatar Linus Seelinger Committed by Christian Engwer
Browse files

[Tests] Added parallel grid tests using MPI if available

(cherry picked from commit df0eb79d6374e2bd057cc6e7be17322649901c28)
parent 4f66cfb3
No related branches found
No related tags found
1 merge request!3Split YaspGrid tests into more tests and introduce parallel testing
# add test include property manually because the folder is not called "test"
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
PROPERTY TEST_INCLUDE_FILE ${CMAKE_CURRENT_BINARY_DIR}/BuildTests.cmake)
set(TESTS
test-yaspgrid-backuprestore
test-yaspgrid-tensorgridfactory
......@@ -16,14 +20,29 @@ foreach(_test ${TESTS})
add_test(${_test} ${_test})
endforeach(_test ${TESTS})
# add test include property manually because the folder is not called "test"
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
PROPERTY TEST_INCLUDE_FILE ${CMAKE_CURRENT_BINARY_DIR}/BuildTests.cmake)
# Add tests to test target
add_directory_test_target(_test_target)
add_dependencies(${_test_target} ${TESTS})
# If we have MPI, include parallel tests
if(MPI_FOUND)
set(TESTS_PARALLEL
test-yaspgrid-backuprestore
test-yaspgrid-tensorgridfactory
test-yaspgrid-yaspfactory-1d
test-yaspgrid-yaspfactory-2d
test-yaspgrid-yaspfactory-3d
)
# Create tests with mpi command and add them to the test target
foreach(_test ${TESTS_PARALLEL})
add_test(NAME ${_test}_parallel
COMMAND ${MPIEXEC} ${MPIEXEC_NUMPROC_FLAG} "2" ${_test})
add_dependencies(${_test_target} ${_test}_parallel)
endforeach(_test ${TESTS_PARALLEL})
endif(MPI_FOUND)
set(SOURCES
test-yaspgrid-backuprestore.cc
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment