Apply more granular CTest time-out policy.
authorM. Eric Irrgang <ericirrgang@gmail.com>
Tue, 28 Apr 2020 16:47:36 +0000 (19:47 +0300)
committerM. Eric Irrgang <ericirrgang@gmail.com>
Wed, 29 Apr 2020 09:29:00 +0000 (12:29 +0300)
Separate some test macro logic:
* Decouple IGNORE_LEAKS from INTEGRATION_TEST and SLOW_TEST.
* Use SLOW_TEST without IGNORE_LEAKS for some newly relaxed time-outs.

Give longer time out to some tests.

Resolves #3513

src/api/cpp/tests/CMakeLists.txt
src/api/cpp/workflow/tests/CMakeLists.txt
src/gromacs/gmxana/tests/CMakeLists.txt
src/gromacs/gmxpreprocess/tests/CMakeLists.txt
src/gromacs/tools/tests/CMakeLists.txt
src/gromacs/trajectoryanalysis/tests/CMakeLists.txt
src/programs/mdrun/tests/CMakeLists.txt
src/testutils/TestMacros.cmake

index f9918294493b2e729a108b8cd3d7c6848e876ccb..ddacd62533daab72c55245c8d49ea3d80948f609 100644 (file)
@@ -71,7 +71,7 @@ target_include_directories(gmxapi-test PRIVATE
 # Link against the gmxapi libraries and get access to its public (installed) headers.
 target_link_libraries(gmxapi-test PRIVATE Gromacs::gmxapi mdrun_test_infrastructure)
 
-gmx_register_gtest_test(GmxapiExternalInterfaceTests gmxapi-test OPENMP_THREADS 2 INTEGRATION_TEST)
+gmx_register_gtest_test(GmxapiExternalInterfaceTests gmxapi-test OPENMP_THREADS 2 INTEGRATION_TEST IGNORE_LEAKS)
 
 set_tests_properties(GmxapiExternalInterfaceTests PROPERTIES
                      WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
@@ -101,4 +101,4 @@ target_include_directories(gmxapi-mpi-test PRIVATE
                            ${CMAKE_CURRENT_SOURCE_DIR})
 target_link_libraries(gmxapi-mpi-test PRIVATE Gromacs::gmxapi mdrun_test_infrastructure)
 
-gmx_register_gtest_test(GmxapiMpiTests gmxapi-mpi-test MPI_RANKS 2 OPENMP_THREADS 2 INTEGRATION_TEST)
+gmx_register_gtest_test(GmxapiMpiTests gmxapi-mpi-test MPI_RANKS 2 OPENMP_THREADS 2 INTEGRATION_TEST IGNORE_LEAKS)
index 2f9afe8cd9f9c443bfc2a242679e39bd1da0ebe9..a36d77ada6536393307c1dddeaeba6244749b873 100644 (file)
@@ -44,7 +44,7 @@ gmx_add_gtest_executable(workflow-details-test
 
 target_link_libraries(workflow-details-test PRIVATE Gromacs::gmxapi gmxapi-detail mdrun_test_infrastructure)
 
-gmx_register_gtest_test(GmxapiInternalInterfaceTests workflow-details-test OPENMP_THREADS 2 INTEGRATION_TEST)
+gmx_register_gtest_test(GmxapiInternalInterfaceTests workflow-details-test OPENMP_THREADS 2 INTEGRATION_TEST IGNORE_LEAKS)
 
 set_tests_properties(GmxapiInternalInterfaceTests PROPERTIES
                      WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
@@ -62,4 +62,4 @@ gmx_add_gtest_executable(workflow-details-mpi-test MPI
 
 target_link_libraries(workflow-details-mpi-test PRIVATE Gromacs::gmxapi gmxapi-detail mdrun_test_infrastructure)
 
-gmx_register_gtest_test(GmxapiInternalsMpiTests workflow-details-mpi-test MPI_RANKS 2 OPENMP_THREADS 2 INTEGRATION_TEST)
+gmx_register_gtest_test(GmxapiInternalsMpiTests workflow-details-mpi-test MPI_RANKS 2 OPENMP_THREADS 2 INTEGRATION_TEST IGNORE_LEAKS)
index c69a17b0cfc9544a19cf49beca4e015bd25423b7..381d847f0636230dec31593c1ed53a389c9a7da1 100644 (file)
@@ -41,4 +41,4 @@ gmx_add_gtest_executable(${exename}
         gmx_mindist.cpp
         gmx_msd.cpp
         )
-gmx_register_gtest_test(GmxAnaTest ${exename} INTEGRATION_TEST)
\ No newline at end of file
+gmx_register_gtest_test(GmxAnaTest ${exename} INTEGRATION_TEST IGNORE_LEAKS)
index ef193d4fd282bdf9191cafaca64fbb13794d99d5..979cdb166f8dc9ba2bf93fde117c417315c06ebb 100644 (file)
@@ -32,7 +32,7 @@
 # To help us fund GROMACS development, we humbly ask that you cite
 # the research papers on the package. Check out http://www.gromacs.org.
 
-gmx_add_unit_test(GmxPreprocessTests gmxpreprocess-test
+gmx_add_gtest_executable(gmxpreprocess-test
     CPP_SOURCE_FILES
         editconf.cpp
         genconf.cpp
@@ -44,6 +44,7 @@ gmx_add_unit_test(GmxPreprocessTests gmxpreprocess-test
         solvate.cpp
         topdirs.cpp
         )
+gmx_register_gtest_test(GmxPreprocessTests gmxpreprocess-test SLOW_TEST)
 
 # Currently these can be slow to run in Jenkins, so they are in
 # several test binaries.
@@ -54,7 +55,7 @@ gmx_add_gtest_executable(${exename}
        pdb2gmx.cpp
        )
 target_compile_definitions(${exename} PRIVATE OPLSAA=1 GROMOS=0 AMBER=0 CHARMM=0)
-gmx_register_gtest_test(Pdb2gmx1Test ${exename})
+gmx_register_gtest_test(Pdb2gmx1Test ${exename} SLOW_TEST)
 
 set(exename pdb2gmx2-test)
 gmx_add_gtest_executable(${exename}
@@ -62,7 +63,7 @@ gmx_add_gtest_executable(${exename}
         pdb2gmx.cpp
         )
 target_compile_definitions(${exename} PRIVATE OPLSAA=0 GROMOS=1 AMBER=0 CHARMM=0)
-gmx_register_gtest_test(Pdb2gmx2Test ${exename})
+gmx_register_gtest_test(Pdb2gmx2Test ${exename} SLOW_TEST)
 
 set(exename pdb2gmx3-test)
 gmx_add_gtest_executable(${exename}
@@ -70,4 +71,4 @@ gmx_add_gtest_executable(${exename}
         pdb2gmx.cpp
         )
 target_compile_definitions(${exename} PRIVATE OPLSAA=0 GROMOS=0 AMBER=1 CHARMM=1)
-gmx_register_gtest_test(Pdb2gmx3Test ${exename})
+gmx_register_gtest_test(Pdb2gmx3Test ${exename} SLOW_TEST)
index 54c7c87c0f4c7a733d20cbbf28f61d41f2802caf..89ab30ce6ddc938a5dfc8e5b5183944a8e54b75c 100644 (file)
 # To help us fund GROMACS development, we humbly ask that you cite
 # the research papers on the package. Check out http://www.gromacs.org.
 
-gmx_add_unit_test(ToolUnitTests tool-test
+gmx_add_gtest_executable(tool-test
     CPP_SOURCE_FILES
         dump.cpp
         report_methods.cpp
         trjconv.cpp
         )
-
+gmx_register_gtest_test(ToolUnitTests tool-test SLOW_TEST)
index d52d2c5c4d0f98d779c872af64fed2aede534e86..cca089f3142ff98ed90e13d79063cfa6eb832d7c 100644 (file)
@@ -33,7 +33,7 @@
 # To help us fund GROMACS development, we humbly ask that you cite
 # the research papers on the package. Check out http://www.gromacs.org.
 
-gmx_add_unit_test(TrajectoryAnalysisUnitTests trajectoryanalysis-test
+gmx_add_gtest_executable(trajectoryanalysis-test
     CPP_SOURCE_FILES
         # Infrastructure
         moduletest.cpp
@@ -54,6 +54,7 @@ gmx_add_unit_test(TrajectoryAnalysisUnitTests trajectoryanalysis-test
         trajectory.cpp
         unionfind.cpp
         )
+gmx_register_gtest_test(TrajectoryAnalysisUnitTests trajectoryanalysis-test SLOW_TEST)
 target_link_libraries(trajectoryanalysis-test PRIVATE analysisdata-test-shared)
 
 add_executable(test_selection ${UNITTEST_TARGET_OPTIONS} test_selection.cpp)
index 68febf770805c237e6da851ad77bb9d745962256..9b0322d78c5a2ae2d504452b3acf2c2201e1de7d 100644 (file)
@@ -73,7 +73,7 @@ gmx_add_gtest_executable(${exename}
         $<TARGET_OBJECTS:mdrun_objlib>
     )
 target_link_libraries(${exename} PRIVATE mdrun_test_infrastructure)
-gmx_register_gtest_test(${testname} ${exename} OPENMP_THREADS 2 INTEGRATION_TEST)
+gmx_register_gtest_test(${testname} ${exename} OPENMP_THREADS 2 INTEGRATION_TEST IGNORE_LEAKS)
 
 # To avoid running into test timeouts, some end-to-end tests of mdrun
 # functionality are split off. This can be rearranged in future as we
@@ -93,7 +93,7 @@ gmx_add_gtest_executable(${exename}
         $<TARGET_OBJECTS:mdrun_objlib>
         )
 target_link_libraries(${exename} PRIVATE mdrun_test_infrastructure)
-gmx_register_gtest_test(${testname} ${exename} OPENMP_THREADS 2 INTEGRATION_TEST)
+gmx_register_gtest_test(${testname} ${exename} OPENMP_THREADS 2 INTEGRATION_TEST IGNORE_LEAKS)
 
 # TPI does not support OpenMP, so we need a separate test binary
 set(testname "MdrunTpiTests")
@@ -107,7 +107,7 @@ gmx_add_gtest_executable(${exename}
         $<TARGET_OBJECTS:mdrun_objlib>
         )
 target_link_libraries(${exename} PRIVATE mdrun_test_infrastructure)
-gmx_register_gtest_test(${testname} ${exename} INTEGRATION_TEST)
+gmx_register_gtest_test(${testname} ${exename} INTEGRATION_TEST IGNORE_LEAKS)
 
 # Tests that only make sense to run with multiple ranks and/or real
 # MPI are implemented here.
@@ -128,7 +128,7 @@ gmx_add_gtest_executable(${exename} MPI
         $<TARGET_OBJECTS:mdrun_objlib>
         )
 target_link_libraries(${exename} PRIVATE mdrun_test_infrastructure)
-gmx_register_gtest_test(${testname} ${exename} MPI_RANKS 2 OPENMP_THREADS 2 INTEGRATION_TEST)
+gmx_register_gtest_test(${testname} ${exename} MPI_RANKS 2 OPENMP_THREADS 2 INTEGRATION_TEST IGNORE_LEAKS)
 
 # Slow-running tests that target testing multiple-rank coordination behaviors
 set(exename "mdrun-mpi-coordination-test")
@@ -146,7 +146,7 @@ target_link_libraries(${exename} PRIVATE mdrun_test_infrastructure)
 # with OpenMP enabled.
 if (CMAKE_BUILD_TYPE MATCHES "Rel" AND GMX_OPENMP)
     set(testname "MdrunMpiCoordinationTestsOneRank")
-    gmx_register_gtest_test(${testname} ${exename} MPI_RANKS 1 SLOW_TEST)
+    gmx_register_gtest_test(${testname} ${exename} MPI_RANKS 1 SLOW_TEST IGNORE_LEAKS)
     set(testname "MdrunMpiCoordinationTestsTwoRanks")
-    gmx_register_gtest_test(${testname} ${exename} MPI_RANKS 2 SLOW_TEST)
+    gmx_register_gtest_test(${testname} ${exename} MPI_RANKS 2 SLOW_TEST IGNORE_LEAKS)
 endif()
index 3e1db693f4503f7db1d98aeb4bb3340349080916..c17ce34641794eb71f4aa37eb87bc2122674eecf 100644 (file)
@@ -179,13 +179,14 @@ endfunction()
 #   INTEGRATION_TEST      requires the use of the IntegrationTest label in CTest
 #   SLOW_TEST             requires the use of the SlowTest label in CTest, and
 #                         increase the length of the ctest timeout.
+#   IGNORE_LEAKS          Skip some memory safety checks.
 #
 # TODO When a test case needs it, generalize the MPI_RANKS mechanism so
 # that ctest can run the test binary over a range of numbers of MPI
 # ranks.
 function (gmx_register_gtest_test NAME EXENAME)
     if (GMX_BUILD_UNITTESTS AND BUILD_TESTING)
-        set(_options INTEGRATION_TEST SLOW_TEST)
+        set(_options INTEGRATION_TEST SLOW_TEST IGNORE_LEAKS)
         set(_one_value_args MPI_RANKS OPENMP_THREADS)
         cmake_parse_arguments(ARG "${_options}" "${_one_value_args}" "" ${ARGN})
         set(_xml_path ${CMAKE_BINARY_DIR}/Testing/Temporary/${NAME}.xml)
@@ -204,15 +205,16 @@ function (gmx_register_gtest_test NAME EXENAME)
             else()
                 set(_timeout 120)
             endif()
-            gmx_get_test_prefix_cmd(_prefix_cmd IGNORE_LEAKS)
         elseif (ARG_SLOW_TEST)
             list(APPEND _labels SlowTest)
             set(_timeout 480)
-            gmx_get_test_prefix_cmd(_prefix_cmd IGNORE_LEAKS)
         else()
             list(APPEND _labels UnitTest)
             gmx_get_test_prefix_cmd(_prefix_cmd)
         endif()
+        if (ARG_IGNORE_LEAKS)
+            gmx_get_test_prefix_cmd(_prefix_cmd IGNORE_LEAKS)
+        endif ()
         set(_cmd ${_prefix_cmd} $<TARGET_FILE:${EXENAME}>)
         if (ARG_OPENMP_THREADS)
             if (GMX_OPENMP)