From d8e162b7ce1ad39bf04fe48902d12c99d20635ea Mon Sep 17 00:00:00 2001 From: Trond Norbye Date: Mon, 23 Apr 2012 13:11:16 +0200 Subject: [PATCH] Add valgrind target Change-Id: I54f5814dd5678debcfb514d0cd068b4097078a36 --- Makefile.am | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/Makefile.am b/Makefile.am index 4ef8175..c6deebb 100644 --- a/Makefile.am +++ b/Makefile.am @@ -90,6 +90,32 @@ LINTFLAGS=-Iinclude -b -c -errchk=%all \ lint: $(LINT.c) $(libcbio_la_SOURCES) +VALGRIND=valgrind +VALGRIND_OPTIONS=--tool=Memcheck --num-callers=50 \ + --error-limit=yes --track-origins=yes --malloc-fill=55 \ + --free-fill=aa --dsymutil=yes -q + +VALGRIND_TEST=tests/.libs/test_open_empty_filename \ + tests/.libs/test_create_database \ + tests/.libs/test_get_miss \ + tests/.libs/test_store_single_document \ + tests/.libs/test_get_hit \ + tests/.libs/test_delete_document \ + tests/.libs/test_delete_nonexistent_document \ + tests/.libs/test_get_deleted_document \ + tests/.libs/test_bulk_store_documents \ + tests/.libs/test_changes_since \ + tests/.libs/test_local_documents + +valgrind: ${check_PROGRAMS} + @for f in $(VALGRIND_TEST); \ + do \ + LD_LIBRARY_PATH=`pwd`/.libs \ + DYLD_LIBRARY_PATH=`pwd`/.libs \ + echo Running Valgrind on $$f; \ + $(VALGRIND) $(VALGRIND_OPTIONS) --log-file=`basename $$f`.log $$f; \ + done + reformat: astyle --mode=c \ --quiet \