1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
|
#!/bin/sh
set -e
test_name=$(basename $0 | tr '-' '_')
echo "Building"
gcc -DOS_LINUX -Wall -o "${AUTOPKGTEST_TMP}/tests_${test_name}" "subprojects/libinsane/tests/tests_${test_name}.c" subprojects/libinsane/tests/main.c -lcunit -linsane
# limit the number of file descriptors in case the autopkgtest system set it
# to the hard value which is very high and exhausts ressources and/or timeouts
echo "Reducing file descriptors limit"
ulimit -Sn 1024
if [ $(command -v valgrind) ]; then
echo "Running test with valgrind"
valgrind --trace-children=yes --leak-check=full --error-exitcode=10 "${AUTOPKGTEST_TMP}/tests_${test_name}"
else
echo "Runing test without valgrind"
"${AUTOPKGTEST_TMP}/tests_${test_name}"
fi
|