Refactor mdrun integration tests
[alexxy/gromacs.git] / src / programs / mdrun / tests / replicaexchange.cpp
index 3cd40eac2b06c0f164a3565a27451fe0f43aac3a..37d9e02c124b3288e4772dc4145eabdc28a930a2 100644 (file)
@@ -40,7 +40,9 @@
  * \author Mark Abraham <mark.j.abraham@gmail.com>
  * \ingroup module_mdrun
  */
-#include "moduletest.h"
+#include "gmxpre.h"
+
+#include "config.h"
 
 #include <math.h>
 
 
 #include <gtest/gtest.h>
 
-#include "gromacs/legacyheaders/network.h"
-#include "gromacs/legacyheaders/types/simple.h"
-#include "gromacs/fileio/path.h"
+#include "gromacs/utility/basenetwork.h"
+#include "gromacs/utility/path.h"
+#include "gromacs/utility/real.h"
 #include "gromacs/utility/stringutil.h"
-
-#include "../mdrun_main.h"
+#include "programs/mdrun/mdrun_main.h"
 
 #include "testutils/cmdlinetest.h"
 
+#include "moduletest.h"
+
 namespace
 {
 
@@ -102,9 +105,9 @@ class ReplicaExchangeTest : public gmx::test::ParameterizedMdrunTestFixture
 
             /* Prepare grompp output filenames inside the new
                temporary directory */
-            mdpInputFileName  = fileManager_.getTemporaryFilePath("input.mdp");
-            mdpOutputFileName = fileManager_.getTemporaryFilePath("output.mdp");
-            tprFileName       = fileManager_.getTemporaryFilePath(".tpr");
+            runner_.mdpInputFileName_  = fileManager_.getTemporaryFilePath("input.mdp");
+            runner_.mdpOutputFileName_ = fileManager_.getTemporaryFilePath("output.mdp");
+            runner_.tprFileName_       = fileManager_.getTemporaryFilePath(".tpr");
 
             mdrunCaller.addOption("-deffnm", fileManager_.getTestSpecificFileNameRoot());
         }
@@ -148,7 +151,7 @@ class ReplicaExchangeTest : public gmx::test::ParameterizedMdrunTestFixture
                        occur. */
                     std::max(baseTemperature - 10 * rank, real(0)),
                     controlVariable);
-            useStringAsMdpFile(mdpFileContents);
+            runner_.useStringAsMdpFile(mdpFileContents);
         }
 
         //! MPI process set size
@@ -180,10 +183,10 @@ TEST_P(ReplicaExchangeTest, ExitsNormally)
     organizeMultidir();
     const char *pcoupl = GetParam();
     organizeMdpFile(pcoupl);
-    useTopGroAndNdxFromDatabase("spc2");
+    runner_.useTopGroAndNdxFromDatabase("spc2");
     /* Call grompp on every rank - the standard callGrompp() only runs
        grompp on rank 0. */
-    EXPECT_EQ(0, callGromppOnThisRank());
+    EXPECT_EQ(0, runner_.callGromppOnThisRank());
 
     mdrunCaller.addOption("-replex", 1);
     ASSERT_EQ(0, gmx_mdrun(mdrunCaller.argc(), mdrunCaller.argv()));