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)
111
111
set (BUILD_TOOL_INCLUDE_DIRS ${catkin_INCLUDE_DIRS} )
112
112
113
113
elseif (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 )
115
122
endif ()
116
123
117
124
Original file line number Diff line number Diff line change 1
1
![ 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 )
4
4
[ ![ ros1] ( https://github.com/BehaviorTree/BehaviorTree.CPP/workflows/ros1/badge.svg?branch=master )] ( https://github.com/BehaviorTree/BehaviorTree.CPP/actions?query=workflow%3Aros1 )
5
5
[ ![ ros2] ( https://github.com/BehaviorTree/BehaviorTree.CPP/workflows/ros2/badge.svg?branch=master )] ( https://github.com/BehaviorTree/BehaviorTree.CPP/actions?query=workflow%3Aros2 )
6
6
[ ![ 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
20
20
gtest_switch.cpp
21
21
)
22
22
23
- if ( BT_COROUTINES )
24
- list ( APPEND BT_TESTS gtest_coroutines.cpp )
23
+ if ( BT_COROUTINES )
24
+ LIST ( APPEND BT_TESTS gtest_coroutines.cpp )
25
25
endif ()
26
26
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
+
27
33
if (ament_cmake_FOUND AND BUILD_TESTING )
28
34
29
35
find_package (ament_cmake_gtest REQUIRED )
@@ -43,15 +49,13 @@ elseif(catkin_FOUND AND CATKIN_ENABLE_TESTING)
43
49
${catkin_LIBRARIES} )
44
50
target_include_directories (${BEHAVIOR_TREE_LIBRARY} _test PRIVATE gtest/include )
45
51
46
- elseif (GTEST_FOUND AND BUILD_UNIT_TESTS )
52
+ elseif (BUILD_UNIT_TESTS )
47
53
48
54
enable_testing ()
49
55
50
56
add_executable (${BEHAVIOR_TREE_LIBRARY} _test ${BT_TESTS} )
51
57
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 )
55
59
target_include_directories (${BEHAVIOR_TREE_LIBRARY} _test PRIVATE gtest/include ${GTEST_INCLUDE_DIRS} )
56
60
57
61
add_test (BehaviorTreeCoreTest ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} /${BEHAVIOR_TREE_LIBRARY}_test )
You can’t perform that action at this time.
0 commit comments