From 34b744beb866c9ae660f2851f9776f80e165d421 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Thu, 18 May 2017 20:09:13 -0600 Subject: sandbox: Add a way to reset sandbox state for tests Running a new test should reset the sandbox state to avoid tests interferring with each other. Move the existing state-reset code into a function so it can be used from tests. Also update the code to reset the SPI devices and adjust the test code to call it. Signed-off-by: Simon Glass --- arch/sandbox/include/asm/state.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'arch/sandbox/include') diff --git a/arch/sandbox/include/asm/state.h b/arch/sandbox/include/asm/state.h index 987cc7b49dc..617f95291ab 100644 --- a/arch/sandbox/include/asm/state.h +++ b/arch/sandbox/include/asm/state.h @@ -213,6 +213,13 @@ void state_set_skip_delays(bool skip_delays); */ bool state_get_skip_delays(void); +/** + * state_reset_for_test() - Reset ready to re-run tests + * + * This clears out any test state ready for another test run. + */ +void state_reset_for_test(struct sandbox_state *state); + /** * Initialize the test system state */ -- cgit v1.2.3