From 15bd284b29411638b9434bf7c4c4b1feae32033a Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Sun, 28 Feb 2021 05:16:01 +0100 Subject: [PATCH] build: Add code coverage support in the GitLab CI --- .gitignore | 2 ++ .gitlab-ci.yml | 19 ++++++++++++++----- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 46ce104..c805925 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,8 @@ ChangeLog *.a *.log *.trs +*.gcda +*.gcno .dirstamp .deps/ .libs/ diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6fae8fe..ca88de2 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,10 +1,19 @@ image: debian:buster -test: - before_script: - - apt-get update -qq - - apt-get install -qq -y --no-install-recommends - git gcc make autoconf automake libtool libmd-dev +before_script: + - apt-get update -qq + - apt-get install -qq -y --no-install-recommends + git gcc make autoconf automake libtool libmd-dev gcovr + +unit-tests: + stage: test script: - ./autogen && ./configure - make check + +coverage: + stage: test + script: + - ./autogen && ./configure --disable-static + - make check CFLAGS="--coverage -O0 -ggdb" LDFLAGS="--coverage -O0 -ggdb" + - gcovr -s -e test/ -- 2.47.3