rtfb / riscv-hobby-os

Other
27 stars 5 forks source link

Add a qemu launcher script for future tests and convenience #32

Closed rtfb closed 3 years ago

rtfb commented 3 years ago

I want to run tests inside qemu, but that means it has to terminate somehow. This script prepares the ground for this. It runs qemu from within a Python script as a subprocess, taking complete control over stdin and stdout, and process lifetime.

The test stdout+stderr will be captured in a file, which can then be compared against expected output. The test running time can be capped by a timeout.

As a side effect, intercepting stdin also allows the script to listen to signals like Ctrl-c, which finally allows a convenient qemu termination in dev environment.