summaryrefslogtreecommitdiff
path: root/test/dbus-test-runner
blob: a3dc39602ed5794d475dabc718bbc2d393197b55 (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
#!/bin/sh

set -e

dir="$1"
shift

if ! test -d "$dir"; then
  echo "Usage: dbus-test-runner directory [executable...]"
  exit 0
fi

passed=0
failed=0
skipped=0

for prog in "$@"; do
  e=0
  "$dir/$prog" || e=$?
  case $e in
    (0)
      echo "PASS: $prog"
      passed=`expr $passed + 1`
      ;;
    (77)
      echo "SKIP: $prog"
      skipped=`expr $skipped + 1`
      ;;
    (*)
      echo "FAIL: $prog"
      failed=`expr $failed + 1`
      ;;
  esac
done

if test $failed = 0; then
  # avoid saying "FAIL", to make it easy to grep results!
  echo "PASSED $passed / SKIPPED $skipped"
  exit 0
else
  echo "PASSED $passed / FAILED $failed / SKIPPED $skipped"
  exit 1
fi