2 * This file is part of the GROMACS molecular simulation package.
4 * Copyright (c) 2013, 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.
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.
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.
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.
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.
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.
35 /*! \defgroup module_mdrun_integration_tests Integration test utilities
36 * \ingroup group_mdrun
38 * \brief Functionality for testing mdrun as a whole
40 #ifndef GMX_MDRUN_TESTS_MODULETEST_H
41 #define GMX_MDRUN_TESTS_MODULETEST_H
43 #include "testutils/integrationtests.h"
45 #include <gtest/gtest.h>
53 /*! \libinternal \brief Declares test fixture for integration tests of
56 * Derived fixture classes (or individual test cases) that might have
57 * specific requirements should assert that behaviour, rather than
58 * hard-code the requirements. A test that (for example) can't run
59 * with more than one thread should report that as a diagnostic, so the
60 * person running the test (or designing the test harness) can get
61 * feedback on what tests need what conditions without having to read
62 * the code of lots of tests.
64 * The setup phase creates various temporary files for input and
65 * output that are common for mdrun tests, using the file manager
66 * object of the parent class. Individual tests should create any
67 * extra filenames similarly, so that the test users's current working
68 * directory does not get littered with files left over from all
71 * Specifying the execution context (such as numbers of threads and
72 * processors) is normally sensible to specify from the test harness
73 * (i.e. when CMake/CTest/the user runs a test executable), because
74 * only there is information about the hardware available. The default
75 * values for such context provided in test fixtures for mdrun should
76 * mirror the defaults for mdrun, but currently mdrun.c hard-codes
77 * those in a gmx_hw_opt_t.
79 * Any method in this class may throw std::bad_alloc if out of memory.
81 * \ingroup module_mdrun_integration_tests
83 class MdrunTestFixture : public IntegrationTestFixture
87 virtual ~MdrunTestFixture();
89 //! Use an empty .mdp file as input to grompp
90 void useEmptyMdpFile();
91 //! Use an empty .mdp file as input to grompp
92 void useStringAsMdpFile(const char *mdpString);
93 //! Use a standard .top and .gro file as input to grompp
94 void useTopAndGroFromDatabase(const char *name);
95 //! Calls grompp to prepare for the mdrun test
97 //! Calls mdrun for testing
101 /*! \name Names for frequently used grompp and mdrun output files
103 * These strings can be set to point to files present in the
104 * source tree, or to temporary files created for the test
105 * fixture. In the latter case,
106 * IntegrationTestFixture::fileManager_ should be used to fill
107 * these strings with paths to files, so that they are created
108 * in a temporary directory and (by default behaviour of
109 * TestFileManager) deleted when the test is complete.
111 std::string topFileName;
112 std::string groFileName;
113 std::string trrFileName;
114 std::string xtcFileName;
115 std::string rerunFileName;
116 std::string mdpInputFileName;
117 std::string mdpOutputFileName;
118 std::string tprFileName;
119 std::string logFileName;
120 std::string edrFileName;