Add end-to-end tests of energy minimization
[alexxy/gromacs.git] / src / programs / mdrun / tests / CMakeLists.txt
index 24ae43628bfa47eda58d15a95c963b7e2ff2fe65..7d3d12f110689e47532f04e76628a126526c0ef2 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.
 
-# make an "object library" for code that we re-use for both kinds of tests
+# Make an "object library" for test infrastructure code that we re-use
+# in multiple test executables.
 add_library(mdrun_test_objlib OBJECT
     energyreader.cpp
+    energycomparison.cpp
     moduletest.cpp
     simulationdatabase.cpp
     terminationhelper.cpp
-    # PME tests
-    pmetest.cpp
+    trajectorycomparison.cpp
+    trajectoryreader.cpp
     )
 
 set(testname "MdrunTests")
@@ -49,17 +51,14 @@ gmx_add_gtest_executable(
     ${exename}
     # files with code for tests
     compressed_x_output.cpp
-    energycomparison.cpp
     grompp.cpp
     initialconstraints.cpp
     interactiveMD.cpp
-    rerun.cpp
+    pmetest.cpp
     swapcoords.cpp
     tabulated_bonded_interactions.cpp
     termination.cpp
     trajectory_writing.cpp
-    trajectorycomparison.cpp
-    trajectoryreader.cpp
     # pseudo-library for code for testing mdrun
     $<TARGET_OBJECTS:mdrun_test_objlib>
     # pseudo-library for code for mdrun
@@ -71,11 +70,33 @@ else()
     gmx_register_gtest_test(${testname} ${exename} OPENMP_THREADS 2 INTEGRATION_TEST)
 endif()
 
+# 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
+# see fit.
+set(testname "MdrunNonIntegratorTests")
+set(exename "mdrun-non-integrator-test")
+
+gmx_add_gtest_executable(
+    ${exename}
+    # files with code for tests
+    minimize.cpp
+    rerun.cpp
+    # pseudo-library for code for testing mdrun
+    $<TARGET_OBJECTS:mdrun_test_objlib>
+    # pseudo-library for code for mdrun
+    $<TARGET_OBJECTS:mdrun_objlib>
+    )
+gmx_register_gtest_test(${testname} ${exename} OPENMP_THREADS 2 INTEGRATION_TEST)
+
+# To permit other end-to-end tests to run with multiple OpenMP
+# threads, test cases that still use the group scheme are separated.
 set(testname "LegacyGroupSchemeMdrunTests")
 set(exename "legacy-mdrun-test")
 
 gmx_add_gtest_executable(
     ${exename}
+    # When TPI supports the Verlet scheme, move this into
+    # MdrunNonIntegratorTest
     tpitest.cpp
     # pseudo-library for code for testing mdrun
     $<TARGET_OBJECTS:mdrun_test_objlib>
@@ -84,6 +105,8 @@ gmx_add_gtest_executable(
     )
 gmx_register_gtest_test(${testname} ${exename} INTEGRATION_TEST)
 
+# Tests that only make sense to run with multiple ranks and/or real
+# MPI are implemented here.
 set(testname "MdrunMpiTests")
 set(exename "mdrun-mpi-test")
 
@@ -91,12 +114,18 @@ gmx_add_gtest_executable(
     ${exename} MPI
     # files with code for tests
     domain_decomposition.cpp
+    minimize.cpp
     multisim.cpp
     multisimtest.cpp
+    pmetest.cpp
     replicaexchange.cpp
     # pseudo-library for code for testing mdrun
     $<TARGET_OBJECTS:mdrun_test_objlib>
     # pseudo-library for code for mdrun
     $<TARGET_OBJECTS:mdrun_objlib>
     )
-gmx_register_gtest_test(${testname} ${exename} MPI_RANKS 2 INTEGRATION_TEST)
+if (GMX_GPU AND GMX_USE_OPENCL)
+    gmx_register_gtest_test(${testname} ${exename} OPENMP_THREADS 2 OCL_INTEGRATION_TEST)
+else()
+    gmx_register_gtest_test(${testname} ${exename} OPENMP_THREADS 2 INTEGRATION_TEST)
+endif()