summaryrefslogtreecommitdiffstats
path: root/tests/test-runner/include
diff options
context:
space:
mode:
authorGiuseppe Di Natale <[email protected]>2017-06-30 11:12:29 -0700
committerBrian Behlendorf <[email protected]>2017-06-30 11:12:29 -0700
commitb81a1c61ec6c70586e56d29b66b261dadf1d4fe8 (patch)
treec2bf516eea4cb4977545c3c00e4ba6d5e0d98b9a /tests/test-runner/include
parentaa6e82a6a55d6fde7a8dc1c21bf952df69ef9a20 (diff)
Print fail messages before callbacks in test suite
Reorder operations in _endlog so failure messages get printed prior to performing callbacks and cleanup. This helps clarify why a test failed and places the message closer to the point of incident in the resulting logs. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: George Melikov <[email protected]> Signed-off-by: Giuseppe Di Natale <[email protected]> Closes #6281
Diffstat (limited to 'tests/test-runner/include')
-rw-r--r--tests/test-runner/include/logapi.shlib10
1 files changed, 6 insertions, 4 deletions
diff --git a/tests/test-runner/include/logapi.shlib b/tests/test-runner/include/logapi.shlib
index d9f276e0e..fabfc42b1 100644
--- a/tests/test-runner/include/logapi.shlib
+++ b/tests/test-runner/include/logapi.shlib
@@ -418,7 +418,11 @@ function _endlog
typeset logfile="/tmp/log.$$"
_recursive_output $logfile
- if [[ $1 == $STF_FAIL ]] ; then
+ typeset exitcode=$1
+ shift
+ (( ${#@} > 0 )) && _printline "$@"
+
+ if [[ $exitcode == $STF_FAIL ]] ; then
_execute_testfail_callbacks
fi
@@ -428,9 +432,7 @@ function _endlog
log_note "Performing local cleanup via log_onexit ($cleanup)"
$cleanup
fi
- typeset exitcode=$1
- shift
- (( ${#@} > 0 )) && _printline "$@"
+
exit $exitcode
}