summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLoic Dachary <ldachary@redhat.com>2015-01-11 11:00:37 +0100
committerLoic Dachary <loic@dachary.org>2016-09-13 10:09:00 +0200
commit22cd7b15e8d65f855f2739bf0e20d9f1319c4c4b (patch)
tree68d0057e5eb2b97f238463372df7fc32ff6059f2
parent62b702d568ae0e764219ea47e165556f7b39392b (diff)
downloadgf-complete-22cd7b15e8d65f855f2739bf0e20d9f1319c4c4b.tar.gz
add --enable-valgrind for make check
If --enable-valgrind is given to ./configure, all tests are run with valgrind set to fail if an error is reported ( --error-exitcode=1 ) Signed-off-by: Loic Dachary <loic@dachary.org>
-rw-r--r--configure.ac6
-rw-r--r--tools/Makefile.am6
2 files changed, 11 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index ad7bb83..3e8cf18 100644
--- a/configure.ac
+++ b/configure.ac
@@ -60,5 +60,11 @@ AC_ARG_ENABLE([sse],
fi]
)
+AC_ARG_ENABLE([valgrind],
+ [AS_HELP_STRING([--enable-valgrind], [run tests with valgrind])],
+ [],
+ [enable_valgrind=no])
+AM_CONDITIONAL(ENABLE_VALGRIND, test "x$enable_valgrind" != xno)
+
AC_CONFIG_FILES([Makefile src/Makefile tools/Makefile test/Makefile examples/Makefile])
AC_OUTPUT
diff --git a/tools/Makefile.am b/tools/Makefile.am
index eb27d4a..8c4b1ce 100644
--- a/tools/Makefile.am
+++ b/tools/Makefile.am
@@ -33,9 +33,13 @@ gf_inline_time_SOURCES = gf_inline_time.c
#gf_inline_time_LDFLAGS = -lgf_complete
gf_inline_time_LDADD = ../src/libgf_complete.la
+if ENABLE_VALGRIND
+VALGRIND = | sed -e 's|^|../libtool --mode=execute valgrind --quiet --error-exitcode=1 --tool=memcheck |'
+endif
+
# gf_unit tests as generated by gf_methods
gf_unit_w%.sh: gf_methods
- ./$^ $(@:gf_unit_w%.sh=%) -A -U > $@ || rm $@
+ ./$^ $(@:gf_unit_w%.sh=%) -A -U ${VALGRIND} > $@ || rm $@
TESTS = gf_unit_w128.sh \
gf_unit_w64.sh \