Skip to content

Commit

Permalink
Add coverage target for unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
0xg0nz0 committed Mar 10, 2024
1 parent 76e3675 commit 8ae91d4
Show file tree
Hide file tree
Showing 6 changed files with 770 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 5,8 @@ USER root
RUN apt-get update \
&& apt-get install autoconf autoconf-archive automake \
clang-format clang-tidy \
lcov doxygen graphviz -y --no-install-recommends \
build-essential gcovr lcov xdg-utils \
doxygen graphviz -y --no-install-recommends \
&& apt-get clean && rm -rf /var/lib/apt/lists/*

# Install CMake and vcpkg
Expand Down
3 changes: 3 additions & 0 deletions .lcovrc
Original file line number Diff line number Diff line change
@@ -0,0 1,3 @@
genhtml_branch_coverage = 1
lcov_branch_coverage = 1
lcov_excl_br_line = LCOV_EXCL_BR_LINE|CHECK|REQUIRE
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 3,7 @@ project(iggy-cpp-client)

option(BUILD_TESTS "Build and run unit tests" OFF)
option(BUILD_DOCS "Build documentation" OFF)
option(ENABLE_CODE_COVERAGE "Enable coverage reporting" OFF)

# avoid warning about DOWNLOAD_EXTRACT_TIMESTAMP in CMake 3.24
if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.24.0")
Expand Down
3 changes: 2 additions & 1 deletion CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 15,8 @@
"description": "Preset for building unit tests",
"hidden": false,
"cacheVariables": {
"BUILD_TESTS": "ON"
"BUILD_TESTS": "ON",
"ENABLE_CODE_COVERAGE": "ON"
},
"inherits": [
"default"
Expand Down
Loading

0 comments on commit 8ae91d4

Please sign in to comment.