diff options
| author | Ingo Molnar <mingo@kernel.org> | 2022-09-21 09:58:02 +0200 | 
|---|---|---|
| committer | Ingo Molnar <mingo@kernel.org> | 2022-09-21 09:58:02 +0200 | 
| commit | 74656d03ac36fabb16b9df5221cf398ee3a9ca08 (patch) | |
| tree | 0600e619ac817e2c016c148810814f55280316cc /tools/testing/selftests/kvm/include/test_util.h | |
| parent | 0d97db026509c1a13f732b22670ab1f0ac9d8d87 (diff) | |
| parent | 521a547ced6477c54b4b0cc206000406c221b4d6 (diff) | |
Merge tag 'v6.0-rc6' into locking/core, to refresh the branch
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'tools/testing/selftests/kvm/include/test_util.h')
| -rw-r--r-- | tools/testing/selftests/kvm/include/test_util.h | 7 | 
1 files changed, 7 insertions, 0 deletions
diff --git a/tools/testing/selftests/kvm/include/test_util.h b/tools/testing/selftests/kvm/include/test_util.h index 99e0dcdc923f..5c5a88180b6c 100644 --- a/tools/testing/selftests/kvm/include/test_util.h +++ b/tools/testing/selftests/kvm/include/test_util.h @@ -34,6 +34,13 @@ 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))						\ +		ksft_exit_skip("- " fmt "\n", ##__VA_ARGS__);	\ +} while (0) + +#define TEST_REQUIRE(f) __TEST_REQUIRE(f, "Requirement not met: %s", #f)  ssize_t test_write(int fd, const void *buf, size_t count);  ssize_t test_read(int fd, void *buf, size_t count);  | 
