diff options
author | Sean Christopherson | 2022-06-09 17:03:19 -0700 |
---|---|---|
committer | Paolo Bonzini | 2022-06-11 11:47:29 -0400 |
commit | 5321270b2362a85a74c3d52c00c3c6730a228f0c (patch) | |
tree | b783ed447eec5b2804d9eeedc4e52a5cc5ca84d4 | |
parent | 7ed397d107d461a53e350e5025d68ec3c4a8934d (diff) |
KVM: selftests: Use TAP-friendly ksft_exit_skip() in __TEST_REQUIRE
Use the TAP-friendly ksft_exit_skip() instead of KVM's custom print_skip()
when skipping a test via __TEST_REQUIRE. KVM's "skipping test" has no
known benefit, whereas some setups rely on TAP output.
Signed-off-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
-rw-r--r-- | tools/testing/selftests/kvm/include/test_util.h | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/tools/testing/selftests/kvm/include/test_util.h b/tools/testing/selftests/kvm/include/test_util.h index 493b2a799a61..5c5a88180b6c 100644 --- a/tools/testing/selftests/kvm/include/test_util.h +++ b/tools/testing/selftests/kvm/include/test_util.h @@ -34,12 +34,10 @@ static inline int _no_printf(const char *format, ...) { return 0; } #endif void print_skip(const char *fmt, ...) __attribute__((format(printf, 1, 2))); -#define __TEST_REQUIRE(f, fmt, ...) \ -do { \ - if (!(f)) { \ - print_skip(fmt, ##__VA_ARGS__); \ - exit(KSFT_SKIP); \ - } \ +#define __TEST_REQUIRE(f, fmt, ...) \ +do { \ + if (!(f)) \ + ksft_exit_skip("- " fmt "\n", ##__VA_ARGS__); \ } while (0) #define TEST_REQUIRE(f) __TEST_REQUIRE(f, "Requirement not met: %s", #f) |