File tree 5 files changed +29
-1
lines changed
5 files changed +29
-1
lines changed Original file line number Diff line number Diff line change 4
4
pull_request :
5
5
branches : [ main ]
6
6
workflow_dispatch :
7
+ push :
8
+ branches :
9
+ - main
7
10
8
11
jobs :
9
12
build :
17
20
sudo apt-get install --no-install-recommends \
18
21
cmake \
19
22
g++ \
23
+ gcovr \
20
24
git \
21
25
libboost-date-time-dev \
22
26
libboost-filesystem-dev \
52
56
export DISPLAY=:99
53
57
./run-all.sh
54
58
59
+ - name : code coverage summary report
60
+
61
+ with :
62
+ filename : coverage/cobertura.xml
63
+ indicators : false
64
+ hide_complexity : true
65
+ format : markdown
66
+ output : file
67
+
68
+ - name : publish code coverage summary
69
+ run : |
70
+ echo '# Code Coverage Report' >> $GITHUB_STEP_SUMMARY
71
+ cat code-coverage-results.md >> $GITHUB_STEP_SUMMARY
72
+
Original file line number Diff line number Diff line change 7
7
8
8
# Build artifacts
9
9
/build /
10
+ /coverage /
11
+ /.local /
10
12
11
13
# vim swap files
12
14
* .swp
Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ option(CUKE_ENABLE_GTEST "Enable Google Test framework" ON)
22
22
option (CUKE_ENABLE_QT "Enable Qt framework" ON )
23
23
option (CUKE_TESTS_E2E "Enable end-to-end tests" ON )
24
24
option (CUKE_TESTS_UNIT "Enable unit tests" ON )
25
+ option (CUKE_CODE_COVERAGE "Enable instrumentation for code coverage" OFF )
25
26
set (CUKE_ENABLE_SANITIZER "OFF" CACHE STRING "Sanitizer to use for checking" )
26
27
set_property (CACHE CUKE_ENABLE_SANITIZER PROPERTY STRINGS OFF "address" "thread" "undefined" )
27
28
option (CUKE_TESTS_VALGRIND "Enable tests within Valgrind" OFF )
@@ -36,6 +37,10 @@ elseif(CMAKE_CXX_STANDARD LESS 14)
36
37
message (FATAL_ERROR "C++14 (above) is required" )
37
38
endif ()
38
39
40
+ if (CUKE_CODE_COVERAGE)
41
+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --coverage" )
42
+ endif ()
43
+
39
44
set (CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR} /cmake/modules)
40
45
41
46
#
Original file line number Diff line number Diff line change 2
2
3
3
[ ![ Join the chat at https://gitter.im/cucumber/cucumber-cpp ] ( https://badges.gitter.im/cucumber/cucumber-cpp.svg )] ( https://gitter.im/cucumber/cucumber-cpp?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge )
4
4
[ ![ Windows build status] ( https://ci.appveyor.com/api/projects/status/5jeap3a4si9w8kka?svg=true )] ( https://ci.appveyor.com/project/paoloambrosio/cucumber-cpp-qqrt7 )
5
- [ ![ Coverage Status] ( https://coveralls.io/repos/github/cucumber/cucumber-cpp/badge.svg )] ( https://coveralls.io/github/cucumber/cucumber-cpp )
6
5
7
6
Cucumber-Cpp allows Cucumber to support step definitions written in C++.
8
7
Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ cmake -E make_directory build
22
22
cmake -E chdir build cmake \
23
23
-G Ninja \
24
24
-DCUKE_ENABLE_EXAMPLES=on \
25
+ -DCUKE_CODE_COVERAGE=on \
25
26
-DBUILD_SHARED_LIBS=" ${BUILD_SHARED_LIBS:- OFF} " \
26
27
-DCMAKE_INSTALL_PREFIX=${HOME} /.local \
27
28
${CMAKE_PREFIX_PATH: +" -DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH} " } \
@@ -83,4 +84,7 @@ echo "unix: ${SOCK}" > examples/FeatureShowcase/features/step_definitions/cucumb
83
84
(cd examples/FeatureShowcase; cucumber)
84
85
wait %
85
86
87
+ mkdir -p coverage
88
+ gcovr build/ --html-details --output coverage/index.html --xml coverage/cobertura.xml
89
+
86
90
cmake --build build --target install
You can’t perform that action at this time.
0 commit comments