emlearn-micropython icon indicating copy to clipboard operation
emlearn-micropython copied to clipboard

Run tests in QEMU

Open jonnor opened this issue 1 month ago • 2 comments

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.

jonnor avatar Oct 31 '25 19:10 jonnor

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

jonnor avatar Oct 31 '25 19:10 jonnor

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.

jonnor avatar Nov 14 '25 22:11 jonnor