From 72b524cf426697e764c9c63611d0f6743f50f0f5 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Sun, 7 Mar 2021 17:34:56 -0700 Subject: 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 --- test/test-main.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'test/test-main.c') diff --git a/test/test-main.c b/test/test-main.c index 6f0d32f..f14b7b0 100644 --- a/test/test-main.c +++ b/test/test-main.c @@ -30,6 +30,9 @@ static int do_autoprobe(struct unit_test_state *uts) int test_pre_run(struct unit_test_state *uts, struct unit_test *test) { + if (test->flags & UT_TESTF_DM) + ut_assertok(dm_test_init(uts)); + ut_set_skip_delays(uts, false); uts->start = mallinfo(); -- cgit v1.1