Repository navigation
Conversation
qbs flashes small programs onto a connected board and checks the results over serial. The classes are timing, compute, gc and serial.
The runner can run the programs with tinygo run instead of flashing a board. On wasip1 the programs use standard input and output for serial, because machine.Serial needs host functions that wasmtime does not have.
The riscv-qemu and cortex-m-qemu targets have no UART receive, and cortex-m-qemu has no machine package and a simulated clock. With -noinput the programs start without the host and the serial class is skipped. The timing and gc tests skip when the clock does not advance or the heap is very large.
simavr prints nothing when its output is a pipe and colours each line, so -pty starts the emulator under a pseudo terminal and removes the colour codes. -scheduler and -gc change how the programs are built, because an explicit runtime.GC fails with the tasks scheduler of the simavr target. A second @@go fails the class as a restart and -class-timeout ends a class that keeps printing. The gc tests that build data with pointers run last, and reclaims only skips the class when runtime.GC does not run a collection. A class that does not fit now shows the linker error.
|
I added three commits to this PR. qbs can now run without a board. Emulators. Targets that cannot receive input. simavr. simavr holds back its output when it is not a terminal and colours each line, so Runs that never finish. A second I ran wasip1, riscv-qemu and cortex-m-qemu with no failures except one |
…se for simavr On AVR the conservative collector mistakes many values for heap addresses and the gc tests run out of memory, while the precise collector keeps a list flat. The growth check now uses eight runs and also needs more than one and a half structures of growth, so the wobble of a precise collector is not reported as a leak. The tests that keep the most memory alive run last.
qbs flashes a few small programs onto a connected board and checks the results over its serial port. It is meant to find obvious problems on many boards quickly, not to test any one feature in depth.
The tool builds with the standard Go compiler. The programs it flashes build with TinyGo.
Classes:
A class is skipped when its program does not fit on the target. A test is skipped when the board cannot run it, for example when there is not enough heap. The README explains how to add tests. If
toolsis not the right place I am happy to move it.This supersedes #6023. That PR added the serial tests as a standalone tool. They are the serial class here, along with host drivers for the tests that need the host to send data, so #6023 can be closed.
Boards I ran it on:
conctest fails without it.The programs also build for pico, pico2-w, arduino-uno-r4-wifi, feather-m4 and stm32f4disco. On the arduino-nano,
timing,gcandserialbuild andcomputedoes not fit. I have not run it on a Nano.