File tree Expand file tree Collapse file tree 5 files changed +20
-77
lines changed Expand file tree Collapse file tree 5 files changed +20
-77
lines changed Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -111,7 +111,14 @@ elseif( CATKIN_DEVEL_PREFIX OR CATKIN_BUILD_BINARY_PACKAGE)
111111 set (BUILD_TOOL_INCLUDE_DIRS ${catkin_INCLUDE_DIRS} )
112112
113113elseif (BUILD_UNIT_TESTS)
114- find_package (GTest REQUIRED)
114+ include (FetchContent)
115+ FetchContent_Declare(
116+ googletest
117+ URL https://github.com/google/googletest/archive/609281088cfefc76f9d0ce82e1ff6c30cc3591e5.zip
118+ )
119+ # For Windows: Prevent overriding the parent project's compiler/linker settings
120+ set (gtest_force_shared_crt ON CACHE BOOL "" FORCE)
121+ FetchContent_MakeAvailable(googletest)
115122endif ()
116123
117124
Original file line number Diff line number Diff line change 11![ License MIT] ( https://img.shields.io/github/license/BehaviorTree/BehaviorTree.CPP?color=blue )
2- ![ Version] ( https://img.shields.io/badge/version-3.5 -blue.svg )
3- [ ![ Build Status ] ( https://travis-ci.org /BehaviorTree/BehaviorTree.CPP. svg?branch=master )] ( https://travis-ci.org /BehaviorTree/BehaviorTree.CPP )
2+ ![ Version] ( https://img.shields.io/badge/version-3.6 -blue.svg )
3+ [ ![ CMake Build ] ( https://github.com /BehaviorTree/BehaviorTree.CPP/actions/workflows/build_vanilla.yml/badge. svg )] ( https://github.com /BehaviorTree/BehaviorTree.CPP/actions/workflows/build_vanilla.yml )
44[ ![ ros1] ( https://github.com/BehaviorTree/BehaviorTree.CPP/workflows/ros1/badge.svg?branch=master )] ( https://github.com/BehaviorTree/BehaviorTree.CPP/actions?query=workflow%3Aros1 )
55[ ![ ros2] ( https://github.com/BehaviorTree/BehaviorTree.CPP/workflows/ros2/badge.svg?branch=master )] ( https://github.com/BehaviorTree/BehaviorTree.CPP/actions?query=workflow%3Aros2 )
66[ ![ LGTM Grade] ( https://img.shields.io/lgtm/grade/cpp/github/BehaviorTree/BehaviorTree.CPP )] ( https://lgtm.com/projects/g/BehaviorTree/BehaviorTree.CPP/context:cpp )
Original file line number Diff line number Diff line change @@ -20,10 +20,16 @@ set(BT_TESTS
2020 gtest_switch.cpp
2121)
2222
23- if ( BT_COROUTINES)
24- list ( APPEND BT_TESTS gtest_coroutines.cpp)
23+ if ( BT_COROUTINES )
24+ LIST ( APPEND BT_TESTS gtest_coroutines.cpp)
2525endif ()
2626
27+ #if(ament_cmake_FOUND OR catkin_FOUND)
28+ # # This test requires gmock. Since we don't have a uniform way to include
29+ # # gmock for non-users, it is turned of when build without ros.
30+ # list(APPEND BT_TESTS gtest_async_action_node.cpp)
31+ #endif()
32+
2733if (ament_cmake_FOUND AND BUILD_TESTING)
2834
2935 find_package (ament_cmake_gtest REQUIRED)
@@ -43,15 +49,13 @@ elseif(catkin_FOUND AND CATKIN_ENABLE_TESTING)
4349 ${catkin_LIBRARIES} )
4450 target_include_directories (${BEHAVIOR_TREE_LIBRARY} _test PRIVATE gtest/include )
4551
46- elseif (GTEST_FOUND AND BUILD_UNIT_TESTS)
52+ elseif (BUILD_UNIT_TESTS)
4753
4854 enable_testing ()
4955
5056 add_executable (${BEHAVIOR_TREE_LIBRARY} _test ${BT_TESTS} )
5157 target_link_libraries (${PROJECT_NAME} _test ${BEHAVIOR_TREE_LIBRARY}
52- bt_sample_nodes
53- ${GTEST_LIBRARIES}
54- ${GTEST_MAIN_LIBRARIES} )
58+ bt_sample_nodes gtest gtest_main)
5559 target_include_directories (${BEHAVIOR_TREE_LIBRARY} _test PRIVATE gtest/include ${GTEST_INCLUDE_DIRS} )
5660
5761 add_test (BehaviorTreeCoreTest ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} /${BEHAVIOR_TREE_LIBRARY} _test)
You can’t perform that action at this time.
0 commit comments