Remove gmx::File (except for File::exists())
[alexxy/gromacs.git] / src / testutils / integrationtests.cpp
index db626c4a3d4bdee72eaf0c092a52aaf3daba5558..9913f6053ee00b7ff7e115d0596b669d8434aa62 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2013,2014, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015, 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.
 
 #include "integrationtests.h"
 
-#include "testutils/testoptions.h"
-#include "gromacs/utility/stringutil.h"
-#include "gromacs/utility/exceptions.h"
-#include "gromacs/options/options.h"
-#include "gromacs/options/basicoptions.h"
-#include "gromacs/utility/file.h"
-#include <stdlib.h>
 #include <stdio.h>
 
-#include "config.h"
+#include "gromacs/utility/exceptions.h"
+#include "gromacs/utility/textwriter.h"
 
 namespace gmx
 {
@@ -63,26 +57,8 @@ namespace test
  * IntegrationTestFixture
  */
 
-std::string IntegrationTestFixture::s_maxBackup("-1");
-
-//! \cond
-GMX_TEST_OPTIONS(IntegrationTestOptions, options)
-{
-    options->addOption(StringOption("max-backup")
-                           .store(&IntegrationTestFixture::s_maxBackup)
-                           .description("Maximum number of backup files of old test output to write (-1 prevents backups being created)"));
-}
-//! \endcond
-
 IntegrationTestFixture::IntegrationTestFixture()
 {
-    // TODO fix this when we have an encapsulation layer for handling
-    // environment variables
-#ifdef GMX_NATIVE_WINDOWS
-    _putenv_s("GMX_MAXBACKUP", s_maxBackup.c_str());
-#else
-    setenv("GMX_MAXBACKUP", s_maxBackup.c_str(), true);
-#endif
 }
 
 IntegrationTestFixture::~IntegrationTestFixture()
@@ -93,7 +69,7 @@ void
 IntegrationTestFixture::redirectStringToStdin(const char* theString)
 {
     std::string fakeStdin("fake-stdin");
-    gmx::File::writeFileFromString(fakeStdin, theString);
+    gmx::TextWriter::writeFileFromString(fakeStdin, theString);
     if (NULL == std::freopen(fakeStdin.c_str(), "r", stdin))
     {
         GMX_THROW_WITH_ERRNO(FileIOError("Failed to redirect a string to stdin"),