a82192dc4dca93c0ad47c63ad3ecbaf33bd9f114
[alexxy/gromacs.git] / src / testutils / testutils-doc.h
1 /*
2  * This file is part of the GROMACS molecular simulation package.
3  *
4  * Copyright (c) 2015, 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 /*! \internal \file
36  * \brief
37  * Dummy header for \ref module_testutils documentation.
38  *
39  * \author Teemu Murtola <teemu.murtola@gmail.com>
40  * \ingroup module_testutils
41  */
42 /*! \libinternal \defgroup module_testutils Testing Utilities (testutils)
43  * \brief
44  * Common helper classes and functions for writing tests using Google Test.
45  *
46  * General documentation for the testing in \Gromacs can be found in the
47  * \linktodevmanual{index,developer guide}.  This page provides an overview of
48  * the actual API provided by the `testutils` module.
49  *
50  * There are several distinct functionalities provided:
51  *  - gmx::test::TestFileManager (in testfilemanager.h) provides functionality
52  *    for locating test input files from the source directory and managing
53  *    temporary files that need to be created during the test.
54  *  - gmx::test::TestFileInputRedirector (in testfileredirector.h) provides
55  *    functionality for capturing file existence checks in code that uses
56  *    gmx::FileInputRedirectorInterface.
57  *  - gmx::test::TestFileOutputRedirector (in testfileredirector.h) provides
58  *    functionality for capturing file output (including `stdout`) from code
59  *    that uses gmx::FileOutputRedirectorInterface, and checking that output
60  *    against reference data.
61  *  - gmx::test::InteractiveTestHelper (in interactivetest.h) provides
62  *    a helper class for testing an interactive session that uses
63  *    gmx::TextInputStream and gmx::TextOutputStream for prompting input and
64  *    printing status messages.
65  *  - #GMX_TEST_OPTIONS macro provides facilities for adding custom command
66  *    line options for the test binary.
67  *  - testasserts.h provides several custom test assertions for better
68  *    exception and floating-point handling than built-in Google Test
69  *    assertions.
70  *  - gmx::test::TestReferenceData and related classes (in refdata.h) provide
71  *    utilities to write regression-style tests that check that the test
72  *    produces the same results as an earlier run of the same test.  The
73  *    reference data is stored as XML files.  For certain types of tests, the
74  *    XML can also be easier to inspect manually for correctness than writing
75  *    the checks in C++, providing an alternative method to write assertions.
76  *  - gmx::test::CommandLine and related classes (in cmdlinetest.h) provide
77  *    utilities for constructing command line argument arrays for use in tests
78  *    that invoke actual commands.
79  *  - gmx::test::StringTestBase provides a test fixture for tests that need to
80  *    test long strings for correctness.
81  *  - gmx::test::IntegrationTestFixture provides a test fixture for tests that
82  *    execute legacy code where `stdin` reading etc. cannot be easily mocked.
83  *
84  * Additionally, testinit.h and mpi-printer.h, and their corresponding source
85  * files, provide functionality that is not visible on the API level: they
86  * provide initialization routines for the above functionality, which are
87  * automatically called by the %main() function provided in unittest_main.cpp.
88  *
89  * mpi-printer.h provides a Google Test listener that is installed when the
90  * tests are compiled with MPI.  This listener allows the test binary to be run
91  * on multiple MPI ranks, and synchronizes the execution and output from the
92  * test cases, as well as makes the test fail on even if an assertion fails
93  * only on one rank.
94  *
95  * \ingroup group_utilitymodules
96  */