KVM: selftests: Use TAP-friendly ksft_exit_skip() in __TEST_REQUIRE
authorSean Christopherson <seanjc@google.com>
Fri, 10 Jun 2022 00:03:19 +0000 (17:03 -0700)
committerPaolo Bonzini <pbonzini@redhat.com>
Sat, 11 Jun 2022 15:47:29 +0000 (11:47 -0400)
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>
tools/testing/selftests/kvm/include/test_util.h

index 493b2a7..5c5a881 100644 (file)
@@ -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)