diff options
author | Giuseppe Di Natale <[email protected]> | 2017-06-30 11:12:29 -0700 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2017-06-30 11:12:29 -0700 |
commit | b81a1c61ec6c70586e56d29b66b261dadf1d4fe8 (patch) | |
tree | c2bf516eea4cb4977545c3c00e4ba6d5e0d98b9a | |
parent | aa6e82a6a55d6fde7a8dc1c21bf952df69ef9a20 (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
-rw-r--r-- | tests/test-runner/include/logapi.shlib | 10 |
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 } |