diff options
author | Simon Glass | 2021-03-07 17:35:03 -0700 |
---|---|---|
committer | Tom Rini | 2021-03-12 09:57:30 -0500 |
commit | d2281bb09b0ebf580f8efe23c84c240a2f3ea9bb (patch) | |
tree | bcb418ce6d700444bad4f3b9992a21b91166b21f /include/test/ut.h | |
parent | c169d542bbecb02b04e39ed3424a88a0bd0b7620 (diff) |
test: Add ut_run_test_live_flat() to run tests twice
Driver model tests are generally run twice, once with livetree enable and
again with it disabled. Add a function to handle this and call it from the
driver model test runner.
Make ut_run_test() private since it is not used outside test-main.c now.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include/test/ut.h')
-rw-r--r-- | include/test/ut.h | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/include/test/ut.h b/include/test/ut.h index adef0b7e1cf..d06bc5089be 100644 --- a/include/test/ut.h +++ b/include/test/ut.h @@ -368,10 +368,13 @@ void ut_unsilence_console(struct unit_test_state *uts); void ut_set_skip_delays(struct unit_test_state *uts, bool skip_delays); /** - * ut_run_test() - Run a single test + * ut_run_test_live_flat() - Run a test with both live and flat tree * - * This runs the test, handling any preparation and clean-up needed. It prints - * the name of each test before running it. + * This calls ut_run_test() with livetree enabled, which is the standard setup + * for runnig tests. Then, for driver model test, it calls it again with + * livetree disabled. This allows checking of flattree being used when OF_LIVE + * is enabled, as is the case in U-Boot proper before relocation, as well as in + * SPL. * * @uts: Test state to update. The caller should ensure that this is zeroed for * the first call to this function. On exit, @uts->fail_count is @@ -381,8 +384,8 @@ void ut_set_skip_delays(struct unit_test_state *uts, bool skip_delays); * @return 0 if all tests passed, -EAGAIN if the test should be skipped, -1 if * any failed */ -int ut_run_test(struct unit_test_state *uts, struct unit_test *test, - const char *name); +int ut_run_test_live_flat(struct unit_test_state *uts, struct unit_test *test, + const char *name); /** * ut_run_tests() - Run a set of tests |