Move some testutils and overview docs to dev guide
[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_OPTIONS macro provides facilities for adding custom command
55  *    line options for the test binary.
56  *  - testasserts.h provides several custom test assertions for better
57  *    exception and floating-point handling than built-in Google Test
58  *    assertions.
59  *  - gmx::test::TestReferenceData and related classes (in refdata.h) provide
60  *    utilities to write regression-style tests that check that the test
61  *    produces the same results as an earlier run of the same test.  The
62  *    reference data is stored as XML files.  For certain types of tests, the
63  *    XML can also be easier to inspect manually for correctness than writing
64  *    the checks in C++, providing an alternative method to write assertions.
65  *  - gmx::test::CommandLine and related classes (in cmdlinetest.h) provide
66  *    utilities for constructing command line argument arrays for use in tests
67  *    that invoke actual commands.
68  *  - gmx::test::StringTestBase provides a test fixture for tests that need to
69  *    test long strings for correctness.
70  *  - gmx::test::IntegrationTestFixture provides a test fixture for tests that
71  *    execute legacy code where `stdin` reading etc. cannot be easily mocked.
72  *
73  * Additionally, testinit.h and mpi-printer.h, and their corresponding source
74  * files, provide functionality that is not visible on the API level: they
75  * provide initialization routines for the above functionality, which are
76  * automatically called by the %main() function provided in unittest_main.cpp.
77  *
78  * mpi-printer.h provides a Google Test listener that is installed when the
79  * tests are compiled with MPI.  This listener allows the test binary to be run
80  * on multiple MPI ranks, and synchronizes the execution and output from the
81  * test cases, as well as makes the test fail on even if an assertion fails
82  * only on one rank.
83  *
84  * \ingroup group_utilitymodules
85  */