Skip to content

Commit a9dca68

Browse files
committed
Add cmake option to enable Coal cast collision manager tests (disabled by default)
1 parent 315d28e commit a9dca68

8 files changed

Lines changed: 30 additions & 1 deletion

.github/workflows/clang_format.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,5 @@ jobs:
2727
./.run-clang-format
2828
if [ $? -ge 1 ]; then return 1; fi
2929
output=$(git diff)
30-
echo $output
30+
echo "$output"
3131
if [ -n "$output" ]; then exit 1; else exit 0; fi

tesseract_collision/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,9 @@ if(TESSERACT_BUILD_COAL)
6161
add_subdirectory(coal)
6262
endif()
6363

64+
# Unit test options
65+
option(TESSERACT_COLLISION_COAL_ENABLE_COAL_CAST_TESTS "Enable CoalCastBVHManager unit tests" OFF)
66+
6467
# Add compiler definition to core so it can find all plugins produced string( REPLACE ";" ":"
6568
# CONTACT_MANAGERS_PLUGINS_STRING
6669
# "${CONTACT_MANAGERS_PLUGINS}")

tesseract_collision/test/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ macro(add_gtest test_name test_file)
3535
${LIBFCL_LIBRARIES})
3636
target_compile_options(${test_name} PRIVATE ${TESSERACT_COMPILE_OPTIONS_PRIVATE} ${TESSERACT_COMPILE_OPTIONS_PUBLIC})
3737
target_compile_definitions(${test_name} PRIVATE ${TESSERACT_COMPILE_DEFINITIONS})
38+
if(TESSERACT_COLLISION_COAL_ENABLE_COAL_CAST_TESTS)
39+
target_compile_definitions(${test_name} PRIVATE TESSERACT_COLLISION_COAL_ENABLE_COAL_CAST_TESTS)
40+
endif()
3841
target_cxx_version(${test_name} PRIVATE VERSION ${TESSERACT_CXX_VERSION})
3942
target_clang_tidy(${test_name} ENABLE ${TESSERACT_ENABLE_CLANG_TIDY})
4043
target_code_coverage(

tesseract_collision/test/collision_box_box_cast_unit.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,13 @@ TEST(TesseractCollisionUnit, BulletCastBVHCollisionBoxBoxUnit) // NOLINT
2222
test_suite::runTest(checker);
2323
}
2424

25+
#if defined(TESSERACT_COLLISION_COAL_ENABLE_COAL_CAST_TESTS)
2526
TEST(TesseractCollisionUnit, CoalCastBVHCollisionBoxBoxUnit) // NOLINT
2627
{
2728
tesseract_collision_coal::CoalCastBVHManager checker;
2829
test_suite::runTest(checker);
2930
}
31+
#endif
3032

3133
int main(int argc, char** argv)
3234
{

tesseract_collision/test/collision_compound_compound_unit.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,13 @@ TEST(TesseractCollisionUnit, BulletContinuousBVHCollisionCompoundCompoundUnit)
5050
test_suite::runTest(checker);
5151
}
5252

53+
#if defined(TESSERACT_COLLISION_COAL_ENABLE_COAL_CAST_TESTS)
5354
TEST(TesseractCollisionUnit, CoalContinuousBVHCollisionCompoundCompoundUnit) // NOLINT
5455
{
5556
tesseract_collision_coal::CoalCastBVHManager checker;
5657
test_suite::runTest(checker);
5758
}
59+
#endif
5860

5961
int main(int argc, char** argv)
6062
{

tesseract_collision/test/collision_sphere_sphere_cast_unit.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ TEST(TesseractCollisionUnit, BulletContinuousBVHCollisionSphereSphereConvexHullU
3434
test_suite::runTest(checker, true);
3535
}
3636

37+
#if defined(TESSERACT_COLLISION_COAL_ENABLE_COAL_CAST_TESTS)
3738
TEST(TesseractCollisionUnit, CoalContinuousBVHCollisionSphereSphereUnit) // NOLINT
3839
{
3940
tesseract_collision_coal::CoalCastBVHManager checker;
@@ -45,6 +46,7 @@ TEST(TesseractCollisionUnit, CoalContinuousBVHCollisionSphereSphereConvexHullUni
4546
tesseract_collision_coal::CoalCastBVHManager checker;
4647
test_suite::runTest(checker, true);
4748
}
49+
#endif
4850

4951
int main(int argc, char** argv)
5052
{

tesseract_collision/test/contact_managers_config_unit.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,11 +110,13 @@ TEST(TesseractCollisionUnit, CoalDiscreteBVHContactManagerConfigUnit) // NOLINT
110110
test_suite::runTest(checker);
111111
}
112112

113+
#if defined(TESSERACT_COLLISION_COAL_ENABLE_COAL_CAST_TESTS)
113114
TEST(TesseractCollisionUnit, CoalCastBVHContactManagerConfigUnit) // NOLINT
114115
{
115116
tesseract_collision_coal::CoalCastBVHManager checker;
116117
test_suite::runTest(checker);
117118
}
119+
#endif
118120

119121
TEST(TesseractCollisionUnit, CombineContactAllowedFnUnit) // NOLINT
120122
{

tesseract_collision/test/contact_managers_factory_unit.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,11 @@ void runContactManagersFactoryTest(const std::filesystem::path& config_path)
8282
{
8383
auto name = cm_it->first.as<std::string>();
8484

85+
#if !defined(TESSERACT_COLLISION_COAL_ENABLE_COAL_CAST_TESTS)
86+
if (name == "CoalCastBVHManager")
87+
continue;
88+
#endif
89+
8590
ContinuousContactManager::UPtr cm = factory.createContinuousContactManager(name);
8691
EXPECT_TRUE(cm != nullptr);
8792
}
@@ -203,6 +208,11 @@ TEST(TesseractContactManagersFactoryUnit, LoadStringPluginTest) // NOLINT
203208
{
204209
auto name = cm_it->first.as<std::string>();
205210

211+
#if !defined(TESSERACT_COLLISION_COAL_ENABLE_COAL_CAST_TESTS)
212+
if (name == "CoalCastBVHManager")
213+
continue;
214+
#endif
215+
206216
ContinuousContactManager::UPtr cm = factory.createContinuousContactManager(name);
207217
EXPECT_TRUE(cm != nullptr);
208218
}
@@ -421,6 +431,11 @@ TEST(TesseractContactManagersFactoryUnit, LoadOnlyContinuousPluginTest) // NOLI
421431
{
422432
auto name = cm_it->first.as<std::string>();
423433

434+
#if !defined(TESSERACT_COLLISION_COAL_ENABLE_COAL_CAST_TESTS)
435+
if (name == "CoalCastBVHManager")
436+
continue;
437+
#endif
438+
424439
ContinuousContactManager::UPtr cm = factory.createContinuousContactManager(name);
425440
EXPECT_TRUE(cm != nullptr);
426441
}

0 commit comments

Comments
 (0)