Add testing utility for in-place modification of input files
[alexxy/gromacs.git] / src / testutils / cmdlinetest.h
index 1065022fd40dd12b252c9c1389f72caa5332cf56..4febb0d70e645ff95f8a431d37c66067be9c7577 100644 (file)
@@ -389,6 +389,17 @@ class CommandLineTestBase : public ::testing::Test
         void setInputFile(const char *option, const char *filename);
         //! \copydoc setInputFile(const char *, const char *);
         void setInputFile(const char *option, const std::string &filename);
+        /*! \brief
+         * Sets an input file that may be modified. The file is copied to a
+         * temporary file, which is used as the test input
+         *
+         * \param[in]     option    Option to set.
+         * \param[in]     filename  Name of the input file.
+         *
+         */
+        void setModifiableInputFile(const char *option, const char *filename);
+        //! \copydoc setModifiableInputFile(const char *, const char *);
+        void setModifiableInputFile(const char *option, const std::string &filename);
         /*! \brief
          * Generates and sets an input file.
          *
@@ -419,6 +430,15 @@ class CommandLineTestBase : public ::testing::Test
          */
         void setOutputFile(const char *option, const char *filename,
                            const IFileMatcherSettings &matcher);
+        /*! \brief
+         * Sets a file parameter that is used for input and modified as output. The input file
+         * is copied to a temporary file that is used as input and can be modified.
+         */
+        void setInputAndOutputFile(const char *option, const char *filename,
+                                   const ITextBlockMatcherSettings &matcher);
+        //! \copydoc setInputAndOutputFile(const char *, const char *, const ITextBlockMatcherSettings&);
+        void setInputAndOutputFile(const char *option, const char *filename,
+                                   const IFileMatcherSettings &matcher);
 
         /*! \brief
          * Returns the internal CommandLine object used to construct the