CtrlK
BlogDocsLog inGet started
Tessl Logo

testland/qemu-system-test-runner

Author and run QEMU system emulation as an embedded-test target - qemu-system-arm / qemu-system-aarch64 / qemu-system-riscv32 launching cross-compiled ELF binaries on virtual MCUs and SoCs. Covers machine selection (-M virt / mps2-an385 / mps2-an386 / mps2-an500 / mps2-an511 / mps3-an524 / lm3s6965evb / raspi3b / xilinx-zynq-a9), CPU selection (-cpu cortex-m0 / cortex-m3 / cortex-m4 / cortex-m33 / cortex-a15 / cortex-a57 / max), -kernel ELF load, -nographic + -serial stdio, ARM semihosting via -semihosting-config enable=on,target=native (so cross-compiled GoogleTest / Unity binaries print to host stdio and exit with the test return code), GDB stub via -S -gdb tcp::1234, QMP monitor via -qmp tcp:host:port for automated test orchestration, and CI wiring. Use when host-only test runs are insufficient and the team wants arch-correct (endianness / alignment / interrupt-vector) behaviour on a virtual MCU without committing to physical hardware-in-loop.

65

Quality

82%

Does it follow best practices?

Run evals on this skill

Adds up to 20 points to the overall score

View guide

SecuritybySnyk

Passed

No findings from the security scan

Overview
Quality
Evals
Security
Files

ci.mdreferences/

QEMU CI integration (GitHub Actions)

The SKILL spine keeps the smoke run; the full pipeline installs the toolchain, cross-builds, and runs the binary under two CPU profiles:

jobs:
  qemu-arm:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v5
      - name: Install toolchain
        run: |
          sudo apt-get update
          sudo apt-get install -y gcc-arm-none-eabi qemu-system-arm
      - name: Cross-build test binary
        run: |
          arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -O0 -g \
              --specs=rdimon.specs \
              -I src -I ext/Unity/src \
              src/*.c ext/Unity/src/unity.c \
              test/test_*.c test/*_Runner.c \
              -o build/test.elf -lrdimon
      - name: Run under QEMU (mps2-an386 / cortex-m4)
        run: |
          qemu-system-arm -M mps2-an386 -cpu cortex-m4 \
              -nographic \
              -semihosting-config enable=on,target=native \
              -kernel build/test.elf | tee build/qemu.log
          # exit code is the Unity failure count (semihosting _exit)
      - name: Also run under Cortex-M0 for ABI sanity
        run: |
          arm-none-eabi-gcc -mcpu=cortex-m0 -mthumb -O0 -g \
              --specs=rdimon.specs \
              -I src -I ext/Unity/src \
              src/*.c ext/Unity/src/unity.c \
              test/test_*.c test/*_Runner.c \
              -o build/test-m0.elf -lrdimon
          qemu-system-arm -M mps2-an385 -cpu cortex-m0 \
              -nographic -semihosting-config enable=on,target=native \
              -kernel build/test-m0.elf

The "run under multiple CPUs" pattern is the cheap way to catch CPU-feature regressions - float vs no-float, ARMv6-M vs ARMv7-M.

SKILL.md

tile.json