diff --git a/testing/include/gz/common/testing/CMakeTestPaths.hh b/testing/include/gz/common/testing/CMakeTestPaths.hh index 40c1d7c1..19fef93f 100644 --- a/testing/include/gz/common/testing/CMakeTestPaths.hh +++ b/testing/include/gz/common/testing/CMakeTestPaths.hh @@ -28,7 +28,7 @@ namespace gz::common::testing /// /// It is not intended that users will directly construct this, but rather /// utilize the TestPathFactory. -class CMakeTestPaths: public TestPaths +class GZ_COMMON_TESTING_VISIBLE CMakeTestPaths: public TestPaths { /// \brief Constructor /// \param[in] _projectSourcePath Path to the root of the project source diff --git a/testing/include/gz/common/testing/TestPaths.hh b/testing/include/gz/common/testing/TestPaths.hh index 00f95f52..a7d76a1a 100644 --- a/testing/include/gz/common/testing/TestPaths.hh +++ b/testing/include/gz/common/testing/TestPaths.hh @@ -55,7 +55,6 @@ enum class GZ_COMMON_TESTING_VISIBLE BuildType kBazel }; - ////////////////////////////////////////////////// /// \brief Helper interface to generate path information to support /// test access to source/data files @@ -83,6 +82,7 @@ class GZ_COMMON_TESTING_VISIBLE TestPaths public: virtual bool TestTmpPath(std::string &_tmpDir) = 0; GZ_UTILS_WARN_IGNORE__DLL_INTERFACE_MISSING + /// \brief Path to the root of the project source protected: std::string projectSourcePath; GZ_UTILS_WARN_RESUME__DLL_INTERFACE_MISSING }; diff --git a/testing/src/CMakeTestPaths_TEST.cc b/testing/src/CMakeTestPaths_TEST.cc index fb5047a0..b9730ff4 100644 --- a/testing/src/CMakeTestPaths_TEST.cc +++ b/testing/src/CMakeTestPaths_TEST.cc @@ -61,10 +61,10 @@ TEST(CMakeTestPaths, TestBuildType) ///////////////////////////////////////////////// TEST(CMakeTestPaths, ProjectSourcePath) { - auto testPaths = TestPathFactory(kTestingProjectSourceDir); + gz::common::testing::CMakeTestPaths testPaths; std::string sourceDir; - ASSERT_TRUE(testPaths->ProjectSourcePath(sourceDir)); + ASSERT_TRUE(testPaths.ProjectSourcePath(sourceDir)); ASSERT_FALSE(sourceDir.empty()); ASSERT_TRUE(exists(sourceDir)) << sourceDir; ASSERT_TRUE(isDirectory(sourceDir)); @@ -81,10 +81,10 @@ TEST(CMakeTestPaths, ProjectSourcePath) ///////////////////////////////////////////////// TEST(CMakeTestPaths, TestTmpPath) { - auto testPaths = TestPathFactory(kTestingProjectSourceDir); + gz::common::testing::CMakeTestPaths testPaths; std::string tmpDir; - ASSERT_TRUE(testPaths->TestTmpPath(tmpDir)); + ASSERT_TRUE(testPaths.TestTmpPath(tmpDir)); ASSERT_FALSE(tmpDir.empty()); ASSERT_TRUE(exists(tmpDir)) << tmpDir; ASSERT_TRUE(isDirectory(tmpDir));