[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20260128-kselftest-harness-v1-3-cb259fa81cd0@linutronix.de>
Date: Wed, 28 Jan 2026 11:24:35 +0100
From: Thomas Weißschuh <thomas.weissschuh@...utronix.de>
To: Shuah Khan <shuah@...nel.org>, Kees Cook <kees@...nel.org>,
Andy Lutomirski <luto@...capital.net>, Will Drewry <wad@...omium.org>
Cc: linux-kselftest@...r.kernel.org, linux-kernel@...r.kernel.org,
Thomas Weißschuh <thomas.weissschuh@...utronix.de>
Subject: [PATCH 3/5] selftests: kselftest: Add ksft_reset_state()
Add a helper to reset the internal state of the kselftest framework.
It will be used by the selftest harness.
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@...utronix.de>
---
tools/testing/selftests/kselftest.h | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/tools/testing/selftests/kselftest.h b/tools/testing/selftests/kselftest.h
index 1e7e73f77fa7..7979d6904ac6 100644
--- a/tools/testing/selftests/kselftest.h
+++ b/tools/testing/selftests/kselftest.h
@@ -476,4 +476,15 @@ static inline int ksft_min_kernel_version(unsigned int min_major,
return major > min_major || (major == min_major && minor >= min_minor);
}
+static inline void ksft_reset_state(void)
+{
+ ksft_cnt.ksft_pass = 0;
+ ksft_cnt.ksft_fail = 0;
+ ksft_cnt.ksft_xfail = 0;
+ ksft_cnt.ksft_xpass = 0;
+ ksft_cnt.ksft_xskip = 0;
+ ksft_cnt.ksft_error = 0;
+ ksft_plan = 0;
+};
+
#endif /* __KSELFTEST_H */
--
2.52.0
Powered by blists - more mailing lists