Skip to content

Commit 2bef774

Browse files
authored
Remove Boost Test and replace with Google Test (#146)
* Update test_fcl_sphere_capsule.cpp to use gtest * Update more tests to use gtest * Update rest of tests to use gtest * Add missing copyright to test_fcl_simple.cpp * Drop dependency on Boost Test * Update changelog * Remove Boost.Date_Time * Revert the default value of FCL_BUILD_TESTS option * Bump version to 0.6.0 * Add back boost settings for filesystem and system * Use GTEST_TEST rather than TEST to avoid potential name conflicts
1 parent 22f375f commit 2bef774

18 files changed

+1874
-1797
lines changed

CHANGELOG.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
## FCL 0
22

3-
### FCL 0.5.0 (2016-XX-XX)
3+
### FCL 0.6.0 (2016-XX-XX)
4+
5+
* Removed Boost Test and replaced with Google Test: [#146](https://github.com/flexible-collision-library/fcl/pull/146), [#140](https://github.com/flexible-collision-library/fcl/pull/140)
6+
7+
### FCL 0.5.0 (2016-07-19)
48

59
* Added safe-guards to allow octree headers only if octomap enabled: [#136](https://github.com/flexible-collision-library/fcl/pull/136)
610
* Added CMake option to disable octomap in build: [#135](https://github.com/flexible-collision-library/fcl/pull/135)

CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ configure_file(
164164
add_custom_target(uninstall
165165
"${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/CMakeModules/cmake_uninstall.cmake")
166166

167-
find_package(Boost COMPONENTS date_time filesystem system unit_test_framework)
167+
find_package(Boost COMPONENTS filesystem system)
168168
option(FCL_BUILD_TESTS "Build FCL tests" ${Boost_FOUND})
169169
if(FCL_BUILD_TESTS)
170170
enable_testing()

CMakeModules/FCLVersion.cmake

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# set the version in a way CMake can use
22
set(FCL_MAJOR_VERSION 0)
3-
set(FCL_MINOR_VERSION 5)
3+
set(FCL_MINOR_VERSION 6)
44
set(FCL_PATCH_VERSION 0)
55
set(FCL_VERSION "${FCL_MAJOR_VERSION}.${FCL_MINOR_VERSION}.${FCL_PATCH_VERSION}")
66

test/CMakeLists.txt

+35-59
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,16 @@ if(NOT WIN32)
1818
target_link_libraries(gtest pthread)
1919
endif()
2020

21+
add_definitions(-DGTEST_DONT_DEFINE_TEST=1)
22+
add_definitions(-DGTEST_DONT_DEFINE_FAIL=1)
23+
add_definitions(-DGTEST_DONT_DEFINE_SUCCEED=1)
24+
add_definitions(-DGTEST_DONT_DEFINE_ASSERT_EQ=1)
25+
add_definitions(-DGTEST_DONT_DEFINE_ASSERT_NE=1)
26+
add_definitions(-DGTEST_DONT_DEFINE_ASSERT_LE=1)
27+
add_definitions(-DGTEST_DONT_DEFINE_ASSERT_LT=1)
28+
add_definitions(-DGTEST_DONT_DEFINE_ASSERT_GE=1)
29+
add_definitions(-DGTEST_DONT_DEFINE_ASSERT_GT=1)
30+
2131
execute_process(COMMAND cmake -E remove_directory ${CMAKE_BINARY_DIR}/test_results)
2232
execute_process(COMMAND cmake -E make_directory ${CMAKE_BINARY_DIR}/test_results)
2333
include_directories(${GTEST_INCLUDE_DIRS})
@@ -26,10 +36,26 @@ add_library(test_fcl_utility test_fcl_utility.cpp)
2636

2737
# test file list
2838
set(tests
39+
test_fcl_broadphase.cpp
40+
test_fcl_bvh_models.cpp
41+
test_fcl_capsule_box_1.cpp
42+
test_fcl_capsule_box_2.cpp
43+
test_fcl_capsule_capsule.cpp
44+
test_fcl_collision.cpp
2945
test_fcl_distance.cpp
46+
test_fcl_frontlist.cpp
47+
test_fcl_geometric_shapes.cpp
48+
test_fcl_math.cpp
49+
test_fcl_shape_mesh_consistency.cpp
50+
test_fcl_simple.cpp
51+
test_fcl_sphere_capsule.cpp
3052
)
3153

32-
macro(add_fcl_gtest test_file_name) # TODO: This should be renamed to add_fcl_test once we completely drop the dependency on Boost Test
54+
if (FCL_HAVE_OCTOMAP)
55+
list(APPEND tests test_fcl_octomap.cpp)
56+
endif()
57+
58+
macro(add_fcl_test test_file_name)
3359
# Get the name (i.e. bla.cpp => bla)
3460
get_filename_component(test_name ${ARGV} NAME_WE)
3561
add_executable(${test_name} ${ARGV})
@@ -41,35 +67,6 @@ macro(add_fcl_gtest test_file_name) # TODO: This should be renamed to add_fcl_te
4167
${Boost_SYSTEM_LIBRARY}
4268
)
4369
add_test(${test_name} ${EXECUTABLE_OUTPUT_PATH}/${test_name})
44-
endmacro(add_fcl_gtest)
45-
46-
# Build all the tests
47-
foreach(test ${tests})
48-
add_fcl_gtest(${test})
49-
endforeach(test)
50-
51-
#===============================================================================
52-
# Boost.Test settings
53-
#===============================================================================
54-
55-
include_directories(${Boost_INCLUDE_DIR})
56-
57-
if(MSVC)
58-
add_definitions(-DBOOST_ALL_NO_LIB)
59-
endif()
60-
add_definitions(-DBOOST_TEST_DYN_LINK)
61-
62-
63-
macro(add_fcl_test test_name)
64-
add_executable(${ARGV})
65-
target_link_libraries(${test_name}
66-
fcl
67-
${Boost_FILESYSTEM_LIBRARY}
68-
${Boost_SYSTEM_LIBRARY}
69-
${Boost_THREAD_LIBRARY}
70-
${Boost_DATE_TIME_LIBRARY}
71-
${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
72-
add_test(${test_name} ${EXECUTABLE_OUTPUT_PATH}/${test_name})
7370
endmacro(add_fcl_test)
7471

7572
# configure location of resources
@@ -84,35 +81,14 @@ configure_file("${TEST_RESOURCES_SRC_DIR}/config.h.in" "${TEST_RESOURCES_BIN_DIR
8481

8582
include_directories(.)
8683
include_directories("${CMAKE_CURRENT_BINARY_DIR}")
84+
include_directories(${Boost_INCLUDE_DIR})
8785

88-
add_fcl_test(test_fcl_collision test_fcl_collision.cpp test_fcl_utility.cpp)
89-
#add_fcl_test(test_fcl_distance test_fcl_distance.cpp test_fcl_utility.cpp)
90-
add_fcl_test(test_fcl_geometric_shapes test_fcl_geometric_shapes.cpp test_fcl_utility.cpp)
91-
add_fcl_test(test_fcl_broadphase test_fcl_broadphase.cpp test_fcl_utility.cpp)
92-
add_fcl_test(test_fcl_shape_mesh_consistency test_fcl_shape_mesh_consistency.cpp test_fcl_utility.cpp)
93-
add_fcl_test(test_fcl_frontlist test_fcl_frontlist.cpp test_fcl_utility.cpp)
94-
add_fcl_test(test_fcl_math test_fcl_math.cpp test_fcl_utility.cpp)
95-
96-
add_fcl_test(test_fcl_sphere_capsule test_fcl_sphere_capsule.cpp)
97-
add_fcl_test(test_fcl_capsule_capsule test_fcl_capsule_capsule.cpp)
98-
add_fcl_test(test_fcl_simple test_fcl_simple.cpp)
99-
add_fcl_test(test_fcl_capsule_box_1 test_fcl_capsule_box_1.cpp)
100-
add_fcl_test(test_fcl_capsule_box_2 test_fcl_capsule_box_2.cpp)
101-
#add_fcl_test(test_fcl_global_penetration test_fcl_global_penetration.cpp libsvm/svm.cpp test_fcl_utility.cpp)
102-
add_fcl_test(test_fcl_bvh_models test_fcl_bvh_models.cpp test_fcl_utility.cpp)
103-
104-
if (FCL_HAVE_OCTOMAP)
105-
add_fcl_test(test_fcl_octomap test_fcl_octomap.cpp test_fcl_utility.cpp)
86+
if(MSVC)
87+
add_definitions(-DBOOST_ALL_NO_LIB)
10688
endif()
89+
add_definitions(-DBOOST_TEST_DYN_LINK)
10790

108-
#if (FCL_HAVE_TINYXML)
109-
# add_executable(test_fcl_xmldata test_fcl_xmldata.cpp test_fcl_utility.cpp libsvm/svm.cpp)
110-
# target_link_libraries(test_fcl_xmldata
111-
# fcl
112-
# ${TINYXML_LIBRARY_DIRS}
113-
# ${Boost_SYSTEM_LIBRARY}
114-
# ${Boost_THREAD_LIBRARY}
115-
# ${Boost_DATE_TIME_LIBRARY}
116-
# ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
117-
# add_test(test_fcl_xmldata ${EXECUTABLE_OUTPUT_PATH}/test_fcl_xmldata)
118-
#endif()
91+
# Build all the tests
92+
foreach(test ${tests})
93+
add_fcl_test(${test})
94+
endforeach(test)

0 commit comments

Comments
 (0)