Improve testutils infrastructure
[alexxy/gromacs.git] / src / testutils / include / testutils / testfilemanager.h
index d9b8e7c2b1b3aef2467de7d9536ce48011bf7db1..eeaa07fe7f8630c4aefbc589e71b47227cd82114 100644 (file)
@@ -114,6 +114,23 @@ public:
     //! \copydoc TestFileManager::getTemporaryFilePath(const char *)
     std::string getTemporaryFilePath(const std::string& suffix);
 
+    /*! \brief
+     * Manage cleaning up this output file whose name was generated
+     *
+     * \param[in] filename  Filename relative to the working directory
+     *                        (which is generally not the output directory)
+     *
+     * This method should only be called from within a Google Test
+     * test. It lets the TestFileManager know to attempt to clean up
+     * the named file. That file should normally be one whose name is
+     * generated by the tool under test. For an output file whose name
+     * is specified by e.g. an input command-line option, pass the
+     * return value of getTemporaryFilePath() to that option.
+     */
+    void manageGeneratedOutputFile(const char* filename);
+    //! \copydoc TestFileManager::manageGeneratedOutputFile(const char *)
+    void manageGeneratedOutputFile(std::string&& filename);
+
     /*! \brief Returns the path to the output temporary directory
      * for tests which use this TestFileManager object.
      *