Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix hidden visibility win fix test #557

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 4 additions & 19 deletions testing/include/gz/common/testing/CMakeTestPaths.hh
Original file line number Diff line number Diff line change
Expand Up @@ -28,24 +28,12 @@ namespace gz::common::testing
///
/// It is not intended that users will directly construct this, but rather
/// utilize the TestPathFactory.

/// TODO(jrivero) Remove warning disable when bumping MSVC on CI
/// MSVC v16.11.25 complains about the TestPaths class not having a DLL although
/// relevant members of it have visiblity defined:
/// "non dll-interface class 'gz::common::testing::TestPaths' used as base for
/// dll-interface class 'gz::common::testing::CMakeTestPaths'"
///
/// Workaround on this problems triggers new warnings and suffering and
/// more recent versions of MSVC do not trigger that warning anymore.
/// Conclusion: disable the warning.
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable: 4275)
#endif
class GZ_COMMON_TESTING_VISIBLE CMakeTestPaths: public TestPaths
{
/// \brief Constructor from TestPaths
public: using TestPaths::TestPaths;
/// \brief Constructor
/// \param[in] _projectSourcePath Path to the root of the project source
public: explicit CMakeTestPaths(
const std::string &_projectSourcePath = kTestingProjectSourceDir);

/// \brief Destructor
public: ~CMakeTestPaths() override;
Expand All @@ -57,7 +45,4 @@ class GZ_COMMON_TESTING_VISIBLE CMakeTestPaths: public TestPaths
public: bool TestTmpPath(std::string &_tmpDir) override;
};
} // namespace gz::common::testing
#ifdef _MSC_VER
# pragma warning( pop )
#endif
#endif // GZ_COMMON_TESTING_CMAKETESTPATHS_HH_
9 changes: 7 additions & 2 deletions testing/include/gz/common/testing/TestPaths.hh
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@

#include "gz/common/testing/Export.hh"

#include <gz/utils/SuppressWarning.hh>

#ifndef TESTING_PROJECT_SOURCE_DIR
#define TESTING_PROJECT_SOURCE_DIR ""
#endif
Expand Down Expand Up @@ -53,17 +55,18 @@ enum class GZ_COMMON_TESTING_VISIBLE BuildType
kBazel
};


//////////////////////////////////////////////////
/// \brief Helper interface to generate path information to support
/// test access to source/data files
///
/// It is intended that there is an implementation of this interface for
/// each relevant buildsystem.
class TestPaths
class GZ_COMMON_TESTING_VISIBLE TestPaths
{
/// \brief Constructor
/// \param[in] _projectSourcePath Path to the root of the project source
public: explicit GZ_COMMON_TESTING_VISIBLE TestPaths(
public: explicit TestPaths(
const std::string &_projectSourcePath = kTestingProjectSourceDir);

/// \brief Destructor
Expand All @@ -79,7 +82,9 @@ class TestPaths
/// \return True if path successfully found and set, false otherwise
public: virtual bool TestTmpPath(std::string &_tmpDir) = 0;

GZ_UTILS_WARN_IGNORE__DLL_INTERFACE_MISSING
protected: std::string projectSourcePath;
GZ_UTILS_WARN_RESUME__DLL_INTERFACE_MISSING
};

//////////////////////////////////////////////////
Expand Down
6 changes: 6 additions & 0 deletions testing/src/CMakeTestPaths.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@
namespace gz::common::testing
{

//////////////////////////////////////////////////
CMakeTestPaths::CMakeTestPaths(const std::string &_projectSourcePath)
: TestPaths(_projectSourcePath)
{
}

//////////////////////////////////////////////////
CMakeTestPaths::~CMakeTestPaths() = default;

Expand Down
Loading