-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
zephyr: Add CI to run tests against zephyr with qemu. #15678
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #15678 +/- ##
=======================================
Coverage 98.43% 98.43%
=======================================
Files 163 163
Lines 21295 21295
=======================================
Hits 20961 20961
Misses 334 334 ☔ View full report in Codecov by Sentry. |
Code size report:
|
4504e6d
to
22bd182
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Less code, more test coverage! 🚀
22bd182
to
36a5d67
Compare
The pts line printed by qemu-system-arm goes to stdout, not stderr. Redirect stderr to stdout in case other tools do print to stderr. Signed-off-by: Damien George <damien@micropython.org>
Both of these tests require slice to be enabled. Signed-off-by: Damien George <damien@micropython.org>
Commit f573e73 rewored the zephyr port to build MicroPython as a cmake target, and since that commit the `make-bin-testsuite` helper script no longer works (it requires a Makefile) and hence the tinytest test framework can no longer be run. Instead of fixing this, remove the option to use tinytest. Boards running zephyr can use the standard `tests/run-tests.py` script to run tests in the usual way. Signed-off-by: Damien George <damien@micropython.org>
It needs to be at least this big for `tools/pyboard.py` to work, which is used (among other things) by `tests/run-tests.py`. Signed-off-by: Damien George <damien@micropython.org>
With this change, the zephyr port is tested against the standard test suite via the following scheme: - the zephyr port is built with the `qemu_cortex_m3` board and the `prj_minimal.conf` configuration - `qemu-system-arm` runs `zephyr.elf` - the zephyr console is redirected to a pts/pty - `tests/run-tests.py` is run in bare-metal mode against the pts/pty device This allows testing the zephyr port as though it were a physical board attached over a serial port. Signed-off-by: Damien George <damien@micropython.org>
36a5d67
to
c8838b5
Compare
Summary
Prior to this PR, the zephyr port was only compiled under CI, but no tests were run. There was some provision to run tests on zephyr using
make-bin-testsuite
, but this hasn't been working since the zephyr port moved fully to cmake (and it was never run under CI, only manually).With this change, the zephyr port is tested against the standard test suite via the following scheme:
qemu_cortex_m3
board and theprj_minimal.conf
configurationqemu-system-arm
runszephyr.elf
tests/run-tests.py
is run in bare-metal mode against the pts/pty deviceThis allows testing the zephyr port as though it were a physical board attached over a serial port.
Testing
CI has been added and should run and pass.
Trade-offs and Alternatives
The existing tinytest framework for the zephyr port has been removed in favour of this new approach of running
qemu-system-arm
and redirecting console to a pts/pty device, then runningrun-tests.py
against that serial device. This makes running the tests just like any other bare-metal or unix port.I don't think it's worth continuing to maintain the tinytest framwork on the zephyr port because it's currently broken and needs effort to fix, it's different to everything else, puts an extra burden on the maintainers, and one day won't fit the test suite because it will overflow flash.