Testland
Browse all skills & agents

qa-embedded

Embedded C/C++ testing: GoogleTest on ARM, ThrowTheSwitch Unity-C and Ceedling, gcov coverage, QEMU system emulation

Install this plugin

/plugin install qa-embedded@testland-qa
View source

Part of role bundle: qa-role-mobile-desktop

qa-embedded

Embedded C/C++ testing: GoogleTest on ARM, ThrowTheSwitch Unity-C and Ceedling with CMock mocks, gcov coverage, QEMU system emulation

Choosing a framework

Read down the "Signal" column and stop at the first row that matches your project - never infer from a README or folder name alone:

Signal in project rootFrameworkExecution pathStart with
Top-level Ceedling project.ymlUnity + Ceedling (existing stack)host build; add QEMU if the build cross-compilesceedling-build-runner
CMakeLists.txt with find_package(GTest) or a gtest_main link targetGoogleTesthost build + QEMU cross-compile under arm-none-eabi-g++googletest-embedded-arm
Only *.c / *.h files, no harness yetUnity + Ceedling (canonical ThrowTheSwitch setup; Ceedling documents no C++ support)host build (fast loop) + QEMU for arch sanityceedling-build-runner
Any *.cpp / *.cc / *.cxx (incl. mixed C/C++ - a C++ toolchain compiles both)GoogleTesthost build + QEMU when cross-compilinggoogletest-embedded-arm
Ultra-low-RAM target confirmed by -mcpu=cortex-m0 / cortex-m0plus (8-16 KB)Unity standalone (no Ceedling; GoogleTest's heap requirement precludes it)host build + optional QEMUunity-test-framework-c

Execution-path tie-breakers: no cross-compile toolchain in the build file → host build only; arm-none-eabi-* detected with no physical board → host + QEMU (endianness / alignment / interrupt-vector sanity per qemu-system-test-runner); physical board access confirmed → host + QEMU + on-target, with the coverage artefact from the on-target build per embedded-coverage-strategy-reference. A safety standard (DO-178C, ISO 26262, IEC 62304, MISRA-C) sets the minimum structural-coverage level - see the same coverage skill.

Components

TypeNameDescription
skillembedded-coverage-strategy-referenceCoverage criteria, gcov + llvm-cov toolchains, MISRA / DO-178C / ISO 26262 expectations
skillhardware-in-loop-referenceHIL pattern, MIL/SIL/PIL/HIL V-cycle, vendor stack (NI / dSPACE / Vector / Speedgoat), bus emulation, fault injection, DO-178C / ISO 26262 alignment
skillgoogletest-embedded-armGoogleTest 1.17+ for embedded C++ on ARM: TEST/TEST_F/TEST_P/TYPED_TEST, EXPECT vs ASSERT, cross-compile with arm-none-eabi-g++, QEMU run, XML/JSON output
skillunity-test-framework-cThrowTheSwitch Unity for pure-C unit tests (8-bit through 64-bit). Distinct from the Unity game-engine Test Framework at docs.unity3d.com
skillceedling-build-runnerCeedling build orchestration: project.yml schema, ceedling new / test:all / gcov:all / release tasks, JUnit XML + gcov plugins, CI wiring; CMock semantics (Expect / Ignore / ReturnThruPtr / Stub / Callback API, cmock.yml :plugins, teardown verification) in references/cmock.md
skillqemu-system-test-runnerQEMU system emulation for embedded tests: mps2-* / virt / lm3s6965evb boards, -kernel ELF, ARM semihosting, GDB stub, QMP, CI integration
agentembedded-test-authorAuthors embedded C/C++ unit tests end to end: detects the framework + execution path from the project root per the decision table above, scaffolds the harness from zero when none exists (Ceedling project.yml tree or CMake FetchContent GoogleTest wiring, failing INPUT NEEDED placeholders), then emits one test per spec in Unity / GoogleTest / Ceedling-Unity with CMock auto-mocks; pairs with QEMU for cross-compiled runs

Install

/plugin marketplace add testland/qa
/plugin install qa-embedded@testland-qa

Skills

ceedling-build-runner

Author and run the Ceedling build system for C unit testing - the canonical build orchestration on top of Unity (assertions) + CMock (mocks) + CException (exceptions). Covers ceedling new scaffolding, the project.yml schema (:project / :paths / :files / :defines / :flags / :tools / :test_runner / :cmock / :unity / :cexception / :gcov / :plugins), the task surface (test:all, test:{name}, test:pattern, test:path, release, clean / clobber, gcov:all, module:create, environment, dumpconfig), JUnit XML via the report_tests_* plugins, gcov integration, host vs cross-build flow, and CI wiring. CMock semantics - the generated Expect / Ignore / IgnoreArg / ReturnThruPtr / AddCallback / Stub / ExpectAndThrow family, cmock.yml :plugins, mock naming, tearDown verification, strict-vs-ignore matching - are in references/cmock.md. Use when a C project wants the ThrowTheSwitch trio bundled by one build command, or when authoring / reading CMock mocks. For the Unity assertion API see unity-test-framework-c.

embedded-coverage-strategy-reference

Pure-reference catalog of code-coverage strategy for embedded C/C++: the criteria hierarchy (statement / branch / decision / condition / MC/DC), the gcov toolchain (.gcno/.gcda, --coverage), the LLVM source-based toolchain (llvm-profdata / llvm-cov), host-build vs QEMU-build instrumentation, MISRA-C:2012 and DO-178C structural-coverage expectations by safety level (DAL A maps to MC/DC), and report-format choices. Use when choosing what structural-coverage level to require and wiring gcov / llvm-cov into the build; physical .gcda retrieval from hardware is in hardware-in-loop-reference, QEMU machine flags in qemu-system-test-runner, and to author the embedded tests themselves use googletest-embedded-arm or unity-test-framework-c.

googletest-embedded-arm

Author and run GoogleTest 1.17+ for embedded C++ on ARM targets - TEST() / TEST_F() / TEST_P() / TYPED_TEST(), EXPECT_* vs ASSERT_* assertions, fixtures with SetUp() / TearDown(), value-parameterised tests, GoogleMock when paired, cross-compile with arm-none-eabi-g++, run on host or under QEMU via the qemu-system-test-runner skill, --gtest_filter / --gtest_output=xml:results.xml / --gtest_shuffle / --gtest_repeat command-line flags, and XML / JSON output parsing for CI. Use when the unit-under-test is C++ (modern C++17+) and the team wants the de-facto C++ test framework instead of the C-only Unity. For C use unity-test-framework-c; for pure C mocks see the CMock reference in ceedling-build-runner.

hardware-in-loop-reference

Pure-reference catalog of hardware-in-the-loop (HIL) testing for embedded systems. Defines the HIL pattern (ECU-under-test + real-time plant simulator + I/O cards emulating sensors / actuators / buses), the V-cycle progression (MIL → SIL → PIL → HIL), the canonical vendor stack (NI VeriStand + PXI / CompactRIO, dSPACE SCALEXIO / MicroAutoBox, Vector CANoe + VT System, Speedgoat real-time targets), bus emulation per protocol (CAN / CAN FD / LIN / FlexRay / Automotive Ethernet / SOME-IP), fault-injection patterns (short-to-ground, open-circuit, signal corruption), DO-178C / ISO 26262 / IEC 61508 alignment, and the test-evidence chain HIL produces. Use as the HIL terminology + vendor + standard reference when scoping an embedded test rig or interpreting an automotive / aerospace / industrial HIL test report.

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.

unity-test-framework-c

Author and run ThrowTheSwitch Unity (the C unit-testing library) for bare-metal and RTOS C code. Distinct from the Unity game-engine Test Framework at docs.unity3d.com: this is the ThrowTheSwitch C testing library at throwtheswitch.org/unity, a single C file plus headers that runs on 8-bit MCUs through 64-bit hosts. Anchored on the Unity assertion API and configuration macros regardless of execution environment: the TEST_ASSERT_EQUAL_* / _FLOAT / _DOUBLE / _STRING / _MEMORY / _BITS assertion families, setUp/tearDown/RUN_TEST/UNITY_BEGIN/UNITY_END semantics and the exit-code contract, the generate_test_runner.rb generator, build-time config defines (UNITY_INCLUDE_DOUBLE, UNITY_OUTPUT_CHAR, UNITY_EXCLUDE_SETJMP), and CI integration via Ceedling JUnit XML; applies to host builds, cross-builds, and QEMU-run targets alike. For QEMU machine flags, semihosting, and exit-code capture, see qemu-system-test-runner. Use when the unit-under-test is pure C and the target ranges from 8-bit AVR to Cortex-M0 to Linux ARM.