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

UNIT_RenderingIface_TEST_ogre2_gl3plus test tries to load ogre and fails if it is not able to load it #1072

Open
traversaro opened this issue Oct 3, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@traversaro
Copy link
Contributor

Environment

  • OS Version: Ubuntu 24.04
  • Source or binary build? Source a9af984

Description

The UNIT_RenderingIface_TEST_ogre2_gl3plus fails if gz-rendering is compiled with ogre(1) support but no X server is available, as it actually tries to load ogre(1) plugin in

RenderEngine *eng = engine(0u);
ASSERT_NE(nullptr, eng);
auto engineName = eng->Name();
ASSERT_FALSE(engineName.empty());
EXPECT_TRUE(hasEngine(engineName));
EXPECT_NO_THROW(unregisterEngine(0u));
EXPECT_FALSE(hasEngine(engineName));
as it select the engine with index 0, that is ogre1.

Expected behavior:

I would expect that even if no X server is available (and so ogre plugin can't work), DISPLAY= ctest -VV -E "_ogre_" would be able to run.

Actual behavior:

With DISPLAY= ctest -VV -E "_ogre_" all tests pass fine, except for UNIT_RenderingIface_TEST_ogre2_gl3plus.

Steps to reproduce

You can see that UNIT_RenderingIface_TEST_ogre2_gl3plus fails if there is no X server by running it by setting DISPLAY to an empty variable

  1. DISPLAY= ctest -VV -R UNIT_RenderingIface_TEST_ogre2_gl3plus

Output

Running main() from /home/conda/feedstock_root/build_artifacts/gz-rendering8_1727901808682/work/test/gtest_vendor/src/gtest_main.cc
[==========] Running 3 tests from 1 test suite.
[----------] Global test environment set-up.
[----------] 3 tests from RenderingIfaceTest
[ RUN      ] RenderingIfaceTest.HasEngine
[       OK ] RenderingIfaceTest.HasEngine (0 ms)
[ RUN      ] RenderingIfaceTest.GetEngine
[Wrn] [Ogre2RenderEngine.cc:548] Unable to open display: . Trying to run in headless mode.
[Err] [RenderEngineManager.cc:484] Failed to load plugin [no_such_engine] : couldn't find shared library.
[Err] [RenderEngineManager.cc:231] Invalid render-engine index: 1000000
[Dbg] [CommonRenderingTest.hh:44] Read GZ_ENGINE_TO_TEST=ogre2
[Dbg] [CommonRenderingTest.hh:47] Read GZ_ENGINE_BACKEND=gl3plus
[Dbg] [RenderingIface.cc:135] No rendering engine is loaded yet
[Msg] Loading plugin [gz-rendering-ogre2]
[Dbg] [RenderingIface.cc:135] No rendering engine is loaded yet
[Msg] Loading plugin [no_such_engine]
[       OK ] RenderingIfaceTest.GetEngine (283 ms)
[ RUN      ] RenderingIfaceTest.RegisterEngine
[Err] [OgreRenderEngine.cc:358] Unable to open display: 
[Err] [OgreRenderEngine.cc:469] Unable to load Ogre Plugin[/home/conda/feedstock_root/build_artifacts/gz-rendering8_1727901808682/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeho/lib/OGRE/RenderSystem_GL]. Rendering will not be possible.Make sure you have installed OGRE properly.
[Err] [OgreRenderEngine.cc:512] unable to find OpenGL rendering system. OGRE is probably installed incorrectly. Double check the OGRE cmake output, and make sure OpenGL is enabled.

@traversaro traversaro added the bug Something isn't working label Oct 3, 2024
@traversaro
Copy link
Contributor Author

I give a quick shot to fix this, but using the engine name in engine/unregisterEngine does not work, and I could not find any way to quickly associate the ogre2 string to the corresponding registered engine index.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Inbox
Development

No branches or pull requests

1 participant