Permit tests to specify the refdata filename
[alexxy/gromacs.git] / src / testutils / include / testutils / refdata.h
index e57b96769004ef258f462cf4360ea3d2785015c2..f3ae67b578582e1e243bb3cd10c5f96d39c27c0f 100644 (file)
@@ -40,6 +40,7 @@
  * See \ref page_refdata for more details.
  *
  * \author Teemu Murtola <teemu.murtola@gmail.com>
+ * \author Mark Abraham <mark.j.abraham@gmail.com>
  * \inlibraryapi
  * \ingroup module_testutils
  */
@@ -195,6 +196,17 @@ public:
      * Initializes the reference data in the global mode.
      */
     TestReferenceData();
+    /*! \brief Initializes the reference data in the global mode while
+     * providing the test name.
+     *
+     * Providing a name for the test, rather than using the default
+     * name generated by GoogleTest, is useful when many tests should
+     * share common reference data because e.g. they are
+     * value-parameterized over multiple equivalent implementations or
+     * run modes. The name should include a filename suffix
+     * e.g. `.xml` and refers to a file that will be found in the
+     * `refdata` subdirectory for the test case. */
+    explicit TestReferenceData(std::string testNameOverride);
     /*! \brief
      * Initializes the reference data in a specific mode.
      *