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 rendering tests #561

Merged
merged 14 commits into from
Aug 21, 2023
3 changes: 3 additions & 0 deletions test/integration/marker_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -211,4 +211,7 @@ TEST_F(MarkerManagerTestFixture,

// Cleanup
plugins.clear();
scene.reset();

window->QuickWindow()->close();
}
4 changes: 2 additions & 2 deletions test/integration/minimal_scene.cc
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ TEST(MinimalSceneTest, GZ_UTILS_TEST_ENABLED_ONLY_ON_LINUX(Config))
EXPECT_TRUE(app.RemovePlugin(pluginName));
plugins.clear();


scene.reset();
win->QuickWindow()->close();
engine->DestroyScene(scene);
EXPECT_TRUE(rendering::unloadEngine(engine->Name()));
}
11 changes: 5 additions & 6 deletions test/integration/transport_scene_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,10 @@ TEST(TransportSceneManagerTest, GZ_UTILS_TEST_ENABLED_ONLY_ON_LINUX(Config))
// Show, but don't exec, so we don't block
win->QuickWindow()->show();

// get render engine after window is shown
auto engine = gz::gui::testing::getRenderEngine("ogre2");
ASSERT_NE(nullptr, engine);

int sleep = 0;
int maxSleep = 30;
while (!sceneRequested && sleep < maxSleep)
Expand All @@ -166,10 +170,6 @@ TEST(TransportSceneManagerTest, GZ_UTILS_TEST_ENABLED_ONLY_ON_LINUX(Config))
EXPECT_TRUE(sceneRequested);
EXPECT_LT(sleep, maxSleep);

// get render engine after window is shown
auto engine = gz::gui::testing::getRenderEngine("ogre2");
ASSERT_NE(nullptr, engine);

auto scene = engine->SceneByName("banana");
ASSERT_NE(nullptr, scene);

Expand Down Expand Up @@ -260,8 +260,7 @@ TEST(TransportSceneManagerTest, GZ_UTILS_TEST_ENABLED_ONLY_ON_LINUX(Config))
}
plugins.clear();

scene.reset();
win->QuickWindow()->close();
engine->DestroyScene(scene);
EXPECT_TRUE(rendering::unloadEngine(engine->Name()));
}

Loading