[PATCH v2 00/11] dm: test: Add unit tests for SPL
Simon Glass
sjg at chromium.org
Mon Oct 26 03:38:25 CET 2020
U-Boot has about 700 tests but only a handful of these target SPL. This
is partly because SPL has limited functionality and does not have a
command interface to initiate tests.
The current SPL tests are targeted at sandbox_spl and are initiated from
pytest.
With SPL tests written in C, we can check the behaviour of of-platdata
more easily, since the test can check things directly rather than printing
out information for pytest to check.
This series adds support for SPL tests written in C, targeted at the
sandbox_spl build.
It includes quite a bit of minor refactoring to get everything working.
Changes in v2:
- Drop debug print()
- Restart U-Boot after each SPL test
- Separate out this patch from the next series and include it here
Simon Glass (11):
dm: test: Build tests for SPL
dm: test: Update the test runner to support of-platdata
dm: test: Add a way to run SPL tests
dm: test: Add a very simple of-platadata test
Makefile: Generate a symbol file for u-boot-spl
pytest: Collect SPL unit tests
test: Run SPL unit tests
sandbox: Allow selection of SPL unit tests
test: Run only the selected SPL test
dm: test: Drop of-platdata pytest
Azure/GitLab/Travis: Add SPL unit tests
.azure-pipelines.yml | 2 +-
.gitlab-ci.yml | 2 +-
.travis.yml | 2 +-
arch/sandbox/cpu/spl.c | 18 +++++-------
arch/sandbox/cpu/start.c | 15 ++++++++--
arch/sandbox/include/asm/state.h | 3 +-
configs/sandbox_spl_defconfig | 2 +-
drivers/misc/spltest_sandbox.c | 35 ------------------------
include/test/test.h | 11 ++++++++
scripts/Makefile.spl | 8 +++++-
test/Kconfig | 10 +++++++
test/dm/Makefile | 4 ++-
test/dm/of_platdata.c | 19 +++++++++++++
test/dm/test-main.c | 29 ++++++++++++--------
test/py/conftest.py | 13 +++++----
test/py/tests/test_ofplatdata.py | 47 --------------------------------
test/py/tests/test_spl.py | 34 +++++++++++++++++++++++
test/run | 2 +-
18 files changed, 135 insertions(+), 121 deletions(-)
create mode 100644 test/dm/of_platdata.c
create mode 100644 test/py/tests/test_spl.py
--
2.29.0.rc2.309.g374f81d7ae-goog
More information about the U-Boot
mailing list