summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPavel Raiskup <praiskup@redhat.com>2014-10-27 14:03:24 +0100
committerPavel Raiskup <praiskup@redhat.com>2014-10-27 14:03:24 +0100
commitf0e3aae770431b243403d74cf4d90bd7b673f319 (patch)
tree6315196608ed31ecc5046f95e8531b9efc3c3815
parent9e89d125a84334f0aea38ba780fd56cc4dd7cd5c (diff)
downloadpostgresql-setup-tests-f0e3aae770431b243403d74cf4d90bd7b673f319.tar.gz
postgresql-setup-tests-f0e3aae770431b243403d74cf4d90bd7b673f319.tar.xz
postgresql-setup-tests-f0e3aae770431b243403d74cf4d90bd7b673f319.zip
tester/run: fix exit status handling
* tester/run: Define 0, 1 and 2 exit status. Also handle SKIP test-case exit status.
-rwxr-xr-xtester/run14
1 files changed, 13 insertions, 1 deletions
diff --git a/tester/run b/tester/run
index eab6b90..2aa9835 100755
--- a/tester/run
+++ b/tester/run
@@ -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