File tree Expand file tree Collapse file tree 2 files changed +20
-22
lines changed Expand file tree Collapse file tree 2 files changed +20
-22
lines changed Original file line number Diff line number Diff line change @@ -15,22 +15,17 @@ jobs:
15
15
runs-on : ${{ matrix.os }}
16
16
strategy :
17
17
matrix :
18
- os : [ubuntu-20 .04]
18
+ os : [ubuntu-22 .04]
19
19
20
20
steps :
21
21
- uses : actions/checkout@v2
22
22
23
23
- name : Install Conan
24
24
id : conan
25
25
uses : turtlebrowser/get-conan@main
26
- with :
27
- version : 1.59.0
28
26
29
27
- name : Create default profile
30
- run : conan profile new default --detect
31
-
32
- - name : Update profile
33
- run : conan profile update settings.compiler.libcxx=libstdc++11 default
28
+ run : conan profile detect
34
29
35
30
- name : Create Build Environment
36
31
# Some projects don't allow in-source building, so create a separate build directory
@@ -44,16 +39,16 @@ jobs:
44
39
- name : Configure CMake
45
40
shell : bash
46
41
working-directory : ${{github.workspace}}/build
47
- run : cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_TOOLCHAIN_FILE=conan_toolchain.cmake
42
+ run : cmake ${{github.workspace}} -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_TOOLCHAIN_FILE=conan_toolchain.cmake
48
43
49
44
- name : Build
50
45
shell : bash
51
46
working-directory : ${{github.workspace}}/build
52
47
run : cmake --build . --config ${{env.BUILD_TYPE}}
53
48
54
49
- name : run test (Linux)
55
- working-directory : ${{github.workspace}}/build
56
- run : ./tests/behaviortree_cpp_test
50
+ working-directory : ${{github.workspace}}/build/tests
51
+ run : ctest
57
52
58
53
- name : Upload coverage reports to Codecov
59
54
uses : codecov/codecov-action@v3
Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ set(BT_TESTS
33
33
test_helper.hpp
34
34
)
35
35
36
- set (TEST_DEPENDECIES
36
+ set (TEST_DEPENDENCIES
37
37
${BTCPP_LIBRARY}
38
38
foonathan::lexy
39
39
bt_sample_nodes )
@@ -42,32 +42,35 @@ if(ament_cmake_FOUND)
42
42
43
43
find_package (ament_cmake_gtest REQUIRED )
44
44
45
- ament_add_gtest (${BTCPP_LIBRARY} _test ${BT_TESTS} )
46
- target_link_libraries (${BTCPP_LIBRARY} _test
45
+ ament_add_gtest (behaviortree_cpp_test ${BT_TESTS} )
46
+ target_link_libraries (behaviortree_cpp_test
47
47
${TEST_DEPENDECIES}
48
48
${ament_LIBRARIES} )
49
49
50
50
elseif (catkin_FOUND AND CATKIN_ENABLE_TESTING )
51
51
52
- catkin_add_gtest (${BTCPP_LIBRARY} _test ${BT_TESTS} )
53
- target_link_libraries (${BTCPP_LIBRARY} _test
52
+ catkin_add_gtest (behaviortree_cpp_test ${BT_TESTS} )
53
+ target_link_libraries (behaviortree_cpp_test
54
54
${TEST_DEPENDECIES}
55
55
Threads::Threads
56
56
${catkin_LIBRARIES} )
57
57
58
58
else ()
59
59
60
60
find_package (GTest REQUIRED )
61
+
61
62
enable_testing ()
62
63
63
- add_executable (${BTCPP_LIBRARY} _test ${BT_TESTS} )
64
+ add_executable (behaviortree_cpp_test ${BT_TESTS} )
64
65
65
- target_link_libraries (${PROJECT_NAME} _test
66
- ${TEST_DEPENDECIES}
67
- Threads::Threads
68
- GTest::gtest )
66
+ add_test (NAME btcpp_test COMMAND behaviortree_cpp_test )
67
+
68
+ target_link_libraries (behaviortree_cpp_test
69
+ ${TEST_DEPENDENCIES}
70
+ GTest::gtest
71
+ GTest::gtest_main )
69
72
70
73
endif ()
71
74
72
- target_include_directories (${BTCPP_LIBRARY} _test PRIVATE include ${PROJECT_SOURCE_DIR} /3rdparty )
73
- target_compile_definitions (${BTCPP_LIBRARY} _test PRIVATE BT_TEST_FOLDER= "${CMAKE_CURRENT_SOURCE_DIR} " )
75
+ target_include_directories (behaviortree_cpp_test PRIVATE include ${PROJECT_SOURCE_DIR} /3rdparty )
76
+ target_compile_definitions (behaviortree_cpp_test PRIVATE BT_TEST_FOLDER= "${CMAKE_CURRENT_SOURCE_DIR} " )
You can’t perform that action at this time.
0 commit comments