aboutsummaryrefslogtreecommitdiffstats
path: root/meta-ivi-test/recipes-yocto-ivi/test-fw/test-fw/test-fw.sh
blob: bfd29b7c7d84f8d64dfc2c3d1c18b850f9d5cd7e (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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/bin/bash
# create dbus-session
dbus-launch >& /tmp/t
export `grep -r DBUS_SESSION_BUS_ADDRESS /tmp/t`

test_list=`ls /opt/tests/*/*_t.inc | awk -F/ '{print $4}' | awk -F_t '{print $1}'`

_test_run() {
  n=$1
  echo "##########"
  get_title
  echo "##########"

  if [ "x${n}" = "x" ]; then
    get_list
    cnt=$?
    echo "[ number of tests:" $cnt "]"
    for k in `seq $cnt`; do
      echo "[" run_${k} "]"
      eval run_${k}
    done
  else
      echo "[" run_${n} "]"
      eval run_${n}
  fi
}

if [ "x$1" = "xhelp" ]; then
   echo "$0"
   echo " - run all test"
   echo ""
   echo "$0 list"
   echo " - list all test program"
   echo ""
   echo "$0 <name>"
   echo " - run all sequence of test <name>"
   echo ""
   echo "$0 <name> <no>"
   echo " - run sequence <no> of test <name>"
   echo ""
   exit 0
fi

for i in $test_list; do
  j="/opt/tests/${i}/${i}_t.inc"
  . $j

  if [ "x$1" != "x" ]; then
    if [ "$1" = "list" ]; then
      get_list
      cnt=$?
      echo $i $cnt
    elif [ "${1}" = "${i}" ]; then
      _test_run $2
      break
    fi
    continue;
  fi
  _test_run
done