Skip to content

Commit

Permalink
backwards compatibility to older gtest
Browse files Browse the repository at this point in the history
  • Loading branch information
rhaschke authored and yurirocha15 committed Sep 1, 2021
1 parent d45a675 commit 40adcf5
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
10 changes: 10 additions & 0 deletions moveit_core/planning_scene/test/test_multi_threaded.cpp
Expand Up @@ -107,7 +107,13 @@ TEST_P(CollisionDetectorTests, Threaded)

collision_detection::CollisionPluginCache loader;
if (!loader.activate(plugin_name, planning_scene_, true))
{
#if defined(GTEST_SKIP_)
GTEST_SKIP_("Failed to load collision plugin");
#else
return;
#endif
}

for (unsigned int i = 0; i < THREADS; ++i)
{
Expand All @@ -132,6 +138,10 @@ TEST_P(CollisionDetectorTests, Threaded)
planning_scene_.reset();
}

#ifndef INSTANTIATE_TEST_SUITE_P // prior to gtest 1.10
#define INSTANTIATE_TEST_SUITE_P(...) INSTANTIATE_TEST_CASE_P(__VA_ARGS__)
#endif

// instantiate parameterized tests for common collision plugins
INSTANTIATE_TEST_SUITE_P(PluginTests, CollisionDetectorTests, testing::Values("FCL", "Bullet"));

Expand Down
11 changes: 11 additions & 0 deletions moveit_core/planning_scene/test/test_planning_scene.cpp
Expand Up @@ -236,7 +236,13 @@ TEST_P(CollisionDetectorTests, ClearDiff)

collision_detection::CollisionPluginCache loader;
if (!loader.activate(plugin_name, parent, true))
{
#if defined(GTEST_SKIP_)
GTEST_SKIP_("Failed to load collision plugin");
#else
return;
#endif
}

// create child scene
planning_scene::PlanningScenePtr child = parent->diff();
Expand Down Expand Up @@ -302,6 +308,11 @@ TEST_P(CollisionDetectorTests, ClearDiff)
child.reset();
parent.reset();
}

#ifndef INSTANTIATE_TEST_SUITE_P // prior to gtest 1.10
#define INSTANTIATE_TEST_SUITE_P(...) INSTANTIATE_TEST_CASE_P(__VA_ARGS__)
#endif

// instantiate parameterized tests for common collision plugins
INSTANTIATE_TEST_SUITE_P(PluginTests, CollisionDetectorTests, testing::Values("FCL", "Bullet"));

Expand Down

0 comments on commit 40adcf5

Please sign in to comment.