Reorganize shared unit test code
authorTeemu Murtola <teemu.murtola@gmail.com>
Mon, 6 Jan 2014 18:37:23 +0000 (20:37 +0200)
committerGerrit Code Review <gerrit@gerrit.gromacs.org>
Wed, 15 Jan 2014 00:37:59 +0000 (01:37 +0100)
Move mocks and test fixtures to the modules that they are mocking:
 - datatest.*, mock_datamodule.* to analysisdata/tests/
 - mock_helptopic.* to onlinehelp/tests/
This is now easier with object libraries, and clarifies the dependencies
in the test code.  src/testutils/ is now really about utilities, and not
about some specific-purpose test code.

Change-Id: Ib0cbe6382813315df65fa65f7fe0233b9b5e2d4e

23 files changed:
admin/includedeps.py
src/gromacs/analysisdata/tests/CMakeLists.txt
src/gromacs/analysisdata/tests/analysisdata.cpp
src/gromacs/analysisdata/tests/arraydata.cpp
src/gromacs/analysisdata/tests/average.cpp
src/gromacs/analysisdata/tests/datatest.cpp [moved from src/testutils/datatest.cpp with 98% similarity]
src/gromacs/analysisdata/tests/datatest.h [moved from src/testutils/datatest.h with 98% similarity]
src/gromacs/analysisdata/tests/histogram.cpp
src/gromacs/analysisdata/tests/lifetime.cpp
src/gromacs/analysisdata/tests/mock_datamodule.cpp [moved from src/testutils/mock_datamodule.cpp with 99% similarity]
src/gromacs/analysisdata/tests/mock_datamodule.h [moved from src/testutils/mock_datamodule.h with 94% similarity]
src/gromacs/analysisdata/tests/refdata/analysisdata-referencedata.xsl
src/gromacs/commandline/tests/CMakeLists.txt
src/gromacs/commandline/tests/cmdlinemodulemanager.cpp
src/gromacs/onlinehelp/tests/CMakeLists.txt
src/gromacs/onlinehelp/tests/helpmanager.cpp
src/gromacs/onlinehelp/tests/mock_helptopic.cpp [moved from src/testutils/mock_helptopic.cpp with 96% similarity]
src/gromacs/onlinehelp/tests/mock_helptopic.h [moved from src/testutils/mock_helptopic.h with 93% similarity]
src/gromacs/trajectoryanalysis/tests/CMakeLists.txt
src/gromacs/trajectoryanalysis/tests/moduletest.cpp
src/gromacs/trajectoryanalysis/tests/refdata/analysisdata-referencedata.xsl
src/testutils/analysisdata-referencedata.xsl [deleted file]
src/testutils/copy_xsl.sh

index 48734404d32fc6a7344316e257c50d154bcd369c..f3cc0e022d625938a5850ecab9157e64eb472f63 100755 (executable)
@@ -572,7 +572,7 @@ class IncludeFileChecker(object):
         intramodule = \
                 (checkfile.module.get_top_level_module() == \
                  otherfile.module.get_top_level_module())
