The test runners have evolved over time and become more and more complex.
In particular `tests/run-tests.py` is rather large now. The test runners
also duplicate some functionality amongst themselves.
As a start to improving this situation, this commit factors out the helper
functions from `run-tests.py` into a new `test_utils.py` file, and uses
that new module in all test runners.
There should be no functional change here.
Signed-off-by: Damien George <damien@micropython.org>
The existing `serial_test.py` script tests data in/out throughput and
reliability. But it only tests data sizes that are a power of two, which
may not catch certain errors with USB transmission (because FS packet size
is 64 bytes).
This commit adds a new echo sub-test to the `serial_test.py` script. It
sends out data to the target and gets the target to echo it back, and then
compares the result (the echo'd data should be equal to the sent data). It
does this for data packets between 1 and 520 (inclusive) bytes, which
covers USB FS and HS packet sizes (64 and 512 respectively).
It uses random data for the test, but seeded by a constant seed so that
it's deterministic. If there's an error then it prints out all the sent
and echo'd data to make it easier to see where it went wrong (eg if the
previous packet was repeated).
Signed-off-by: Damien George <damien@micropython.org>
Only a problem when UART TX is also enabled and goes first (i.e. esp32
port) as sending 16384 bytes in one go triggers the timeout.
This work was funded through GitHub Sponsors.
Signed-off-by: Angus Gratton <angus@redyak.com.au>
This is a test script used to test USB CDC (or USB UART) serial reliability
and throughput.
Run against any MicroPython remote target with:
$ python serial_test.py -t <device>
Signed-off-by: Damien George <damien@micropython.org>