From 46cde994ee65192ec7ea2ef56fed577d83e5a69c Mon Sep 17 00:00:00 2001 From: Jose Luis Rivero Date: Wed, 4 Dec 2024 19:21:00 +0100 Subject: [PATCH] Fix test_config.h to include real engines found (gz-rendering6) (#1089) * Fix test_config.h to include real engines found Instead of hardcoding them by architecture, create the right list of engines from the support found by CMake. Signed-off-by: Jose Luis Rivero * Ogre and Ogre2 are not compatible. Prefer to have Ogre2. Signed-off-by: Jose Luis Rivero * Remove optix from Mac Signed-off-by: Jose Luis Rivero --------- Signed-off-by: Jose Luis Rivero Signed-off-by: Jose Luis Rivero --- test/test_config.h.in | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/test/test_config.h.in b/test/test_config.h.in index 8297d3206..c24fa7bea 100644 --- a/test/test_config.h.in +++ b/test/test_config.h.in @@ -9,16 +9,35 @@ #define RENDER_ENGINE_VALUES ::testing::ValuesIn(\ gz::rendering::TestValues()) +#include +#include +#include + /// \todo(anyone) re-enable ogre2 test once ogre 2.2 works on macOS #ifdef __APPLE__ -static const std::vector kRenderEngineTestValues{"ogre", "optix"}; +static const std::vector kRenderEngineTestValues{"ogre"}; #else -static const std::vector kRenderEngineTestValues{"ogre2", "optix"}; + /// We can not mix ogre and ogre2 tests in Fortress for a single test file + /// prefer here ogre2 over ogre. + #if defined(HAVE_OGRE) && defined(HAVE_OPTIX) && defined(HAVE_OGRE2) + static const std::vector kRenderEngineTestValues{"ogre2", "optix"}; + #elif defined(HAVE_OGRE) && defined(HAVE_OPTIX) + static const std::vector kRenderEngineTestValues{"ogre", "optix"}; + #elif defined(HAVE_OGRE) && defined(HAVE_OGRE2) + static const std::vector kRenderEngineTestValues{"ogre2"}; + #elif defined(HAVE_OGRE2) && defined(HAVE_OPTIX) + static const std::vector kRenderEngineTestValues{"ogre2", "optix"}; + #elif defined(HAVE_OGRE) + static const std::vector kRenderEngineTestValues{"ogre"}; + #elif defined(HAVE_OGRE2) + static const std::vector kRenderEngineTestValues{"ogre2"}; + #elif defined(HAVE_OPTIX) + static const std::vector kRenderEngineTestValues{"optix"}; + #else + #warning "Can not detect a rendering engine support: ogre | ogre2 | optix" + #endif #endif -#include -#include - namespace ignition { namespace rendering