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 ;; 14 --failed) 15 DO_FAILED=yes 16 shift 17 ;; 18esac 19 20TESTS= 21 22if test -n "$DO_FAILED"; then 23 FAILED=$(find . -maxdepth 1 -name \*.failed) 24 if test -z "$FAILED" ; then 25 echo " " 26 echo "No (more) failed tests!" 27 echo " " 28 fi 29 for fname in $FAILED ; do 30 TESTS="$TESTS $SRCDIR/${fname%%.failed}" 31 done 32fi 33 34for i; do 35 case $i in 36 [a-zA-Z]) TESTS="$TESTS $SRCDIR/${i}_*" ;; 37 *) TESTS="$TESTS $SRCDIR/$i" ;; 38 esac 39done 40 41if test "$TESTS"x = x ; then 42 if test -n "$DO_FAILED"; then 43 exit 0 44 fi 45 TESTS=`ls -d $SRCDIR/[a-zA-Z]_*` 46fi 47 48for test_dir in $TESTS; do 49 ./test_one $test_dir 50done 51 52$SRCDIR/test_post 53