Home | History | Annotate | Download | only in test
      1 #!/bin/sh
      2 
      3 set -e
      4 
      5 dir="$1"
      6 shift
      7 
      8 if ! test -d "$dir"; then
      9   echo "Usage: dbus-test-runner directory [executable...]"
     10   exit 0
     11 fi
     12 
     13 passed=0
     14 failed=0
     15 skipped=0
     16 
     17 for prog in "$@"; do
     18   e=0
     19   "$dir/$prog" || e=$?
     20   case $e in
     21     (0)
     22       echo "PASS: $prog"
     23       passed=`expr $passed + 1`
     24       ;;
     25     (77)
     26       echo "SKIP: $prog"
     27       skipped=`expr $skipped + 1`
     28       ;;
     29     (*)
     30       echo "FAIL: $prog"
     31       failed=`expr $failed + 1`
     32       ;;
     33   esac
     34 done
     35 
     36 if test $failed = 0; then
     37   # avoid saying "FAIL", to make it easy to grep results!
     38   echo "PASSED $passed / SKIPPED $skipped"
     39   exit 0
     40 else
     41   echo "PASSED $passed / FAILED $failed / SKIPPED $skipped"
     42   exit 1
     43 fi
     44