1#!/bin/sh
2# Run all or specified test scripts
3#
4
5case "$1" in
6    --valgrind)
7    	export USE_VALGRIND="valgrind -q --sim-hints=lax-ioctls"
8	shift;
9	;;
10    --valgrind-leakcheck)
11    	export USE_VALGRIND="valgrind --sim-hints=lax-ioctls --leak-check=full --show-reachable=yes --log-file=/tmp/valgrind-%p.log"
12	shift;
13	;;
14esac
15
16if test "$1"x = x ; then
17  TESTS=`ls -d $SRCDIR/[a-zA-Z]_*`
18else
19  TESTS=
20  for i; do
21    case $i in
22	[a-zA-Z])	TESTS="$TESTS $SRCDIR/${i}_*" ;;
23	*)		TESTS="$TESTS $SRCDIR/$i" ;;
24    esac
25  done
26fi
27
28for test_dir in $TESTS; do
29	./test_one $test_dir
30done
31
32$SRCDIR/test_post
33