mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2026-01-26 21:41:34 +03:00
autotools: Make valgrind actually check for leaks
Problem with libtools is that it produces shell scripts which then set LD_LIBRARY_PATH and execute actual binary (hidden in .libs dir). Therefore, running 'valgring ./testbinary' doesn't do anything useful (beside checking for memleaks in shell). We want to use `libtool --mode=execute valgrind ./testbinary`. With that fixed, next step is to make valgrind return a non-zero value if a memleak is detected (--error-exitcode=). And to show individual memleaks let's use --leak-check=full. Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
committed by
Daniel Garcia Moreno
parent
6555048b24
commit
e2f7674871
@@ -186,10 +186,12 @@ endif
|
||||
# Compatibility name of the check target
|
||||
runtests: check
|
||||
|
||||
VALGRIND = valgrind -q --leak-check=full --error-exitcode=1
|
||||
|
||||
check-valgrind valgrind:
|
||||
@echo '## Running the regression tests under Valgrind'
|
||||
@echo '## Go get a cup of coffee it is gonna take a while ...'
|
||||
$(MAKE) CHECKER='valgrind -q' check
|
||||
$(MAKE) check CHECKER="$(LIBTOOL) --mode=execute $(VALGRIND)"
|
||||
|
||||
dist-hook:
|
||||
(cd $(srcdir) ; tar -cf - --exclude .git win32 test result) | (cd $(distdir); tar xf -)
|
||||
|
||||
Reference in New Issue
Block a user