/*
* 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
{
* 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(("GMX_MAXBACKUP="+s_maxBackup).c_str());
-#else
- setenv("GMX_MAXBACKUP", s_maxBackup.c_str(), true);
-#endif
}
IntegrationTestFixture::~IntegrationTestFixture()
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"),