#
# This file is part of the GROMACS molecular simulation package.
#
-# Copyright (c) 2014,2015,2016, by the GROMACS development team, led by
+# Copyright (c) 2014,2015,2016,2017, by the GROMACS development team, led by
# Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
# and including many others, as listed in the AUTHORS file in the
# top-level source directory and at http://www.gromacs.org.
self._module = None
self._is_test_dir = False
if parent and parent.is_test_directory() or \
- self._name in ('tests', 'legacytests'):
+ self._name == 'tests':
self._is_test_dir = True
self._is_external = False
if parent and parent.is_external() or self._name == 'external':
#
# This file is part of the GROMACS molecular simulation package.
#
-# Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+# Copyright (c) 2013,2014,2015,2017, by the GROMACS development team, led by
# Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
# and including many others, as listed in the AUTHORS file in the
# top-level source directory and at http://www.gromacs.org.
set(LIBGROMACS_SOURCES ${LIBGROMACS_SOURCES} ${GMXANA_SOURCES} PARENT_SCOPE)
if(BUILD_TESTING)
- add_subdirectory(legacytests)
+ add_subdirectory(tests)
endif()
#
# This file is part of the GROMACS molecular simulation package.
#
-# Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+# Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
# Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
# and including many others, as listed in the AUTHORS file in the
# top-level source directory and at http://www.gromacs.org.
# To help us fund GROMACS development, we humbly ask that you cite
# the research papers on the package. Check out http://www.gromacs.org.
-set(exename "legacy-tools-test")
+set(exename gmxana-test)
gmx_add_gtest_executable(
${exename}
- # files with code for test fixtures
- gmx_traj_tests.cpp
+ gmx_traj.cpp
+ gmx_trjconv.cpp
)
-gmx_register_gtest_test(LegacyToolsTest ${exename} INTEGRATION_TEST)
+gmx_register_gtest_test(GmxAnaTest ${exename} INTEGRATION_TEST)
--- /dev/null
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 2013,2014,2016,2017, by the GROMACS development team, led by
+ * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
+ * and including many others, as listed in the AUTHORS file in the
+ * top-level source directory and at http://www.gromacs.org.
+ *
+ * GROMACS is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1
+ * of the License, or (at your option) any later version.
+ *
+ * GROMACS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with GROMACS; if not, see
+ * http://www.gnu.org/licenses, or write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * If you want to redistribute modifications to GROMACS, please
+ * consider that scientific software is very special. Version
+ * control is crucial - bugs must be traceable. We will be happy to
+ * consider code for inclusion in the official distribution, but
+ * derived work must not be called official GROMACS. Details are found
+ * in the README & COPYING files - if they are missing, get the
+ * official version at http://www.gromacs.org.
+ *
+ * To help us fund GROMACS development, we humbly ask that you cite
+ * the research papers on the package. Check out http://www.gromacs.org.
+ */
+/*! \internal \file
+ * \brief
+ * Tests for gmx traj.
+ *
+ * \author Mark Abraham <mark.j.abraham@gmail.com>
+ */
+#include "gmxpre.h"
+
+#include "config.h"
+
+#include "gromacs/gmxana/gmx_ana.h"
+
+#include "testutils/cmdlinetest.h"
+#include "testutils/integrationtests.h"
+
+namespace
+{
+
+class GmxTraj : public gmx::test::IntegrationTestFixture,
+ public ::testing::WithParamInterface<const char *>
+{
+ public:
+ GmxTraj() : groFileName(fileManager_.getInputFilePath("spc2.gro")),
+ xvgFileName(fileManager_.getTemporaryFilePath("spc2.xvg"))
+ {
+ }
+
+ int runTest(const char *fileName)
+ {
+ gmx::test::CommandLine caller;
+ caller.append("traj");
+
+ caller.addOption("-s", groFileName);
+ caller.addOption("-ox", xvgFileName);
+
+ std::string inputTrajectoryFileName = fileManager_.getInputFilePath(fileName);
+ caller.addOption("-f", inputTrajectoryFileName);
+
+ redirectStringToStdin("0\n");
+
+ return gmx_traj(caller.argc(), caller.argv());
+ }
+
+ std::string groFileName;
+ std::string xvgFileName;
+};
+
+/* TODO These tests are actually not very effective, because gmx-traj
+ * can only return 0 or exit via gmx_fatal() (which currently also
+ * exits the test binary). So, "no XDR/TNG support in the binary"
+ * leads to the reading test appearing to pass. Still, no fatal error
+ * and no segfault is useful information while modifying such code. */
+
+TEST_P(GmxTraj, WithDifferentInputFormats)
+{
+ runTest(GetParam());
+}
+
+/*! \brief Helper array of input files present in the source repo
+ * database. These all have two identical frames of two SPC water
+ * molecules, which were generated via trjconv from the .gro
+ * version. */
+const char *const trajectoryFileNames[] = {
+ "spc2-traj.trr",
+#if GMX_USE_TNG
+ "spc2-traj.tng",
+#endif
+ "spc2-traj.xtc",
+ "spc2-traj.gro",
+ "spc2-traj.pdb",
+ "spc2-traj.g96"
+};
+
+INSTANTIATE_TEST_CASE_P(NoFatalErrorWhenWritingFrom,
+ GmxTraj, ::testing::ValuesIn(trajectoryFileNames));
+
+} // namespace
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2013,2014,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2016,2017, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
*/
/*! \internal \file
* \brief
- * Tests for gmx traj
+ * Tests for gmx trjconv.
*
* \author Mark Abraham <mark.j.abraham@gmail.com>
*/
-
#include "gmxpre.h"
#include "config.h"
#include "gromacs/gmxana/gmx_ana.h"
-#include "gromacs/utility/arrayref.h"
#include "testutils/cmdlinetest.h"
#include "testutils/integrationtests.h"
namespace
{
-class GmxTraj : public gmx::test::IntegrationTestFixture,
- public ::testing::WithParamInterface<const char *>
-{
- public:
- GmxTraj() : groFileName(fileManager_.getInputFilePath("spc2.gro")),
- xvgFileName(fileManager_.getTemporaryFilePath("spc2.xvg"))
- {
- }
-
- int runTest(const char *fileName)
- {
- gmx::test::CommandLine caller;
- caller.append("traj");
-
- caller.addOption("-s", groFileName);
- caller.addOption("-ox", xvgFileName);
-
- std::string inputTrajectoryFileName = fileManager_.getInputFilePath(fileName);
- caller.addOption("-f", inputTrajectoryFileName);
-
- redirectStringToStdin("0\n");
-
- return gmx_traj(caller.argc(), caller.argv());
- }
-
- std::string groFileName;
- std::string xvgFileName;
-};
-
-/* TODO These tests are actually not very effective, because gmx-traj
- * can only return 0 or exit via gmx_fatal() (which currently also
- * exits the test binary). So, "no XDR/TNG support in the binary"
- * leads to the reading test appearing to pass. Still, no fatal error
- * and no segfault is useful information while modifying such code. */
-
-TEST_P(GmxTraj, WithDifferentInputFormats)
-{
- runTest(GetParam());
-}
-
-// ==
-
class TrjconvWithIndexGroupSubset : public gmx::test::IntegrationTestFixture,
public ::testing::WithParamInterface<const char *>
{
runTest(GetParam());
}
-// ==
-
/*! \brief Helper array of input files present in the source repo
* database. These all have two identical frames of two SPC water
* molecules, which were generated via trjconv from the .gro
* version. */
-const char *trajectoryFileNames[] = {
+const char *const trajectoryFileNames[] = {
"spc2-traj.trr",
#if GMX_USE_TNG
"spc2-traj.tng",
"spc2-traj.g96"
};
-INSTANTIATE_TEST_CASE_P(NoFatalErrorWhenWritingFrom,
- GmxTraj,
- ::testing::ValuesIn(gmx::ArrayRef<const char*>(trajectoryFileNames)));
-
INSTANTIATE_TEST_CASE_P(NoFatalErrorWhenWritingFrom,
TrjconvWithIndexGroupSubset,
- ::testing::ValuesIn(gmx::ArrayRef<const char*>(trajectoryFileNames)));
+ ::testing::ValuesIn(trajectoryFileNames));
} // namespace
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
* database. These all have two identical frames of two SPC water
* molecules, which were generated via trjconv from the .gro
* version. */
-const char *trajectoryFileNames[] = {
- "../../../gromacs/gmxana/legacytests/spc2-traj.trr",
+const char *const trajectoryFileNames[] = {
+ "../../../gromacs/gmxana/tests/spc2-traj.trr",
#if GMX_USE_TNG
- "../../../gromacs/gmxana/legacytests/spc2-traj.tng",
+ "../../../gromacs/gmxana/tests/spc2-traj.tng",
#endif
- "../../../gromacs/gmxana/legacytests/spc2-traj.xtc",
- "../../../gromacs/gmxana/legacytests/spc2-traj.gro",
- "../../../gromacs/gmxana/legacytests/spc2-traj.pdb",
- "../../../gromacs/gmxana/legacytests/spc2-traj.g96"
+ "../../../gromacs/gmxana/tests/spc2-traj.xtc",
+ "../../../gromacs/gmxana/tests/spc2-traj.gro",
+ "../../../gromacs/gmxana/tests/spc2-traj.pdb",
+ "../../../gromacs/gmxana/tests/spc2-traj.g96"
};
// TODO later. Find a better way to manage this file database and
// these string arrays that index it
INSTANTIATE_TEST_CASE_P(NoFatalErrorFrom,
MdrunRerun,
- ::testing::ValuesIn(gmx::ArrayRef<const char*>(trajectoryFileNames)));
+ ::testing::ValuesIn(trajectoryFileNames));
/*! \todo Add other tests for mdrun -rerun, e.g.
*