diff options
-rwxr-xr-x | tester/run | 14 |
1 files changed, 13 insertions, 1 deletions
@@ -1,5 +1,8 @@ #!/bin/bash +# This script exits with exit status 0 (success), 1 (failure), 2 (cant finish +# testing). + ### test case return codes ### # basic error codes @@ -23,6 +26,7 @@ srcdir=$(cd -P -- "$(dirname -- "$0")" && pwd -P) || exit $DTF_RESULT_TS_CONFIG export DTF_LIBDIR=${DTF_LIBDIR-$srcdir/libdtf} export DTF_TASKS=${DTF_TASKS-$srcdir/tasks} export DTF_RESULTDIR=${DTF_RESULTDIR-/var/tmp/dtf} +export DTF_RESULTS_YML=${DTF_RESULTDIR}/result.yml # when exists per-testsuite config.sh, source it here test -r "$srcdir/config.sh" && . "$srcdir/config.sh" @@ -46,7 +50,8 @@ info() die() { echo "$@" >&2 - exit $DTF_RESULT_TS_CONFIG + echo "exit_status: 2" >> "$DTF_RESULTS_YML" + exit 2 } dist() @@ -200,6 +205,8 @@ done test $dtf_option_listonly -ne 1 && prepare_resultdir + +date -u "+date: \"%Y%m%d_%H%M%S_UTC\"" > "$DTF_RESULTS_YML" result=0 while read i; do testdir=$(dirname "$i") @@ -208,6 +215,9 @@ while read i; do $DTF_RESULT_SUCCES) echo "[ OK ]" ;; + $DTF_RESULT_EXP_FAILURE) + echo "[ EXP_FAIL ]" + ;; $DTF_RESULT_TS_SKIP) ;; $DTF_RESULT_SKIP) @@ -223,4 +233,6 @@ while read i; do esac done <<<"$(find "$DTF_TASKS" -name runtest.sh)" +echo "exit_status: $result" >> "$DTF_RESULTS_YML" + exit $result |