embedded-test

embedded-test is a command for Claude Code from HermeticOrmus/LibreEmbed-Claude-Code. It costs 20 tokens per session (748 once invoked), scanned A, original, MIT.

A command for creating tests for embedded C firmware, including Unity unit tests, CMock hardware stand-ins, hardware-in-the-loop test setups, QEMU emulation, and coverage reports. Hardware-in-the-loop means running tests with a real device or board connected.

In plain words
What is it for?
Use it to generate tests for a module, mock hardware-header functions, prepare tests for targets such as STM32 or nRF52, and create coverage reports from Ceedling and gcov.
Why use it?
It reduces the manual work of preparing tests for code that normally depends on microcontroller hardware. It also helps measure which parts of the firmware tests exercise.

Command for Claude Code

Written for Claude Code: argument-hint in frontmatter.

Part of the embedded-testing plugin — 1 skill, 1 command, 1 agent shipped together

Good fit Use it to generate tests for a module, mock hardware-header functions, prepare tests for targets such as STM32 or nRF52, and create coverage reports from Ceedling and gcov.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/hermeticormus/libreembed-claude-code/embedded-test
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/HermeticOrmus/LibreEmbed-Claude-Code

Made for: Claude Code.

Or install embedded-testing, the plugin that ships this one along with the rest of its 1 skill, 1 command, 1 agent.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for embedded-test

README.md
[![agentmods](https://agentmods.dev/badge/commands/hermeticormus/libreembed-claude-code/embedded-test/github.svg)](https://agentmods.dev/commands/hermeticormus/libreembed-claude-code/embedded-test)
Your own site
<a href="https://agentmods.dev/commands/hermeticormus/libreembed-claude-code/embedded-test"><img src="https://agentmods.dev/badge/commands/hermeticormus/libreembed-claude-code/embedded-test/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for embedded-test

Your own site · 80×15
<a href="https://agentmods.dev/commands/hermeticormus/libreembed-claude-code/embedded-test"><img src="https://agentmods.dev/badge/commands/hermeticormus/libreembed-claude-code/embedded-test.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 20 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 748 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00020 $0.00748
Opus 5.5 $0.00008 $0.00299
Sonnet 5.5 $0.00004 $0.00150
Haiku 4.5 $0.00002 $0.00075

Measured 15d ago against content hash f29903b84cf8, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

embedded-test scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 15d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/embedded-testing/commands/embedded-test.md · 97 lines

How it starts

The opening of the file, as written. The whole thing — 97 lines — stays where its author put it; the contents beside it link to each section on GitHub.

/embedded-test

Embedded test command: Unity/CMock unit tests, HIL setup, QEMU emulation, coverage.

Trigger

/embedded-test <action> [options]

Actions

unit

Generate a Unity test file for a given module.

/embedded-test unit --module sensor --hal i2c
/embedded-test unit --module uart_driver --mock hal_uart
/embedded-test unit --module crc32 --no-hardware

Generates: test_<module>.c with setUp/tearDown, CMock includes, and skeleton test cases.

mock

Generate CMock mock configuration and stubs for hardware headers.

/embedded-test mock --header hal_i2c.h --output test/mocks/
/embedded-test mock --header stm32f4xx_hal_spi.h --subset "HAL_SPI_Transmit,HAL_SPI_Receive"

hil

Generate Hardware-in-the-Loop test scaffold.

/embedded-test hil --target stm32f407 --interface uart --baud 115200
/embedded-test hil --target nrf52840 --interface rtt

coverage

Generate coverage report from Ceedling gcov output.

/embedded-test coverage --module sensor
/embedded-test coverage --all --threshold 80

Process

  1. Identify hardware dependencies in the module under test.
  2. Create i2c_ops_t-style interface structs for each hardware dependency.
  3. Generate CMock mocks from the abstraction headers.
  4. Write test file with setUp/tearDown and test cases for normal + error paths.
  5. Run ceedling test:<module> and fix failures.
  6. Add gcov and check coverage with ceedling gcov:<module>.

Output Examples

Minimal Ceedling test

#include "unity.h"
#include "mock_hal_i2c.h"
#include "sensor.h"

void setUp(void)    { sensor_reset_state(); }
void tearDown(void) {}

void test_sensor_who_am_i_passes_on_valid_id(void)
{
    uint8_t expected_id = 0x60;
    hal_i2c_read_reg_ExpectAndReturn(SENSOR_ADDR, REG_WHO_AM_I,
                                     NULL, 1, HAL_OK);
    hal_i2c_read_reg_ReturnThruPtr_buf(&expected_id);

    TEST_ASSERT_EQUAL(SENSOR_OK, sensor_verify_id());
}

QEMU test runner

qemu-system-arm -machine mps2-an385 -cpu cortex-m3 \
  -kernel build/test/test_sensor.elf \
  -semihosting-config enable=on,target=native \
  -nographic 2>&1 | tee test_results.txt
grep -E "PASS|FAIL|OK" test_results.txt

Read the full file on GitHub · 97 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 15d ago First seen · 97 lines · 20 tokens per session scan A f29903b84cf8

Subscribe to this mod's changes

embedded-test is a command published in the GitHub repository HermeticOrmus/LibreEmbed-Claude-Code (50 stars, last pushed 6d ago), licensed MIT. It adds 20 tokens to every session and 748 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-10-01.