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 test_config.h to include real engines found (gz-rendering6) #1089

Merged
merged 3 commits into from
Dec 4, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 21 additions & 4 deletions test/test_config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,33 @@
#define RENDER_ENGINE_VALUES ::testing::ValuesIn(\
gz::rendering::TestValues())

#include <vector>
#include <gz/common/Util.hh>
#include <gz/rendering/config.hh>

/// \todo(anyone) re-enable ogre2 test once ogre 2.2 works on macOS
#ifdef __APPLE__
static const std::vector<const char *> kRenderEngineTestValues{"ogre", "optix"};
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@iche033 does it make sense to have optix in Mac?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we never tested it on mac so I think can just remove optix here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#else
static const std::vector<const char *> kRenderEngineTestValues{"ogre2", "optix"};
#if defined(HAVE_OGRE) && defined(HAVE_OPTIX) && defined(HAVE_OGRE2)
static const std::vector<const char *> kRenderEngineTestValues{"ogre", "ogre2", "optix"};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I remember why we have the weird logic with hardcoded engine names. In fortress, we can't run ogre and ogre2 tests one after another due to conflicting symbols in the dynamic library. So if both ogre and ogre2 exists, we prefer running the test with ogre2. In this case it would be:

static const std::vector<const char *> kRenderEngineTestValues{"ogre2", "optix"};

Note that the tests fixture is revamped in #685 so Harmonic does not have this issue any more.

#elif defined(HAVE_OGRE) && defined(HAVE_OPTIX)
static const std::vector<const char *> kRenderEngineTestValues{"ogre", "optix"};
#elif defined(HAVE_OGRE) && defined(HAVE_OGRE2)
static const std::vector<const char *> kRenderEngineTestValues{"ogre", "ogre2"};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see above, we can't have ogre running with ogre2, so this would be:

static const std::vector<const char *> kRenderEngineTestValues{"ogre2"};

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#elif defined(HAVE_OGRE2) && defined(HAVE_OPTIX)
static const std::vector<const char *> kRenderEngineTestValues{"ogre2", "optix"};
#elif defined(HAVE_OGRE)
static const std::vector<const char *> kRenderEngineTestValues{"ogre"};
#elif defined(HAVE_OGRE2)
static const std::vector<const char *> kRenderEngineTestValues{"ogre2"};
#elif defined(HAVE_OPTIX)
static const std::vector<const char *> kRenderEngineTestValues{"optix"};
#else
#warning "Can not detect a rendering engine support: ogre | ogre2 | optix"
#endif
#endif

#include <vector>
#include <gz/common/Util.hh>

namespace ignition
{
namespace rendering
Expand Down
Loading