Skip to content

Commit d63fde9

Browse files
nfrapradoshuahkh
authored andcommitted
selftests: ktap_helpers: Add a helper to abort the test
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>
1 parent d90b7c7 commit d63fde9

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

tools/testing/selftests/kselftest/ktap_helpers.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,13 @@ ktap_test_result() {
8787
fi
8888
}
8989

90+
ktap_exit_fail_msg() {
91+
echo "Bail out! " $@
92+
ktap_print_totals
93+
94+
exit "$KSFT_FAIL"
95+
}
96+
9097
ktap_print_totals() {
9198
echo "# Totals: pass:$KTAP_CNT_PASS fail:$KTAP_CNT_FAIL xfail:0 xpass:0 skip:$KTAP_CNT_SKIP error:0"
9299
}

0 commit comments

Comments
 (0)