File: tests_template

package info (click to toggle)
libinsane 1.0.10-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,580 kB
  • sloc: ansic: 30,642; python: 481; makefile: 115; sh: 45; xml: 43
file content (20 lines) | stat: -rwxr-xr-x 719 bytes parent folder | download
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