diff --git a/.travis.yml b/.travis.yml index db8faa38..a401fffd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -36,7 +36,7 @@ script: - ./autogen.sh - ./configure --enable-werror - make --jobs=2 V=1 - - make check VERBOSE=1 + - make check KVZ_TEST_VALGRIND=1 VERBOSE=1 after_script: # Disable errors to work around Travis not knowing how to fix their stuff. diff --git a/tests/util.sh b/tests/util.sh index 89a1e0fc..bc12767d 100644 --- a/tests/util.sh +++ b/tests/util.sh @@ -34,9 +34,18 @@ valgrind_test() { 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 \ - libtool execute \ - valgrind --leak-check=full --error-exitcode=1 -- \ + libtool execute $valgrind \ ../src/kvazaar -i "${yuvfile}" "--input-res=${dimensions}" -o "${hevcfile}" "$@" print_and_run \