Skip to content

Commit

Permalink
Disable tests that don't work on Windows
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Carroll <[email protected]>
  • Loading branch information
mjcarroll committed Aug 16, 2022
1 parent 364d220 commit 845480d
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 11 deletions.
4 changes: 3 additions & 1 deletion test/common_test/Material_TEST.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
#include "gz/rendering/ShaderType.hh"
#include "gz/rendering/Scene.hh"

#include <gz/utils/ExtraTestMacros.hh>

using namespace gz;
using namespace rendering;

Expand Down Expand Up @@ -332,7 +334,7 @@ TEST_F(MaterialTest, MaterialProperties)
}

/////////////////////////////////////////////////
TEST_F(MaterialTest, Copy)
TEST_F(MaterialTest, GZ_UTILS_TEST_DISABLED_ON_WIN32(Copy))
{
ScenePtr scene = engine->CreateScene("copy_scene");
ASSERT_NE(nullptr, scene);
Expand Down
30 changes: 20 additions & 10 deletions test/regression/reload_engine.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,16 @@
#include <gz/rendering/ThermalCamera.hh>
#include <gz/rendering/WideAngleCamera.hh>

#include <gz/utils/ExtraTestMacros.hh>

constexpr auto kNumRetries = 3;

/// \brief Test fixture for reloading engines.
/// Since the CommonRenderingTest loads an engine by default,
/// we are doing a custom implementation here.
class ReloadEngineTest: public ::testing::Test
{
/// \brief Set up the test fixture
public: void SetUp() override
{
gz::common::Console::SetVerbosity(4);
Expand All @@ -43,23 +49,28 @@ class ReloadEngineTest: public ::testing::Test
}

this->engineToTest = envEngine;
this->params = GetEngineParams(envEngine, envBackend, envHeadless);
this->engineParams = GetEngineParams(envEngine, envBackend, envHeadless);
}

/// \brief Load the configured engine and run a series of rendering commands
/// \param[in] _exec Function to execute on loaded engine
public: void Run(std::function<void(gz::rendering::RenderEngine*)> _exec)
{
for (size_t ii = 0; ii < kNumRetries; ++ii)
{
auto engine = gz::rendering::engine(this->engineToTest, this->params);
_exec(engine);
auto engine = gz::rendering::engine(this->engineToTest,
this->engineParams);
ASSERT_NE(nullptr, engine);
_exec(engine);
ASSERT_TRUE(gz::rendering::unloadEngine(this->engineToTest));
}
}

/// \brief Engine under test
protected: std::string engineToTest;

protected: std::map<std::string, std::string> params;
/// \brief Parameters for spawning rendering engine
protected: std::map<std::string, std::string> engineParams;
};

/////////////////////////////////////////////////
Expand Down Expand Up @@ -102,7 +113,7 @@ TEST_F(ReloadEngineTest, BoundingBoxCamera)
}

/////////////////////////////////////////////////
TEST_F(ReloadEngineTest, Camera)
TEST_F(ReloadEngineTest, GZ_UTILS_TEST_DISABLED_ON_WIN32(Camera))
{
this->Run([](auto engine){
auto scene = engine->CreateScene("scene");
Expand All @@ -122,7 +133,7 @@ TEST_F(ReloadEngineTest, Camera)
}

/////////////////////////////////////////////////
TEST_F(ReloadEngineTest, DepthCamera)
TEST_F(ReloadEngineTest, GZ_UTILS_TEST_DISABLED_ON_WIN32(DepthCamera))
{
this->Run([](auto engine){
auto scene = engine->CreateScene("scene");
Expand All @@ -142,7 +153,7 @@ TEST_F(ReloadEngineTest, DepthCamera)
}

/////////////////////////////////////////////////
TEST_F(ReloadEngineTest, GpuRays)
TEST_F(ReloadEngineTest, GZ_UTILS_TEST_DISABLED_ON_WIN32(GpuRays))
{
this->Run([](auto engine){
auto scene = engine->CreateScene("scene");
Expand Down Expand Up @@ -186,7 +197,7 @@ TEST_F(ReloadEngineTest, SegmentationCamera)
}

/////////////////////////////////////////////////
TEST_F(ReloadEngineTest, ThermalCamera)
TEST_F(ReloadEngineTest, GZ_UTILS_TEST_DISABLED_ON_WIN32(ThermalCamera))
{
CHECK_SUPPORTED_ENGINE("ogre", "ogre2");

Expand All @@ -208,7 +219,7 @@ TEST_F(ReloadEngineTest, ThermalCamera)
}

/////////////////////////////////////////////////
TEST_F(ReloadEngineTest, WideAngleCamera)
TEST_F(ReloadEngineTest, GZ_UTILS_TEST_DISABLED_ON_WIN32(WideAngleCamera))
{
CHECK_SUPPORTED_ENGINE("ogre");

Expand All @@ -228,4 +239,3 @@ TEST_F(ReloadEngineTest, WideAngleCamera)
engine->DestroyScene(scene);
});
}

0 comments on commit 845480d

Please sign in to comment.