From: Štěpán Kotek Date: Wed, 30 Aug 2017 09:06:11 +0000 (+0200) Subject: Check for memory leaks during unittest CI using valgrind X-Git-Tag: v1.4.0~13^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8c2969a2f19fbff9b820b038f2af2a782ec2f4c2;p=thirdparty%2Fknot-resolver.git Check for memory leaks during unittest CI using valgrind New ci task has been added that checks for possible memory leaks when running unittests. Messages from valgrind are displayed only when leak is detected. refs #227 --- diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 52d16722c..52ede0b53 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -28,6 +28,7 @@ test:linux:amd64: - linux - amd64 + deckard:linux:amd64: stage: test script: @@ -44,6 +45,18 @@ deckard:linux:amd64: - linux - amd64 +test:linux:amd64:valgrind: + image: cznic/ubuntu-valgrind:16.04 + stage: test + script: + - PREFIX=$(pwd)/.local DEBUGGER="valgrind --error-exitcode=1 --leak-check=full --trace-children=yes --quiet" make -k check + dependencies: + - build:linux:amd64 + tags: + - docker + - linux + - amd64 + respdiff:linux:amd64: image: cznic/ubuntu-respdif:16.04 stage: test diff --git a/tests/unit.mk b/tests/unit.mk index 6ab0e6703..876c21d26 100644 --- a/tests/unit.mk +++ b/tests/unit.mk @@ -37,7 +37,7 @@ $(1)_LIBS := $(tests_LIBS) $(1)_DEPEND := $(tests_DEPEND) $(call make_bin,$(1),tests) $(1): $$($(1)) - @$(preload_syms) $$< + @$(preload_syms) $(DEBUGGER) $$< .PHONY: $(1) endef