changeset 1 | 2fb8b9db1c86 |
0:ffa851df0825 | 1:2fb8b9db1c86 |
---|---|
1 # Common functions for shell testcases |
|
2 |
|
3 PASS () { |
|
4 echo "PASS" |
|
5 exit 0 |
|
6 } |
|
7 |
|
8 FAIL () { |
|
9 echo "FAIL" "$@" |
|
10 exit 2 |
|
11 } |
|
12 |
|
13 DTC=../dtc |
|
14 |
|
15 verbose_run () { |
|
16 if [ -z "$QUIET_TEST" ]; then |
|
17 "$@" |
|
18 else |
|
19 "$@" > /dev/null 2> /dev/null |
|
20 fi |
|
21 } |
|
22 |
|
23 verbose_run_log () { |
|
24 LOG="$1" |
|
25 shift |
|
26 "$@" > "$LOG" 2>&1 |
|
27 ret=$? |
|
28 if [ -z "$QUIET_TEST" ]; then |
|
29 cat "$LOG" >&2 |
|
30 fi |
|
31 return $ret |
|
32 } |