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

Remove Boost Test and replace with Google Test #146

Merged
merged 11 commits into from
Jul 23, 2016
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
## FCL 0

### FCL 0.5.0 (2016-XX-XX)
### FCL 0.6.0 (2016-XX-XX)

* 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)

### FCL 0.5.0 (2016-07-19)

* Added safe-guards to allow octree headers only if octomap enabled: [#136](https://github.com/flexible-collision-library/fcl/pull/136)
* Added CMake option to disable octomap in build: [#135](https://github.com/flexible-collision-library/fcl/pull/135)
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ configure_file(
add_custom_target(uninstall
"${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/CMakeModules/cmake_uninstall.cmake")

find_package(Boost COMPONENTS date_time filesystem system unit_test_framework)
find_package(Boost COMPONENTS filesystem system)
option(FCL_BUILD_TESTS "Build FCL tests" ${Boost_FOUND})
if(FCL_BUILD_TESTS)
enable_testing()
Expand Down
2 changes: 1 addition & 1 deletion CMakeModules/FCLVersion.cmake
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# set the version in a way CMake can use
set(FCL_MAJOR_VERSION 0)
set(FCL_MINOR_VERSION 5)
set(FCL_MINOR_VERSION 6)
set(FCL_PATCH_VERSION 0)
set(FCL_VERSION "${FCL_MAJOR_VERSION}.${FCL_MINOR_VERSION}.${FCL_PATCH_VERSION}")

Expand Down
94 changes: 35 additions & 59 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,16 @@ if(NOT WIN32)
target_link_libraries(gtest pthread)
endif()

add_definitions(-DGTEST_DONT_DEFINE_TEST=1)
add_definitions(-DGTEST_DONT_DEFINE_FAIL=1)
add_definitions(-DGTEST_DONT_DEFINE_SUCCEED=1)
add_definitions(-DGTEST_DONT_DEFINE_ASSERT_EQ=1)
add_definitions(-DGTEST_DONT_DEFINE_ASSERT_NE=1)
add_definitions(-DGTEST_DONT_DEFINE_ASSERT_LE=1)
add_definitions(-DGTEST_DONT_DEFINE_ASSERT_LT=1)
add_definitions(-DGTEST_DONT_DEFINE_ASSERT_GE=1)
add_definitions(-DGTEST_DONT_DEFINE_ASSERT_GT=1)

execute_process(COMMAND cmake -E remove_directory ${CMAKE_BINARY_DIR}/test_results)
execute_process(COMMAND cmake -E make_directory ${CMAKE_BINARY_DIR}/test_results)
include_directories(${GTEST_INCLUDE_DIRS})
Expand All @@ -26,10 +36,26 @@ add_library(test_fcl_utility test_fcl_utility.cpp)

# test file list
set(tests
test_fcl_broadphase.cpp
test_fcl_bvh_models.cpp
test_fcl_capsule_box_1.cpp
test_fcl_capsule_box_2.cpp
test_fcl_capsule_capsule.cpp
test_fcl_collision.cpp
test_fcl_distance.cpp
test_fcl_frontlist.cpp
test_fcl_geometric_shapes.cpp
test_fcl_math.cpp
test_fcl_shape_mesh_consistency.cpp
test_fcl_simple.cpp
test_fcl_sphere_capsule.cpp
)

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
if (FCL_HAVE_OCTOMAP)
list(APPEND tests test_fcl_octomap.cpp)
endif()

macro(add_fcl_test test_file_name)
# Get the name (i.e. bla.cpp => bla)
get_filename_component(test_name ${ARGV} NAME_WE)
add_executable(${test_name} ${ARGV})
Expand All @@ -41,35 +67,6 @@ macro(add_fcl_gtest test_file_name) # TODO: This should be renamed to add_fcl_te
${Boost_SYSTEM_LIBRARY}
)
add_test(${test_name} ${EXECUTABLE_OUTPUT_PATH}/${test_name})
endmacro(add_fcl_gtest)

# Build all the tests
foreach(test ${tests})
add_fcl_gtest(${test})
endforeach(test)

#===============================================================================
# Boost.Test settings
#===============================================================================

include_directories(${Boost_INCLUDE_DIR})

if(MSVC)
add_definitions(-DBOOST_ALL_NO_LIB)
endif()
add_definitions(-DBOOST_TEST_DYN_LINK)


macro(add_fcl_test test_name)
add_executable(${ARGV})
target_link_libraries(${test_name}
fcl
${Boost_FILESYSTEM_LIBRARY}
${Boost_SYSTEM_LIBRARY}
${Boost_THREAD_LIBRARY}
${Boost_DATE_TIME_LIBRARY}
${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
add_test(${test_name} ${EXECUTABLE_OUTPUT_PATH}/${test_name})
endmacro(add_fcl_test)

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

include_directories(.)
include_directories("${CMAKE_CURRENT_BINARY_DIR}")
include_directories(${Boost_INCLUDE_DIR})

add_fcl_test(test_fcl_collision test_fcl_collision.cpp test_fcl_utility.cpp)
#add_fcl_test(test_fcl_distance test_fcl_distance.cpp test_fcl_utility.cpp)
add_fcl_test(test_fcl_geometric_shapes test_fcl_geometric_shapes.cpp test_fcl_utility.cpp)
add_fcl_test(test_fcl_broadphase test_fcl_broadphase.cpp test_fcl_utility.cpp)
add_fcl_test(test_fcl_shape_mesh_consistency test_fcl_shape_mesh_consistency.cpp test_fcl_utility.cpp)
add_fcl_test(test_fcl_frontlist test_fcl_frontlist.cpp test_fcl_utility.cpp)
add_fcl_test(test_fcl_math test_fcl_math.cpp test_fcl_utility.cpp)

add_fcl_test(test_fcl_sphere_capsule test_fcl_sphere_capsule.cpp)
add_fcl_test(test_fcl_capsule_capsule test_fcl_capsule_capsule.cpp)
add_fcl_test(test_fcl_simple test_fcl_simple.cpp)
add_fcl_test(test_fcl_capsule_box_1 test_fcl_capsule_box_1.cpp)
add_fcl_test(test_fcl_capsule_box_2 test_fcl_capsule_box_2.cpp)
#add_fcl_test(test_fcl_global_penetration test_fcl_global_penetration.cpp libsvm/svm.cpp test_fcl_utility.cpp)
add_fcl_test(test_fcl_bvh_models test_fcl_bvh_models.cpp test_fcl_utility.cpp)

if (FCL_HAVE_OCTOMAP)
add_fcl_test(test_fcl_octomap test_fcl_octomap.cpp test_fcl_utility.cpp)
if(MSVC)
add_definitions(-DBOOST_ALL_NO_LIB)
endif()
add_definitions(-DBOOST_TEST_DYN_LINK)

#if (FCL_HAVE_TINYXML)
# add_executable(test_fcl_xmldata test_fcl_xmldata.cpp test_fcl_utility.cpp libsvm/svm.cpp)
# target_link_libraries(test_fcl_xmldata
# fcl
# ${TINYXML_LIBRARY_DIRS}
# ${Boost_SYSTEM_LIBRARY}
# ${Boost_THREAD_LIBRARY}
# ${Boost_DATE_TIME_LIBRARY}
# ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
# add_test(test_fcl_xmldata ${EXECUTABLE_OUTPUT_PATH}/test_fcl_xmldata)
#endif()
# Build all the tests
foreach(test ${tests})
add_fcl_test(${test})
endforeach(test)
Loading