Commit d431ea86 authored by Thomas Weißschuh's avatar Thomas Weißschuh Committed by Shuah Khan
Browse files

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: default avatarThomas Weißschuh <thomas.weissschuh@linutronix.de>
Link: https://lore.kernel.org/r/20260302-kselftest-harness-v2-2-3143aa41d989@linutronix.de


Signed-off-by: default avatarShuah Khan <skhan@linuxfoundation.org>
parent 758b8905
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -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 */