Disable valgrind in tests by default

Changes tests so that valgrind is enabled only when the environment
variable KVZ_TEST_VALGRIND is set and equal to "1".
This commit is contained in:
Arttu Ylä-Outinen 2018-06-14 09:28:28 +03:00
parent a343f6d587
commit cbac8a106e
2 changed files with 12 additions and 3 deletions

View file

@ -36,7 +36,7 @@ script:
- ./autogen.sh - ./autogen.sh
- ./configure --enable-werror - ./configure --enable-werror
- make --jobs=2 V=1 - make --jobs=2 V=1
- make check VERBOSE=1 - make check KVZ_TEST_VALGRIND=1 VERBOSE=1
after_script: after_script:
# Disable errors to work around Travis not knowing how to fix their stuff. # Disable errors to work around Travis not knowing how to fix their stuff.

View file

@ -34,9 +34,18 @@ valgrind_test() {
prepare "${dimensions}" "${frames}" prepare "${dimensions}" "${frames}"
# If $KVZ_TEST_VALGRIND is defined and equal to "1", run the test with
# valgrind. Otherwise, run without valgrind.
if [ "${KVZ_TEST_VALGRIND:-0}" = '1' ]; then
valgrind='valgrind --leak-check=full --error-exitcode=1 --'
else
valgrind=''
fi
# No quotes for $valgrind because it expands to multiple (or zero)
# arguments.
print_and_run \ print_and_run \
libtool execute \ libtool execute $valgrind \
valgrind --leak-check=full --error-exitcode=1 -- \
../src/kvazaar -i "${yuvfile}" "--input-res=${dimensions}" -o "${hevcfile}" "$@" ../src/kvazaar -i "${yuvfile}" "--input-res=${dimensions}" -o "${hevcfile}" "$@"
print_and_run \ print_and_run \