Skip to content

Commit

Permalink
Fix rendering tests (#561)
Browse files Browse the repository at this point in the history
* debugging

Signed-off-by: Ian Chen <[email protected]>

* reset cam

Signed-off-by: Ian Chen <[email protected]>

* more testing

Signed-off-by: Ian Chen <[email protected]>

* no unload

Signed-off-by: Ian Chen <[email protected]>

* more testing with no unload

Signed-off-by: Ian Chen <[email protected]>

* unload engine in gzrenderer

Signed-off-by: Ian Chen <[email protected]>

* unload engine in gzrenderer debugging

Signed-off-by: Ian Chen <[email protected]>

* unload engine in gzrenderer reset scene

Signed-off-by: Ian Chen <[email protected]>

* comment out unload

Signed-off-by: Ian Chen <[email protected]>

* increase timeout

Signed-off-by: Ian Chen <[email protected]>

* test timing

Signed-off-by: Ian Chen <[email protected]>

* cleanup

Signed-off-by: Ian Chen <[email protected]>

* cleanup

Signed-off-by: Ian Chen <[email protected]>

* more cleanup

Signed-off-by: Ian Chen <[email protected]>

---------

Signed-off-by: Ian Chen <[email protected]>
  • Loading branch information
iche033 authored Aug 21, 2023
1 parent e655d40 commit bb82bb8
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
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()));
}

0 comments on commit bb82bb8

Please sign in to comment.