-        if otherfile.type not in ('publicheader', 'libheader'):
+        if otherfile.type not in ('publicheader', 'libheader', 'test'):
             if not intramodule and not _is_legacy_module(otherfile.module):
                 reporter.error(checkfile.path,
                         'included file "{0}" is missing API definition'
@@ -622,7 +622,7 @@ class GraphBuilder(object):
                 (fromfile.module.get_top_level_module() == \
                  tofile.module.get_top_level_module())
         is_legacy = _is_legacy_module(tofile.module)
-        if tofile.type not in ('publicheader', 'libheader', 'header'):
+        if tofile.type not in ('publicheader', 'libheader', 'header', 'test'):
             if intramodule:
                 link_type = 'intramodule'
             elif is_legacy:
@@ -631,6 +631,8 @@ class GraphBuilder(object):
                 link_type = 'undocumented'
         elif fromfile.type == 'test':
             link_type = 'test'
+        elif tofile.type == 'test':
+            link_type = 'undocumented'
         elif fromfile.type in ('source', 'header', 'implheader') and \
                 not fromfile.is_installed():
             if intramodule:
index 4dd11ef08f0eaca7b59de8fdff8798e73f5941a3..7bde033ed629630fbcd4c9fb25e8d3264c7c1be4 100644 (file)
@@ -1,7 +1,7 @@
 #
 # This file is part of the GROMACS molecular simulation package.
 #
-# Copyright (c) 2011,2012,2013, by the GROMACS development team, led by
+# Copyright (c) 2011,2012,2013,2014, 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.
 
+add_library(analysisdata-test-shared OBJECT
+            datatest.cpp
+            mock_datamodule.cpp)
+
 gmx_add_unit_test(AnalysisDataUnitTests analysisdata-test
                   analysisdata.cpp
                   arraydata.cpp
                   average.cpp
                   histogram.cpp
-                  lifetime.cpp)
+                  lifetime.cpp
+                  $<TARGET_OBJECTS:analysisdata-test-shared>)
index 6239b4e213049c229f1b59b586692b4a893c9639..a957085010fc0e8332188b484f92a9ecab2147d6 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2011,2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2011,2012,2013,2014, 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.
@@ -52,8 +52,8 @@
 #include "gromacs/analysisdata/paralleloptions.h"
 #include "gromacs/utility/exceptions.h"
 
-#include "testutils/datatest.h"
-#include "testutils/mock_datamodule.h"
+#include "gromacs/analysisdata/tests/datatest.h"
+#include "gromacs/analysisdata/tests/mock_datamodule.h"
 #include "testutils/testasserts.h"
 
 using gmx::test::AnalysisDataTestInput;
index 9305633f2d349512167120e025cf7bb03fe42a31..74601b265d0f96e108d2cd1672a472f46195c2f6 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, 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.
@@ -48,7 +48,7 @@
 
 #include "gromacs/analysisdata/arraydata.h"
 
-#include "testutils/datatest.h"
+#include "gromacs/analysisdata/tests/datatest.h"
 #include "testutils/testasserts.h"
 
 using gmx::test::AnalysisDataTestInput;
index 49aa2c00cc1333f0d80e221da77a995b2d19042b..f0b540da91776b7104842792bbe51e980a01be34 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, 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.
@@ -51,7 +51,7 @@
 #include "gromacs/analysisdata/analysisdata.h"
 #include "gromacs/analysisdata/modules/average.h"
 
-#include "testutils/datatest.h"
+#include "gromacs/analysisdata/tests/datatest.h"
 #include "testutils/testasserts.h"
 
 using gmx::test::AnalysisDataTestInput;
similarity index 98%
rename from src/testutils/datatest.cpp
rename to src/gromacs/analysisdata/tests/datatest.cpp
index a78a44f19445c9f003ace2a3e306688808222d05..743b4f8f3b6b24f75c06ec9cf3884a71f0ea49b5 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2011,2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2011,2012,2013,2014, 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.
@@ -37,7 +37,7 @@
  * Implements classes in datatest.h.
  *
  * \author Teemu Murtola <teemu.murtola@gmail.com>
- * \ingroup module_testutils
+ * \ingroup module_analysisdata
  */
 #include "datatest.h"
 
@@ -49,7 +49,7 @@
 #include "gromacs/utility/gmxassert.h"
 #include "gromacs/utility/stringutil.h"
 
-#include "testutils/mock_datamodule.h"
+#include "gromacs/analysisdata/tests/mock_datamodule.h"
 #include "testutils/refdata.h"
 
 namespace gmx
similarity index 98%
rename from src/testutils/datatest.h
rename to src/gromacs/analysisdata/tests/datatest.h
index bb7c0765404f82f4e6502255b5e767e5bb72789b..579c6211d47f8de1dfad39d9c03836a3022df867 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2011,2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2011,2012,2013,2014, 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.
  *
  * \author Teemu Murtola <teemu.murtola@gmail.com>
  * \inlibraryapi
