From 899b97a0ce15efbbd93640669592a367c68a510c Mon Sep 17 00:00:00 2001 From: Steve Peters Date: Thu, 6 May 2021 11:51:05 -0700 Subject: [PATCH] Move Scene3d_TEST.cc to test/integration There seems to be a problem with loading the ignition-rendering-ogre plugin from the Scene3D test if it links to that plugin. Making Scene3D_TEST.cc into an integration test works because it doesn't directly call any plugin methods. This also changes the linking for the Grid3D plugin to only link to the ignition-rendering core library target instead of the IGNITION-RENDERING_LIBRARIES variable which includes the ogre component library plugins. Signed-off-by: Steve Peters --- src/plugins/grid_3d/CMakeLists.txt | 2 +- src/plugins/scene3d/CMakeLists.txt | 4 +--- test/integration/CMakeLists.txt | 7 ++++++- .../scene3d/Scene3D_TEST.cc => test/integration/scene3d.cc | 3 +-- 4 files changed, 9 insertions(+), 7 deletions(-) rename src/plugins/scene3d/Scene3D_TEST.cc => test/integration/scene3d.cc (98%) diff --git a/src/plugins/grid_3d/CMakeLists.txt b/src/plugins/grid_3d/CMakeLists.txt index 6ce5eb707..444b3f566 100644 --- a/src/plugins/grid_3d/CMakeLists.txt +++ b/src/plugins/grid_3d/CMakeLists.txt @@ -6,6 +6,6 @@ ign_gui_add_plugin(Grid3D TEST_SOURCES # Grid3D_TEST.cc PUBLIC_LINK_LIBS - ${IGNITION-RENDERING_LIBRARIES} + ignition-rendering${IGN_RENDERING_VER}::ignition-rendering${IGN_RENDERING_VER} ) diff --git a/src/plugins/scene3d/CMakeLists.txt b/src/plugins/scene3d/CMakeLists.txt index e16e8d536..5679bfcf7 100644 --- a/src/plugins/scene3d/CMakeLists.txt +++ b/src/plugins/scene3d/CMakeLists.txt @@ -3,9 +3,7 @@ ign_gui_add_plugin(Scene3D Scene3D.cc QT_HEADERS Scene3D.hh - TEST_SOURCES - Scene3D_TEST.cc PUBLIC_LINK_LIBS - ${IGNITION-RENDERING_LIBRARIES} + ignition-rendering${IGN_RENDERING_VER}::ignition-rendering${IGN_RENDERING_VER} ) diff --git a/test/integration/CMakeLists.txt b/test/integration/CMakeLists.txt index 397fabacb..38a25dc78 100644 --- a/test/integration/CMakeLists.txt +++ b/test/integration/CMakeLists.txt @@ -1,3 +1,8 @@ ign_get_sources(tests) -ign_build_tests(TYPE INTEGRATION SOURCES ${tests}) +ign_build_tests( + TYPE INTEGRATION + SOURCES ${tests} + LIB_DEPS + ignition-plugin${IGN_PLUGIN_VER}::loader + ignition-rendering${IGN_RENDERING_VER}::ignition-rendering${IGN_RENDERING_VER}) diff --git a/src/plugins/scene3d/Scene3D_TEST.cc b/test/integration/scene3d.cc similarity index 98% rename from src/plugins/scene3d/Scene3D_TEST.cc rename to test/integration/scene3d.cc index b461cc475..78fac6d10 100644 --- a/src/plugins/scene3d/Scene3D_TEST.cc +++ b/test/integration/scene3d.cc @@ -30,8 +30,6 @@ #include "ignition/gui/Plugin.hh" #include "ignition/gui/MainWindow.hh" -#include "Scene3D.hh" - int g_argc = 1; char **g_argv = new char *[g_argc]; @@ -97,6 +95,7 @@ TEST(Scene3DTest, IGN_UTILS_TEST_ENABLED_ONLY_ON_LINUX(Config)) auto engine = rendering::engine("ogre"); ASSERT_NE(nullptr, engine); + EXPECT_EQ(1u, engine->SceneCount()); auto scene = engine->SceneByName("banana"); ASSERT_NE(nullptr, scene);