summaryrefslogtreecommitdiff
path: root/automated/lib/sh-test-lib
diff options
context:
space:
mode:
Diffstat (limited to 'automated/lib/sh-test-lib')
-rwxr-xr-xautomated/lib/sh-test-lib12
1 files changed, 11 insertions, 1 deletions
diff --git a/automated/lib/sh-test-lib b/automated/lib/sh-test-lib
index 818fc90..39a7e92 100755
--- a/automated/lib/sh-test-lib
+++ b/automated/lib/sh-test-lib
@@ -32,11 +32,21 @@ check_root() {
exit_on_fail() {
local exit_code="$?"
- [ "$#" -ne 1 ] && error_msg "Usage: exit_on_fail test"
+ [ "$#" -lt 1 ] && error_msg "Usage: exit_on_fail test [skip_list]"
local test="$1"
+ local skip_list="$2"
if [ "${exit_code}" -ne 0 ]; then
echo "${test} fail" | tee -a "${RESULT_FILE}"
+
+ # skip_list is a list of tests sepereated by space. This might be
+ # useful when exiting on prerequisite not met.
+ if [ -n "${skip_list}" ]; then
+ for i in ${skip_list}; do
+ echo "$i skip" | tee -a "${RESULT_FILE}"
+ done
+ fi
+
# Exit normally to continue to run the following steps defined in test
# definition file.
exit 0