[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250304-nolibc-kselftest-harness-v1-10-adca7cd231e2@linutronix.de>
Date: Tue, 04 Mar 2025 08:10:40 +0100
From: Thomas Weißschuh <thomas.weissschuh@...utronix.de>
To: Shuah Khan <shuah@...nel.org>, Shuah Khan <skhan@...uxfoundation.org>,
Willy Tarreau <w@....eu>,
Thomas Weißschuh <linux@...ssschuh.net>
Cc: linux-kernel@...r.kernel.org, linux-kselftest@...r.kernel.org,
Thomas Weißschuh <thomas.weissschuh@...utronix.de>
Subject: [PATCH 10/32] selftests: harness: Always provide "self" and
"variant"
Some upcoming changes to the assertion macros need those two symbols
also to be available for tests without fixtures.
Provide them with a NULL value.
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@...utronix.de>
---
tools/testing/selftests/kselftest_harness.h | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/tools/testing/selftests/kselftest_harness.h b/tools/testing/selftests/kselftest_harness.h
index df55b99d8abab2398d2eba5080c4d0c795688bc7..0ea3778a3a85fda6bc363d2b2e1038679920d22b 100644
--- a/tools/testing/selftests/kselftest_harness.h
+++ b/tools/testing/selftests/kselftest_harness.h
@@ -177,13 +177,13 @@
#define TEST_SIGNAL(test_name, signal) __TEST_IMPL(test_name, signal)
#define __TEST_IMPL(test_name, _signal) \
- static void test_name(struct __test_metadata *_metadata); \
+ static void test_name(struct __test_metadata *_metadata, void *self, const void *variant); \
static void wrapper_##test_name( \
struct __test_metadata *_metadata, \
struct __fixture_variant_metadata __attribute__((unused)) *variant) \
{ \
if (setjmp(_metadata->env) == 0) \
- test_name(_metadata); \
+ test_name(_metadata, NULL, NULL); \
__test_check_assert(_metadata); \
} \
static struct __test_metadata _##test_name##_object = \
@@ -197,7 +197,9 @@
__register_test(&_##test_name##_object); \
} \
static void test_name( \
- struct __test_metadata __attribute__((unused)) *_metadata)
+ struct __test_metadata __attribute__((unused)) *_metadata, \
+ void __attribute__((unused)) *self, \
+ const void __attribute__((unused)) *variant)
/**
* FIXTURE_DATA() - Wraps the struct name so we have one less
--
2.48.1
Powered by blists - more mailing lists