1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
|
#!/bin/sh
dir=`dirname "$0"`
cd "${AUTOPKGTEST_TMP}"
cleanup() {
ex=$?
rm -rf build rsync.log build.log
exit "${ex}"
}
trap "cleanup" EXIT TERM INT
# test if valgrind package exists
echo 'test if valgrind package exists ... START'
if which valgrind >/dev/null; then
echo 'test if valgrind package exists ... OK'
else
echo 'test if valgrind package exists ... FAILED, skipping tests'
exit 77
fi
# copy source directory to build/
echo 'copying source directory to build/ ... START'
if rsync -a --exclude=debian "${dir}/../../" "build/" >rsync.log 2>&1; then
echo 'copying source directory to build/ ... OK'
else
cat rsync.log
echo 'copying source directory to build/ ... FAILED'
exit 1
fi
# build
echo 'build ... START'
(
cd build || exit 1
make test-crypto || exit 1
) > build.log 2>&1
ex=$?
if [ "${ex}" -eq 0 ]; then
echo 'build ... OK'
else
cat build.log
echo 'build ... FAILED'
fi
# run valgrind test
echo 'run valgrind test ... START'
env valgrind_multiplier=1 valgrind -q --error-exitcode=99 ./build/test-crypto
ex=$?
if [ "${ex}" -eq 0 ]; then
echo 'run valgrind test ... OK'
else
echo 'run valgrind test ... FAILED'
fi
|