Message ID | 20210308003517.1574569-1-sjg@chromium.org |
---|---|
Headers | show |
Series | test: Refactor tests to have a single test runner | expand |
On Sun, Mar 07, 2021 at 05:34:36PM -0700, Simon Glass wrote: > At present U-Boot has two broad sets of tests in the C code: driver model > tests which do a lot of pre-/post-init and command tests which do not. > > This separation makes it slightly harder to write a test, since there are > two different test-state structures and different rules for running the > two different test types. At present these rules are determined by where > the test is (actually its prefix). > > All unit tests can be run from the command line with the 'ut' command. > Since SPL does not have commands, it currently calls the test runner > directly and offers no control of which tests are run. > > This seems like a good time to refactor the tests into a unified test > runner, allowing U-Boot proper and SPL to use the same path, perhaps with > some different conditions along the way. > > This series sets up a unified runner called ut_run_list(), which runs a > set of tests from a linker_list. Driver model tests are distinguished by > a new UT_TESTF_DM flag so that the necessary init and cleanup can still > be done. > > The runner is modified to support running SPL tests that are not solely > for driver model. An example test for FIT loading is added as a > demonstration. > > In addition, some documentation is added to explain how to write tests. For the series, applied to u-boot/next, thanks!