summaryrefslogtreecommitdiffstats
path: root/tests/test_script.in
blob: 442999db2ce83392ad5809ac318b4a02b5c4fd7c (plain)
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
#!/bin/sh
# Run all or specified test scripts
#

case "$1" in
    --valgrind)
    	export USE_VALGRIND="valgrind -q --sim-hints=lax-ioctls"
	shift
	;;
    --valgrind-leakcheck)
    	export USE_VALGRIND="valgrind --sim-hints=lax-ioctls --leak-check=full --show-reachable=yes --log-file=/tmp/valgrind-%p.log"
	shift
	;;
    --failed)
	DO_FAILED=yes
	shift
	;;
esac

TESTS=

if test -n "$DO_FAILED"; then
    FAILED=$(find . -maxdepth 1 -name \*.failed)
    if test -z "$FAILED" ; then
	echo " "
	echo "No (more) failed tests!"
	echo " "
    fi
    for fname in $FAILED ; do
	TESTS="$TESTS $SRCDIR/${fname%%.failed}"
    done
fi

for i; do
  case $i in
	[a-zA-Z])	TESTS="$TESTS $SRCDIR/${i}_*" ;;
	*)		TESTS="$TESTS $SRCDIR/$i" ;;
  esac
done

if test "$TESTS"x = x ; then
    if test -n "$DO_FAILED"; then
	exit 0
    fi
    TESTS=`ls -d $SRCDIR/[a-zA-Z]_*`
fi

for test_dir in $TESTS; do
	./test_one $test_dir
done

$SRCDIR/test_post