diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2020-06-22 20:15:42 -0400 |
---|---|---|
committer | Shuah Khan <skhan@linuxfoundation.org> | 2020-07-06 15:17:59 -0600 |
commit | b85d387c9b091953d5e8ac4c72af6747c1a554e3 (patch) | |
tree | ab6503c28cbe9f4b78bd74d751f3fc1ff87d5ac6 /tools/testing/selftests/kselftest | |
parent | 9ebcfadb0610322ac537dd7aa5d9cbc2b2894c68 (diff) |
kselftest: fix TAP output for skipped tests
According to the TAP specification, a skipped test must be marked as "ok"
and annotated with the SKIP directive, for example
ok 23 # skip Insufficient flogiston pressure.
(https://testanything.org/tap-specification.html)
Fix the kselftest infrastructure to match this.
For ksft_exit_skip, it is preferrable to emit a dummy plan line that
indicates the whole test was skipped, but this is not always possible
because of ksft_exit_skip being used as a "shortcut" by the tests.
In that case, print the test counts and a normal "ok" line. The format
is now the same independent of whether msg is NULL or not (but it is
never NULL in any caller right now).
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
Diffstat (limited to 'tools/testing/selftests/kselftest')
-rw-r--r-- | tools/testing/selftests/kselftest/runner.sh | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/testing/selftests/kselftest/runner.sh b/tools/testing/selftests/kselftest/runner.sh index 676b3a8b114d..f4815cbcd60f 100644 --- a/tools/testing/selftests/kselftest/runner.sh +++ b/tools/testing/selftests/kselftest/runner.sh @@ -77,7 +77,7 @@ run_one() echo "ok $test_num $TEST_HDR_MSG") || (rc=$?; \ if [ $rc -eq $skip_rc ]; then \ - echo "not ok $test_num $TEST_HDR_MSG # SKIP" + echo "ok $test_num $TEST_HDR_MSG # SKIP" elif [ $rc -eq $timeout_rc ]; then \ echo "#" echo "not ok $test_num $TEST_HDR_MSG # TIMEOUT" |