test: Handle driver model reinit in test_pre_run()
For driver model tests we want to reinit the data structures so that everything is in a known state before the test runs. This avoids one test changing something that breaks a subsequent tests. Move the call for this into test_pre_run(). Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
@@ -387,6 +387,16 @@ int test_pre_run(struct unit_test_state *uts, struct unit_test *test);
|
||||
*/
|
||||
int test_post_run(struct unit_test_state *uts, struct unit_test *test);
|
||||
|
||||
/**
|
||||
* dm_test_init() - Get ready to run a driver model test
|
||||
*
|
||||
* This clears out the driver model data structures. For sandbox it resets the
|
||||
* state structure.
|
||||
*
|
||||
* @uts: Test state
|
||||
*/
|
||||
int dm_test_init(struct unit_test_state *uts);
|
||||
|
||||
/**
|
||||
* ut_run_tests() - Run a set of tests
|
||||
*
|
||||
|
Reference in New Issue
Block a user