File tree Expand file tree Collapse file tree 2 files changed +36
-2
lines changed Expand file tree Collapse file tree 2 files changed +36
-2
lines changed Original file line number Diff line number Diff line change 11
11
compiler :
12
12
- gcc
13
13
14
+
15
+ addons :
16
+ apt :
17
+ sources :
18
+ - ubuntu-toolchain-r-test
19
+ packages :
20
+ - lcov
21
+
14
22
matrix :
15
23
include :
16
24
- bare_linux :
@@ -42,7 +50,27 @@ before_script:
42
50
- mkdir -p build
43
51
44
52
script :
45
- - if [ "$ROS_DISTRO" = "none" ]; then (cd build; cmake .. ; sudo cmake --build . --target install; ./bin/behaviortree_cpp_test); fi
53
+ - if [ "$ROS_DISTRO" = "none" ]; then (cd build; cmake .. ; sudo cmake -DCMAKE_BUILD_TYPE=Debug -DADD_COVERAGE=ON - -build . --target install; ./bin/behaviortree_cpp_test); fi
46
54
- if [ "$ROS_DISTRO" != "none" ]; then (.ci_config/travis.sh); fi
47
55
48
56
57
+
58
+ after_success :
59
+ # Creating report
60
+ - cd ${TRAVIS_BUILD_DIR}
61
+ - lcov --directory . --capture --output-file coverage.info # capture coverage info
62
+ - lcov --remove coverage.info '/usr/*' --output-file coverage.info # filter out system
63
+ - lcov --list coverage.info # debug info
64
+ # Uploading report to CodeCov
65
+ - bash <(curl -s https://codecov.io/bash) || echo "Codecov did not collect coverage reports"
66
+
67
+ env :
68
+ global :
69
+ - LANG="en_US.UTF-8"
70
+
71
+ notifications :
72
+ email :
73
+ recipients :
74
+
75
+ on_success : change
76
+ on_failure : always
Original file line number Diff line number Diff line change @@ -10,12 +10,18 @@ endif()
10
10
11
11
set (CMAKE_POSITION_INDEPENDENT_CODE ON )
12
12
13
-
14
13
set (CMAKE_CONFIG_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_LIST_DIR} /cmake" )
15
14
list (APPEND CMAKE_MODULE_PATH "${CMAKE_CONFIG_PATH} " )
16
15
17
16
option (BUILD_EXAMPLES "Build tutorials and examples" ON )
18
17
option (BUILD_UNIT_TESTS "Build the unit tests" ON )
18
+ option (ADD_COVERAGE "Include code coverage" OFF )
19
+
20
+ if (CMAKE_COMPILER_IS_GNUCXX )
21
+ include (CodeCoverage )
22
+ setup_target_for_coverage (${PROJECT_NAME} _coverage tests coverage )
23
+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -O0 -fprofile-arcs -ftest-coverage" )
24
+ endif ()
19
25
20
26
#############################################################
21
27
# Find packages
You can’t perform that action at this time.
0 commit comments