65074a7f149f5032faeca7d4a0c29d04b364f5bb
[alexxy/gromacs.git] / src / api / cpp / workflow / tests / CMakeLists.txt
1 #
2 # This file is part of the GROMACS molecular simulation package.
3 #
4 # Copyright (c) 2018,2019,2020, by the GROMACS development team, led by
5 # Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
6 # and including many others, as listed in the AUTHORS file in the
7 # top-level source directory and at http://www.gromacs.org.
8 #
9 # GROMACS is free software; you can redistribute it and/or
10 # modify it under the terms of the GNU Lesser General Public License
11 # as published by the Free Software Foundation; either version 2.1
12 # of the License, or (at your option) any later version.
13 #
14 # GROMACS is distributed in the hope that it will be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17 # Lesser General Public License for more details.
18 #
19 # You should have received a copy of the GNU Lesser General Public
20 # License along with GROMACS; if not, see
21 # http://www.gnu.org/licenses, or write to the Free Software Foundation,
22 # Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
23 #
24 # If you want to redistribute modifications to GROMACS, please
25 # consider that scientific software is very special. Version
26 # control is crucial - bugs must be traceable. We will be happy to
27 # consider code for inclusion in the official distribution, but
28 # derived work must not be called official GROMACS. Details are found
29 # in the README & COPYING files - if they are missing, get the
30 # official version at http://www.gromacs.org.
31 #
32 # To help us fund GROMACS development, we humbly ask that you cite
33 # the research papers on the package. Check out http://www.gromacs.org.
34
35 # Test private interface.
36 #
37
38 gmx_add_gtest_executable(workflow-details-test
39     CPP_SOURCE_FILES
40         workflow.cpp
41         # pseudo-library for code for mdrun
42         $<TARGET_OBJECTS:mdrun_objlib>
43 )
44
45 target_link_libraries(workflow-details-test
46                       PRIVATE
47                         Gromacs::gmxapi
48                         gmxapi-detail
49                         gmxapi-testsupport
50                         mdrun_test_infrastructure)
51
52 gmx_register_gtest_test(GmxapiInternalInterfaceTests workflow-details-test OPENMP_THREADS 2 INTEGRATION_TEST IGNORE_LEAKS)
53
54 set_tests_properties(GmxapiInternalInterfaceTests PROPERTIES
55                      WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
56
57 #
58 # Test with MPI.
59 #
60 # gmxapi is expected to work whether or not GROMACS was built with MPI (or tMPI)
61 # but we don't assume that MPI is available to the build tree or testing tools
62 # unless CMake was configured with MPI.
63 #
64 # For MPI-enabled testing of gmxapi clients using non-MPI-enabled GROMACS, we
65 # defer testing to the Python gmxapi client package tests.
66 #
67 if (GMX_MPI)
68     gmx_add_gtest_executable(workflow-details-mpi-test MPI
69                              CPP_SOURCE_FILES
70                              workflow.cpp
71                              # pseudo-library for code for mdrun
72                              $<TARGET_OBJECTS:mdrun_objlib>
73                              )
74
75     target_link_libraries(workflow-details-mpi-test
76                           PRIVATE
77                           Gromacs::gmxapi
78                           gmxapi-detail
79                           gmxapi-testsupport
80                           mdrun_test_infrastructure)
81
82     gmx_register_gtest_test(GmxapiInternalsMpiTests workflow-details-mpi-test MPI_RANKS 2 OPENMP_THREADS 2 INTEGRATION_TEST IGNORE_LEAKS)
83
84     set_tests_properties(GmxapiInternalsMpiTests PROPERTIES
85                          WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
86 endif ()