emlearn-micropython
emlearn-micropython copied to clipboard
Run tests in QEMU
MicroPython now has a QEMU port that is relatively mature. One can use mpremote with it, and it supports a range of ARM Cortex M targets along with RISC-V.
So it would be good to have a make target for running our tests against qemu. So that it can be used manually when developing. But also to run this automatically in CI.
I did some quick tests. The following seems to work with MicroPython in git master
ports/qemu, do make run BOARD=MPS2_AN500
Then in emlearn-micropython
make dist ARCH=armv6m
mremote connect /dev/pts/8 exec "import sys; sys.path.insert(0, 'dist/armv6m_6.3')" mount . run tests/test_fft.py
It looks like MPS2_AN500 is not available in 1.26.1, only in git master. And I had a problem running tests against MPS2_AN385 in 1.26.1 (missing select). So might wait with this until next MicroPython release.
We also need some wrapper that looks for "Passed: 0" to actually check success, and fails build if not.