1#!/bin/sh
2
3set -e
4
5dir="$1"
6shift
7
8if ! test -d "$dir"; then
9  echo "Usage: dbus-test-runner directory [executable...]"
10  exit 0
11fi
12
13passed=0
14failed=0
15skipped=0
16
17for 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
34done
35
36if test $failed = 0; then
37  # avoid saying "FAIL", to make it easy to grep results!
38  echo "PASSED $passed / SKIPPED $skipped"
39  exit 0
40else
41  echo "PASSED $passed / FAILED $failed / SKIPPED $skipped"
42  exit 1
43fi
44