build: Add code coverage support in the GitLab CI

This commit is contained in:
Guillem Jover 2021-02-28 05:16:01 +01:00
parent a9fc285988
commit 15bd284b29
2 changed files with 16 additions and 5 deletions

2
.gitignore vendored
View File

@ -7,6 +7,8 @@ ChangeLog
*.a *.a
*.log *.log
*.trs *.trs
*.gcda
*.gcno
.dirstamp .dirstamp
.deps/ .deps/
.libs/ .libs/

View File

@ -1,10 +1,19 @@
image: debian:buster image: debian:buster
test:
before_script: before_script:
- apt-get update -qq - apt-get update -qq
- apt-get install -qq -y --no-install-recommends - apt-get install -qq -y --no-install-recommends
git gcc make autoconf automake libtool libmd-dev git gcc make autoconf automake libtool libmd-dev gcovr
unit-tests:
stage: test
script: script:
- ./autogen && ./configure - ./autogen && ./configure
- make check - make check
coverage:
stage: test
script:
- ./autogen && ./configure --disable-static
- make check CFLAGS="--coverage -O0 -ggdb" LDFLAGS="--coverage -O0 -ggdb"
- gcovr -s -e test/