Skip to content

Commit

Permalink
Add code coverage reporting
Browse files Browse the repository at this point in the history
  • Loading branch information
eriknellessen authored and Erik Nellessen committed Jan 17, 2022
1 parent d5c6da4 commit 069f2b9
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
14 changes: 12 additions & 2 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ include:
- template: Code-Quality.gitlab-ci.yml

before_script:
- apt update && apt -y install cmake libgpgme-dev libgcrypt-dev libfuse-dev makepasswd encfs python3-pgpdump opensc-pkcs11 libc6-dev pcscd automake libpcsclite-dev libgtk-3-dev libcriterion-dev
- apt update && apt -y install cmake libgpgme-dev libgcrypt-dev libfuse-dev makepasswd encfs python3-pgpdump opensc-pkcs11 libc6-dev pcscd automake libpcsclite-dev libgtk-3-dev libcriterion-dev gcovr
- ln -s /usr/lib/x86_64-linux-gnu/libopensc.so.7.0.0 /usr/lib/x86_64-linux-gnu/libopensc.so

build:
Expand All @@ -43,6 +43,15 @@ test:
script:
- cd build
- make test
- gcovr --exclude-unreachable-branches --exclude .*_test\.c --html-details -o coverage.html --root ${CI_PROJECT_DIR}
- gcovr --xml-pretty --exclude-unreachable-branches --exclude .*_test\.c --print-summary -o coverage.xml --root ${CI_PROJECT_DIR}
coverage: /^\s*lines:\s*\d+.\d+\%/
artifacts:
name: ${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}-${CI_COMMIT_SHA}
reports:
cobertura: build/coverage.xml
paths:
- build/coverage.html
cache:
key: build-cache
paths:
Expand All @@ -55,4 +64,5 @@ code_quality:
variables:
REPORT_FORMAT: html
artifacts:
paths: [gl-code-quality-report.html]
paths:
- gl-code-quality-report.html
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,7 @@ if(NOT CRITERION_FOUND)
endif()

enable_testing()
add_compile_options(--coverage)
add_link_options(--coverage)
add_subdirectory(fuseecs)
add_subdirectory(share_a_folder)

0 comments on commit 069f2b9

Please sign in to comment.