test: Run driver-model tests using ut_run_list()

Use this function instead of implementing it separately for driver model.

Make ut_run_tests() private since it is only used in test-main.c

Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Simon Glass
2021-03-07 17:35:05 -07:00
committed by Tom Rini
parent fe806861a9
commit f97f85e661
3 changed files with 81 additions and 93 deletions

View File

@@ -381,48 +381,6 @@ struct unit_test_state *test_get_state(void);
*/
void test_set_state(struct unit_test_state *uts);
/**
* ut_run_test_live_flat() - Run a test with both live and flat tree
*
* 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
* incremented by the number of failures (0, one hopes)
* @test: Test to run
* @name: Name of test, possibly skipping a prefix that should not be displayed
* @return 0 if all tests passed, -EAGAIN if the test should be skipped, -1 if
* any failed
*/
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
*
* This runs the tests, handling any preparation and clean-up needed. It prints
* the name of each test before running it.
*
* @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
* incremented by the number of failures (0, one hopes)
* @prefix: String prefix for the tests. Any tests that have this prefix will be
* printed without the prefix, so that it is easier to see the unique part
* of the test name. If NULL, no prefix processing is done
* @tests: List of tests to run
* @count: Number of tests to run
* @select_name: Name of a single test to run (from the list provided). If NULL
* then all tests are run
* @return 0 if all tests passed, -ENOENT if test @select_name was not found,
* -EBADF if any failed
*/
int ut_run_tests(struct unit_test_state *uts, const char *prefix,
struct unit_test *tests, int count, const char *select_name);
/**
* ut_run_tests() - Run a set of tests
*