Skip to content

Commit

Permalink
selftests: ktap_helpers: Add a helper to abort the test
Browse files Browse the repository at this point in the history
Similar to the C counterpart, add a helper function to abort the
remainder of the test.

Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
  • Loading branch information
nfraprado authored and shuahkh committed Feb 20, 2024
1 parent d90b7c7 commit d63fde9
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tools/testing/selftests/kselftest/ktap_helpers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,13 @@ ktap_test_result() {
fi
}

ktap_exit_fail_msg() {
echo "Bail out! " $@
ktap_print_totals

exit "$KSFT_FAIL"
}

ktap_print_totals() {
echo "# Totals: pass:$KTAP_CNT_PASS fail:$KTAP_CNT_FAIL xfail:0 xpass:0 skip:$KTAP_CNT_SKIP error:0"
}

0 comments on commit d63fde9

Please sign in to comment.