Skip to content

Commit

Permalink
testing: Simplify staging MPMD test creation
Browse files Browse the repository at this point in the history
Convert the tests to `gtest_add_tests_helper`.
  • Loading branch information
bradking committed May 15, 2020
1 parent 092d4c0 commit d003b33
Showing 1 changed file with 4 additions and 39 deletions.
43 changes: 4 additions & 39 deletions testing/adios2/engine/staging-common/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,41 +5,10 @@

find_package(Threads REQUIRED)

if(ADIOS2_HAVE_MPI)
set(extra_test_args EXEC_WRAPPER ${MPIEXEC_COMMAND})

add_executable(TestStagingMPMD TestStagingMPMD.cpp)
target_link_libraries(TestStagingMPMD
${CMAKE_THREAD_LIBS_INIT}
adios2::thirdparty::gtest adios2::cxx11_mpi MPI::MPI_C
)
if(ADIOS2_HAVE_SST)
gtest_add_tests(TARGET TestStagingMPMD ${extra_test_args}
EXTRA_ARGS "SST" "MarshalMethod=FFS"
TEST_SUFFIX _SST_FFS
TEST_LIST _gtest_added_tests
)
set_tests_properties(${_gtest_added_tests} PROPERTIES
PROCESSORS "${MPIEXEC_MAX_NUMPROCS}"
)
gtest_add_tests(TARGET TestStagingMPMD ${extra_test_args}
EXTRA_ARGS "SST" "MarshalMethod=BP"
TEST_SUFFIX _SST_BP
TEST_LIST _gtest_added_tests
)
set_tests_properties(${_gtest_added_tests} PROPERTIES
PROCESSORS "${MPIEXEC_MAX_NUMPROCS}"
)
endif()

gtest_add_tests(TARGET TestStagingMPMD ${extra_test_args}
EXTRA_ARGS "InSituMPI"
TEST_SUFFIX _InSituMPI
TEST_LIST _gtest_added_tests
)
set_tests_properties(${_gtest_added_tests} PROPERTIES
PROCESSORS "${MPIEXEC_MAX_NUMPROCS}"
)
gtest_add_tests_helper(StagingMPMD MPI_ONLY "" Engine.Staging. ".InSituMPI" EXTRA_ARGS "InSituMPI")
if(ADIOS2_HAVE_SST)
gtest_add_tests_helper(StagingMPMD MPI_ONLY "" Engine.Staging. ".SST.FFS" EXTRA_ARGS "SST" "MarshalMethod=FFS")
gtest_add_tests_helper(StagingMPMD MPI_ONLY "" Engine.Staging. ".SST.BP" EXTRA_ARGS "SST" "MarshalMethod=BP")
endif()

foreach(helper
Expand Down Expand Up @@ -93,10 +62,6 @@ if(ADIOS2_HAVE_Fortran)
endif()
endif()

if(ADIOS2_HAVE_MPI)
set(extra_test_args EXEC_WRAPPER ${MPIEXEC_COMMAND})
endif()

configure_file(
run_test.py.gen.in
${CMAKE_CURRENT_BINARY_DIR}/run_test.py.gen
Expand Down

0 comments on commit d003b33

Please sign in to comment.