Skip to content

Commit d431ea8

Browse files
t-8chshuahkh
authored andcommitted
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@linutronix.de> Link: https://lore.kernel.org/r/20260302-kselftest-harness-v2-2-3143aa41d989@linutronix.de Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
1 parent 758b890 commit d431ea8

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

tools/testing/selftests/kselftest.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -476,4 +476,15 @@ static inline int ksft_min_kernel_version(unsigned int min_major,
476476
return major > min_major || (major == min_major && minor >= min_minor);
477477
}
478478

479+
static inline void ksft_reset_state(void)
480+
{
481+
ksft_cnt.ksft_pass = 0;
482+
ksft_cnt.ksft_fail = 0;
483+
ksft_cnt.ksft_xfail = 0;
484+
ksft_cnt.ksft_xpass = 0;
485+
ksft_cnt.ksft_xskip = 0;
486+
ksft_cnt.ksft_error = 0;
487+
ksft_plan = 0;
488+
}
489+
479490
#endif /* __KSELFTEST_H */

0 commit comments

Comments
 (0)