- * \ingroup module_testutils
+ * \ingroup module_analysisdata
  */
-#ifndef GMX_TESTUTILS_DATATEST_H
-#define GMX_TESTUTILS_DATATEST_H
+#ifndef GMX_ANALYSISDATA_TESTS_DATATEST_H
+#define GMX_ANALYSISDATA_TESTS_DATATEST_H
 
 #include <vector>
 
@@ -73,7 +73,7 @@ namespace test
  * between.
  *
  * \inlibraryapi
- * \ingroup module_testutils
+ * \ingroup module_analysisdata
  */
 class AnalysisDataTestInputPointSet
 {
@@ -145,7 +145,7 @@ class AnalysisDataTestInputPointSet
  * Represents a single frame in AnalysisDataTestInput structure.
  *
  * \inlibraryapi
- * \ingroup module_testutils
+ * \ingroup module_analysisdata
  */
 class AnalysisDataTestInputFrame
 {
@@ -202,7 +202,7 @@ class AnalysisDataTestInputFrame
  * \see AnalysisDataTestFixture
  *
  * \inlibraryapi
- * \ingroup module_testutils
+ * \ingroup module_analysisdata
  */
 class AnalysisDataTestInput
 {
@@ -285,7 +285,7 @@ class AnalysisDataTestInput
  * \see AnalysisDataTestInput
  *
  * \inlibraryapi
- * \ingroup module_testutils
+ * \ingroup module_analysisdata
  */
 class AnalysisDataTestFixture : public ::testing::Test
 {
index d2963997801e54746387d388e57fc2878dbd4cfc..f68a8b0213902d017e7bdfe2f30f92eb98243f09 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, 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.
@@ -51,7 +51,7 @@
 #include "gromacs/analysisdata/analysisdata.h"
 #include "gromacs/analysisdata/modules/histogram.h"
 
-#include "testutils/datatest.h"
+#include "gromacs/analysisdata/tests/datatest.h"
 #include "testutils/testasserts.h"
 
 using gmx::test::AnalysisDataTestInput;
index ae8eadfb804df9dd034aa10a489b7330ddeafabf..16a9e886a971ca3108a84fbc8869db1ae30e8716 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2013, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014, 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.
@@ -50,7 +50,7 @@
 #include "gromacs/analysisdata/analysisdata.h"
 #include "gromacs/analysisdata/modules/lifetime.h"
 
-#include "testutils/datatest.h"
+#include "gromacs/analysisdata/tests/datatest.h"
 #include "testutils/testasserts.h"
 
 using gmx::test::AnalysisDataTestInput;
similarity index 99%
rename from src/testutils/mock_datamodule.cpp
rename to src/gromacs/analysisdata/tests/mock_datamodule.cpp
index 48bbc0640db12fa105907b0122da447e7fdaf57f..ce4887ede0fe436eab75b336a8f4f03618bb1a5f 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2011,2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2011,2012,2013,2014, 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.
@@ -37,7 +37,7 @@
  * Implements classes in mock_datamodule.h.
  *
  * \author Teemu Murtola <teemu.murtola@gmail.com>
- * \ingroup module_testutils
+ * \ingroup module_analysisdata
  */
 #include "mock_datamodule.h"
 
@@ -49,7 +49,7 @@
 #include "gromacs/utility/gmxassert.h"
 #include "gromacs/utility/stringutil.h"
 
-#include "testutils/datatest.h"
+#include "gromacs/analysisdata/tests/datatest.h"
 #include "testutils/refdata.h"
 #include "testutils/testasserts.h"
 
@@ -65,7 +65,7 @@ namespace test
 /*! \internal \brief
  * Private implementation class for gmx::test::MockAnalysisDataModule.
  *
- * \ingroup module_testutils
+ * \ingroup module_analysisdata
  */
 class MockAnalysisDataModule::Impl
 {
@@ -129,7 +129,7 @@ namespace
 /*! \internal \brief
  * Checks a single AnalysisDataValue.
  *
- * \ingroup module_testutils
+ * \ingroup module_analysisdata
  */
 void checkReferenceDataPoint(TestReferenceChecker    *checker,
                              const AnalysisDataValue &value)
similarity index 94%
rename from src/testutils/mock_datamodule.h
rename to src/gromacs/analysisdata/tests/mock_datamodule.h
index df632f251d00191cc49174069732728adfec4f5f..bbc18bded7c085a19b6ff79782f0abe12bee8667 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2011,2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2011,2012,2013,2014, 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.
  *
  * \author Teemu Murtola <teemu.murtola@gmail.com>
  * \inlibraryapi
- * \ingroup module_testutils
+ * \ingroup module_analysisdata
  */
-#ifndef GMX_TESTUTILS_MOCK_DATAMODULE_H
-#define GMX_TESTUTILS_MOCK_DATAMODULE_H
+#ifndef GMX_ANALYSISDATA_TESTS_MOCK_DATAMODULE_H
+#define GMX_ANALYSISDATA_TESTS_MOCK_DATAMODULE_H
 
 #include <boost/shared_ptr.hpp>
 #include <gmock/gmock.h>
index 9223385238c2e5c31edd3d1071226396511a3791..03ed3db01e160a6fc4042f5fafe5b506f6742a9d 100644 (file)
@@ -4,8 +4,8 @@
 This file is currently duplicated to each directory containing reference data
 XML files. This is to make it compatible with more browsers.
 To keep these files in sync, please only modify the version in
-  src/testutils/
-and use the copy_xsl.sh script to copy it to relevant locations.
+  src/gromacs/analysisdata/tests/refdata/
+and use the src/testutils/copy_xsl.sh script to copy it to relevant locations.
 -->
 <xsl:stylesheet version="1.0"
     xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
index e7e963bfb750c7c53e52349485a693cddf7f1997..58b0021fe7eb0d83fd675d0f7dc31f4aa563c7a9 100644 (file)
@@ -1,7 +1,7 @@
 #
 # This file is part of the GROMACS molecular simulation package.
 #
-# Copyright (c) 2012, by the GROMACS development team, led by
+# Copyright (c) 2012,2014, 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.
@@ -35,4 +35,5 @@
 gmx_add_unit_test(CommandLineUnitTests commandline-test
                   cmdlinehelpwriter.cpp
                   cmdlinemodulemanager.cpp
-                  cmdlineparser.cpp)
+                  cmdlineparser.cpp
+                  $<TARGET_OBJECTS:onlinehelp-test-shared>)
index 2fdd7fa2adcd4ae38be3834a7df9ff7d235b760e..07b946215bb4e4d9ecf2c35dc9a51ce7aa0627a0 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, 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.
@@ -53,8 +53,8 @@
 #include "gromacs/commandline/cmdlinemodulemanager.h"
 #include "gromacs/utility/programinfo.h"
 
+#include "gromacs/onlinehelp/tests/mock_helptopic.h"
 #include "testutils/cmdlinetest.h"
-#include "testutils/mock_helptopic.h"
 #include "testutils/testasserts.h"
 
 namespace
index 83f923bffca756115c95a536bb04cc02f19e7ef2..05427ea08eb702508ee4dedc05fea67cb0a4b8ed 100644 (file)
@@ -1,7 +1,7 @@
 #
 # This file is part of the GROMACS molecular simulation package.
 #
-# Copyright (c) 2012, by the GROMACS development team, led by
+# Copyright (c) 2012,2014, 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.
 
+add_library(onlinehelp-test-shared OBJECT
+            mock_helptopic.cpp)
+
 gmx_add_unit_test(OnlineHelpUnitTests onlinehelp-test
                   helpformat.cpp
-                  helpmanager.cpp)
+                  helpmanager.cpp
+                  $<TARGET_OBJECTS:onlinehelp-test-shared>)
index 14baefd832be3ff583c237832512085ae4514418..b3ce50e09fdc497715dc97da84abdbc6c89c1a88 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, 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.
@@ -51,7 +51,7 @@
 #include "gromacs/utility/exceptions.h"
 #include "gromacs/utility/file.h"
 
-#include "testutils/mock_helptopic.h"
+#include "gromacs/onlinehelp/tests/mock_helptopic.h"
 #include "testutils/stringtest.h"
 #include "testutils/testasserts.h"
 #include "testutils/testfilemanager.h"
similarity index 96%
rename from src/testutils/mock_helptopic.cpp
rename to src/gromacs/onlinehelp/tests/mock_helptopic.cpp
index 826e6a4b34e4374e714a1f2f06994bcc0b7f4af1..f982a7ac16479594e5c7fd02f15e0174ca53fdd6 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012, by the GROMACS development team, led by
+ * Copyright (c) 2012,2014, 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.
@@ -37,7 +37,7 @@
  * Implements classes in mock_helptopic.h.
  *
  * \author Teemu Murtola <teemu.murtola@gmail.com>
- * \ingroup module_testutils
+ * \ingroup module_onlinehelp
  */
 #include "mock_helptopic.h"
 
similarity index 93%
rename from src/testutils/mock_helptopic.h
rename to src/gromacs/onlinehelp/tests/mock_helptopic.h
index 471e0e5e90100023d937f141aade169ae31de39f..f0b0b61d7b70dafe934ad13c02483e136ec43239 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012, by the GROMACS development team, led by
+ * Copyright (c) 2012,2014, 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.
  *
  * \author Teemu Murtola <teemu.murtola@gmail.com>
  * \inlibraryapi
- * \ingroup module_testutils
+ * \ingroup module_onlinehelp
  */
-#ifndef GMX_TESTUTILS_MOCK_HELPTOPIC_H
-#define GMX_TESTUTILS_MOCK_HELPTOPIC_H
+#ifndef GMX_ONLINEHELP_TESTS_MOCK_HELPTOPIC_H
+#define GMX_ONLINEHELP_TESTS_MOCK_HELPTOPIC_H
 
 #include <gmock/gmock.h>
 
index 4bdd6b71bf8db44c703f8db33a93c07126aff38f..913645d7caa58c92b04acddb299d667e836ef8f8 100644 (file)
@@ -1,7 +1,7 @@
 #
 # This file is part of the GROMACS molecular simulation package.
 #
-# Copyright (c) 2010,2012,2013, by the GROMACS development team, led by
+# Copyright (c) 2010,2012,2013,2014, 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.
@@ -37,7 +37,8 @@ gmx_add_unit_test(TrajectoryAnalysisUnitTests trajectoryanalysis-test
                   angle.cpp
                   distance.cpp
                   freevolume.cpp
-                  select.cpp)
+                  select.cpp
+                  $<TARGET_OBJECTS:analysisdata-test-shared>)
 
 add_executable(test_selection test_selection.cpp)
 target_link_libraries(test_selection libgromacs ${GMX_EXE_LINKER_FLAGS})
index 5d2a241206e86ae56e1c209b129930a40daad830..38f071e738bee5f8dd82f04105e60c158fa64a69 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, 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.
@@ -49,8 +49,8 @@
 #include "gromacs/trajectoryanalysis/cmdlinerunner.h"
 #include "gromacs/utility/file.h"
 
+#include "gromacs/analysisdata/tests/datatest.h"
 #include "testutils/cmdlinetest.h"
-#include "testutils/datatest.h"
 #include "testutils/refdata.h"
 #include "testutils/testasserts.h"
 #include "testutils/testfilemanager.h"
index 9223385238c2e5c31edd3d1071226396511a3791..03ed3db01e160a6fc4042f5fafe5b506f6742a9d 100644 (file)
@@ -4,8 +4,8 @@
 This file is currently duplicated to each directory containing reference data
 XML files. This is to make it compatible with more browsers.
 To keep these files in sync, please only modify the version in
-  src/testutils/
-and use the copy_xsl.sh script to copy it to relevant locations.
+  src/gromacs/analysisdata/tests/refdata/
+and use the src/testutils/copy_xsl.sh script to copy it to relevant locations.
 -->
 <xsl:stylesheet version="1.0"
     xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
diff --git a/src/testutils/analysisdata-referencedata.xsl b/src/testutils/analysisdata-referencedata.xsl
deleted file mode 100644 (file)
index 9223385..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-<?xml version="1.0"?>
-
-<!--
-This file is currently duplicated to each directory containing reference data
-XML files. This is to make it compatible with more browsers.
-To keep these files in sync, please only modify the version in
-  src/testutils/
-and use the copy_xsl.sh script to copy it to relevant locations.
--->
-<xsl:stylesheet version="1.0"
-    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
-
-<xsl:import href="common-referencedata.xsl"/>
-
-<xsl:template match="AnalysisData">
-    <xsl:variable name="has-datasetspec"
-                  select="DataFrame/DataValues/Int[@Name='DataSet']"/>
-    <xsl:variable name="has-columnspec"
-                  select="DataFrame/DataValues/Int[@Name='FirstColumn']"/>
-    <table border="1">
-        <tr>
-            <th>Frame</th>
-            <th>X</th>
-            <xsl:if test="$has-datasetspec">
-                <th>Set</th>
-            </xsl:if>
-            <xsl:if test="$has-columnspec">
-                <th>Columns</th>
-            </xsl:if>
-            <th>Values</th>
-        </tr>
-        <xsl:for-each select="DataFrame/DataValues">
-        <tr>
-            <td><xsl:value-of select="../@Name"/></td>
-            <td><xsl:value-of select="../Real[@Name='X']"/></td>
-            <xsl:if test="$has-datasetspec">
-                <td><xsl:value-of select="Int[@Name='DataSet']"/></td>
-            </xsl:if>
-            <xsl:if test="$has-columnspec">
-                <td>
-                    <xsl:choose>
-                        <xsl:when test="Int[@Name='FirstColumn']">
-                            <xsl:value-of select="Int[@Name='FirstColumn']"/>
-                            <xsl:text>-</xsl:text>
-                            <xsl:value-of select="Int[@Name='LastColumn']"/>
-                        </xsl:when>
-                        <xsl:otherwise>all</xsl:otherwise>
-                    </xsl:choose>
-                </td>
-            </xsl:if>
-            <td><xsl:call-template name="SequenceAsCSV"/></td>
-        </tr>
-        </xsl:for-each>
-    </table>
-</xsl:template>
-
-<xsl:template match="DataValue[Bool[@Name='Present']='false']">
-    (
-    <xsl:value-of select="Real[@Name='Value']"/>
-    <xsl:if test="Real[@Name='Error']">
-        &#177; <xsl:value-of select="Real[@Name='Error']"/>
-    </xsl:if>
-    )
-</xsl:template>
-<xsl:template match="DataValue">
-    <xsl:value-of select="Real[@Name='Value']"/>
-    <xsl:if test="Real[@Name='Error']">
-        &#177; <xsl:value-of select="Real[@Name='Error']"/>
-    </xsl:if>
-</xsl:template>
-
-</xsl:stylesheet>
index 6f8b510b474dfb460e9346d926fb1af09d3fd44c..7d1e7cef32fd65b5138c969215d1642b4f46630e 100755 (executable)
@@ -10,7 +10,7 @@ for destdir in analysisdata selection trajectoryanalysis ; do
           src/gromacs/$destdir/tests/refdata/
 done
 
-for destdir in analysisdata trajectoryanalysis ; do
-    cp -f src/testutils/analysisdata-referencedata.xsl \
+for destdir in trajectoryanalysis ; do
+    cp -f src/gromacs/analysisdata/tests/refdata/analysisdata-referencedata.xsl \
           src/gromacs/$destdir/tests/refdata/
 done