Merge branch 'wip-valgrind' into 'master'

enable valgrind for tests

See merge request !9
master
Loic Dachary 2016-09-13 19:23:39 +00:00
commit 185295f247
4 changed files with 16 additions and 2 deletions

View File

@ -6,3 +6,5 @@ ACLOCAL_AMFLAGS = -I m4
include_HEADERS = include/gf_complete.h include/gf_method.h include/gf_rand.h include/gf_general.h
# display the output of failed TESTS after a failed make check
export VERBOSE = true

View File

@ -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

View File

@ -910,7 +910,8 @@ void gf_multby_one(void *src, void *dest, int bytes, int xor)
gf_region_data rd;
if (!xor) {
memcpy(dest, src, bytes);
if (dest != src)
memcpy(dest, src, bytes);
return;
}
uls = (unsigned long) src;

View File

@ -33,9 +33,14 @@ gf_inline_time_SOURCES = gf_inline_time.c
#gf_inline_time_LDFLAGS = -lgf_complete
gf_inline_time_LDADD = ../src/libgf_complete.la
# gf_unit 8 A -1 -m LOG_ZERO_EXT is excluded until http://lab.jerasure.org/jerasure/gf-complete/issues/13 is resolved
if ENABLE_VALGRIND
VALGRIND = | perl -p -e 's|^|../libtool --mode=execute valgrind --quiet --error-exitcode=1 --tool=memcheck | if(!/gf_unit 8 A -1 -m LOG_ZERO_EXT/)'
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 \