[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250407-nolibc-kselftest-harness-v2-9-f8812f76e930@linutronix.de>
Date: Mon, 07 Apr 2025 08:52:32 +0200
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 v2 09/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 905986debbfb0ce8c9659dbd52b6c67c6759cae7..4038ceeb42a870a2b77c6888df8a7bb4c4a258ba 100644
--- a/tools/testing/selftests/kselftest_harness.h
+++ b/tools/testing/selftests/kselftest_harness.h
@@ -173,13 +173,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 = \
@@ -193,7 +193,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.49.0
Powered by blists - more mailing lists