summaryrefslogtreecommitdiffstats
path: root/share/dtf
diff options
context:
space:
mode:
authorPavel Raiskup <praiskup@redhat.com>2015-11-20 14:07:27 +0100
committerPavel Raiskup <praiskup@redhat.com>2015-11-20 14:07:27 +0100
commit872193e6a71f79646cb5b289cbbd26d453b4a443 (patch)
tree3e042842a4ea4b1c33bec1e40fd3f2ee5cdce90b /share/dtf
parent16a583930d2bf7fedb72a3a5044dc336a96c306b (diff)
downloaddtf-872193e6a71f79646cb5b289cbbd26d453b4a443.zip
dtf-872193e6a71f79646cb5b289cbbd26d453b4a443.tar.gz
dtf-872193e6a71f79646cb5b289cbbd26d453b4a443.tar.xz
tests-api: add _hooks variable for dtf_fail
* share/dtf/lib/tests (dtf_fail): Add new $dtf_fail_hooks variable. It is aimed to contain list of shell functions to be execute upon failure.
Diffstat (limited to 'share/dtf')
-rw-r--r--share/dtf/lib/tests8
1 files changed, 8 insertions, 0 deletions
diff --git a/share/dtf/lib/tests b/share/dtf/lib/tests
index e927307..d2d57b1 100644
--- a/share/dtf/lib/tests
+++ b/share/dtf/lib/tests
@@ -14,6 +14,14 @@ dtf_skip ()
dtf_fail ()
{
test -n "$1" && echo >&2 "$1"
+ test -z "$dtf_fail_hooks" && exit 1
+
+ echo >& "running dtf_fail hooks $dtf_fail_hooks"
+ for _i_hook in $dtf_fail_hooks
+ do
+ $_i_hook
+ done
+
exit 1
}