All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/30] test: Refactor tests to have a single test runner
@ 2021-01-28 15:11 Simon Glass
  2021-01-28 15:11 ` [PATCH 01/30] doc: Tidy up testing section Simon Glass
                   ` (29 more replies)
  0 siblings, 30 replies; 34+ messages in thread
From: Simon Glass @ 2021-01-28 15:11 UTC (permalink / raw)
  To: u-boot

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.

This should make it easier to add SPL tests. A future series may tweak
those as well.

This series is available at u-boot-dm/test-working



Simon Glass (30):
  doc: Tidy up testing section
  doc: Document make tcheck
  sandbox: Drop the 'starting...' message unless testing
  doc: Explain how to run tests without pytest
  doc: Document how sandbox_spl_tests are run
  test: Correct setexpr test prefix
  test: Mark all driver model tests with a flag
  test: Rename test-main.c to test-dm.c
  test: Add an overall test runner
  test: Create pre/post-run functions
  test: Call test_pre/post_run() from driver model tests
  test: Move dm_extended_scan() to test_pre_run()
  test: Move do_autoprobe() to test_pre_run()
  test: Move dm_scan_plat() to test_pre_run()
  test: Drop mallinfo() work-around
  test: Move console silencing to test_pre_run()
  test: Move delay skipping to test_pre_run()
  test: Handle driver model reinit in test_pre_run()
  test: Drop struct dm_test_state
  test: Move dm_test_init() into test-main.c
  test: Move dm_test_destroy() into test-main.c
  test: Move test running into a separate function
  test: Use ut_run_test() to run driver model tests
  test: Drop dm_do_test()
  test: Add ut_run_test_live_flat() to run tests twice
  test: Use a local variable for test state
  test: Run driver-model tests using ut_run_list()
  test: Use return values in dm_test_run()
  test: Move the devicetree check into ut_run_list()
  test: Move restoring of driver model state to ut_run_list()

 arch/sandbox/cpu/spl.c           |   2 +-
 arch/sandbox/cpu/start.c         |  15 +-
 arch/sandbox/include/asm/state.h |   1 +
 doc/develop/index.rst            |   1 +
 doc/develop/testing.rst          |  34 ++-
 doc/develop/tests_under.rst      | 138 ++++++++++
 include/dm/test.h                |  20 +-
 include/test/test.h              |  18 +-
 include/test/ut.h                |  45 ++++
 test/Makefile                    |   2 +
 test/cmd/setexpr.c               |  23 +-
 test/cmd_ut.c                    |  38 +--
 test/dm/Makefile                 |   2 +-
 test/dm/core.c                   |  47 ++--
 test/dm/test-dm.c                |  41 +++
 test/dm/test-driver.c            |  12 +-
 test/dm/test-main.c              | 229 -----------------
 test/dm/test-uclass.c            |  10 +-
 test/py/tests/test_log.py        |   2 +-
 test/test-main.c                 | 416 +++++++++++++++++++++++++++++++
 test/ut.c                        |   7 +
 21 files changed, 767 insertions(+), 336 deletions(-)
 create mode 100644 doc/develop/tests_under.rst
 create mode 100644 test/dm/test-dm.c
 delete mode 100644 test/dm/test-main.c
 create mode 100644 test/test-main.c

-- 
2.30.0.280.ga3ce27912f-goog

^ permalink raw reply	[flat|nested] 34+ messages in thread

end of thread, other threads:[~2021-01-28 16:33 UTC | newest]

Thread overview: 34+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-28 15:11 [PATCH 00/30] test: Refactor tests to have a single test runner Simon Glass
2021-01-28 15:11 ` [PATCH 01/30] doc: Tidy up testing section Simon Glass
2021-01-28 16:18   ` Heinrich Schuchardt
2021-01-28 15:11 ` [PATCH 02/30] doc: Document make tcheck Simon Glass
2021-01-28 16:22   ` Heinrich Schuchardt
2021-01-28 15:11 ` [PATCH 03/30] sandbox: Drop the 'starting...' message unless testing Simon Glass
2021-01-28 15:11 ` [PATCH 04/30] doc: Explain how to run tests without pytest Simon Glass
2021-01-28 15:11 ` [PATCH 05/30] doc: Document how sandbox_spl_tests are run Simon Glass
2021-01-28 16:33   ` Heinrich Schuchardt
2021-01-28 15:11 ` [PATCH 06/30] test: Correct setexpr test prefix Simon Glass
2021-01-28 15:11 ` [PATCH 07/30] test: Mark all driver model tests with a flag Simon Glass
2021-01-28 15:11 ` [PATCH 08/30] test: Rename test-main.c to test-dm.c Simon Glass
2021-01-28 15:11 ` [PATCH 09/30] test: Add an overall test runner Simon Glass
2021-01-28 15:11 ` [PATCH 10/30] test: Create pre/post-run functions Simon Glass
2021-01-28 15:11 ` [PATCH 11/30] test: Call test_pre/post_run() from driver model tests Simon Glass
2021-01-28 15:11 ` [PATCH 12/30] test: Move dm_extended_scan() to test_pre_run() Simon Glass
2021-01-28 15:11 ` [PATCH 13/30] test: Move do_autoprobe() " Simon Glass
2021-01-28 15:11 ` [PATCH 14/30] test: Move dm_scan_plat() " Simon Glass
2021-01-28 15:11 ` [PATCH 15/30] test: Drop mallinfo() work-around Simon Glass
2021-01-28 15:11 ` [PATCH 16/30] test: Move console silencing to test_pre_run() Simon Glass
2021-01-28 15:11 ` [PATCH 17/30] test: Move delay skipping " Simon Glass
2021-01-28 15:11 ` [PATCH 18/30] test: Handle driver model reinit in test_pre_run() Simon Glass
2021-01-28 15:12 ` [PATCH 19/30] test: Drop struct dm_test_state Simon Glass
2021-01-28 15:12 ` [PATCH 20/30] test: Move dm_test_init() into test-main.c Simon Glass
2021-01-28 15:12 ` [PATCH 21/30] test: Move dm_test_destroy() " Simon Glass
2021-01-28 15:12 ` [PATCH 22/30] test: Move test running into a separate function Simon Glass
2021-01-28 15:12 ` [PATCH 23/30] test: Use ut_run_test() to run driver model tests Simon Glass
2021-01-28 15:12 ` [PATCH 24/30] test: Drop dm_do_test() Simon Glass
2021-01-28 15:12 ` [PATCH 25/30] test: Add ut_run_test_live_flat() to run tests twice Simon Glass
2021-01-28 15:12 ` [PATCH 26/30] test: Use a local variable for test state Simon Glass
2021-01-28 15:12 ` [PATCH 27/30] test: Run driver-model tests using ut_run_list() Simon Glass
2021-01-28 15:12 ` [PATCH 28/30] test: Use return values in dm_test_run() Simon Glass
2021-01-28 15:12 ` [PATCH 29/30] test: Move the devicetree check into ut_run_list() Simon Glass
2021-01-28 15:12 ` [PATCH 30/30] test: Move restoring of driver model state to ut_run_list() Simon Glass

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.