diff options
author | Karel Zak | 2007-03-19 23:27:40 +0100 |
---|---|---|
committer | Karel Zak | 2007-03-19 23:27:40 +0100 |
commit | 05de8126346e395331f68230d3cb7c2106bb25d0 (patch) | |
tree | beacd4b32412211239f0d378b7b23f4272f9f58b /tests/functions.sh | |
parent | hwclock: add --rtc=<path> option and support for /dev/rtc0 (diff) | |
download | kernel-qcow2-util-linux-05de8126346e395331f68230d3cb7c2106bb25d0.tar.gz kernel-qcow2-util-linux-05de8126346e395331f68230d3cb7c2106bb25d0.tar.xz kernel-qcow2-util-linux-05de8126346e395331f68230d3cb7c2106bb25d0.zip |
tests: add ts_ok and ts_failed
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'tests/functions.sh')
-rw-r--r-- | tests/functions.sh | 30 |
1 files changed, 22 insertions, 8 deletions
diff --git a/tests/functions.sh b/tests/functions.sh index 6c6fa9596..c04022b3b 100644 --- a/tests/functions.sh +++ b/tests/functions.sh @@ -9,6 +9,24 @@ function ts_skip { exit 0 } +function ts_failed { + if [ x"$1" == x"" ]; then + echo " FAILED ($TS_NAME)" + else + echo " FAILED ($1)" + fi + exit 1 +} + +function ts_ok { + if [ x"$1" == x"" ]; then + echo " OK" + else + echo " OK ($1)" + fi + exit 0 +} + function ts_init { export LANG="en_US.UTF-8": TS_NAME=$(basename $0) @@ -45,15 +63,11 @@ function ts_finalize { exit 0 fi if [ $res -eq 0 ]; then - if [ x"$1" == x"" ]; then - echo " OK" - else - echo " OK ($1)" - fi - exit 0 + ts_ok $1 else - echo " FAILED ($TS_NAME)" - exit 1 + ts_failed $1 fi } + + |