embedded-testing-patterns

embedded-testing-patterns is a skill for Claude Code from HermeticOrmus/LibreEmbed-Claude-Code. It costs 62 tokens per session (1,425 once invoked), scanned A, original, MIT.

A reference guide for testing embedded C code with Unity, CMock, Ceedling, and QEMU. These tools support unit tests, mocks, build automation, and simulated hardware execution.

In plain words
What is it for?
Use it to set up Ceedling projects, test hardware drivers through interfaces, generate mocks, run tests, and collect coverage.
Why use it?
It shows how to structure tests and replace hardware interfaces so firmware logic can be checked before running on a device.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

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

Good fit Use it to set up Ceedling projects, test hardware drivers through interfaces, generate mocks, run tests, and collect coverage.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/hermeticormus/libreembed-claude-code/embedded-testing-patterns
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.

Any agent
npx skills add HermeticOrmus/LibreEmbed-Claude-Code --skill embedded-testing-patterns
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-testing-patterns

README.md
[![agentmods](https://agentmods.dev/badge/skills/hermeticormus/libreembed-claude-code/embedded-testing-patterns/github.svg)](https://agentmods.dev/skills/hermeticormus/libreembed-claude-code/embedded-testing-patterns)
Your own site
<a href="https://agentmods.dev/skills/hermeticormus/libreembed-claude-code/embedded-testing-patterns"><img src="https://agentmods.dev/badge/skills/hermeticormus/libreembed-claude-code/embedded-testing-patterns/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-testing-patterns

Your own site · 80×15
<a href="https://agentmods.dev/skills/hermeticormus/libreembed-claude-code/embedded-testing-patterns"><img src="https://agentmods.dev/badge/skills/hermeticormus/libreembed-claude-code/embedded-testing-patterns.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 62 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,425 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.00062 $0.01425
Opus 5.5 $0.00025 $0.00570
Sonnet 5.5 $0.00012 $0.00285
Haiku 4.5 $0.00006 $0.00143

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

Security

Grade A, and why

embedded-testing-patterns 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 2mo 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/skills/embedded-testing-patterns/SKILL.md · 188 lines

How it starts

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

embedded-testing-patterns

Knowledge Base

Embedded C test patterns using Unity, CMock, Ceedling, and QEMU.


Pattern 1: Ceedling Project Structure

project/
├── project.yml           # Ceedling configuration
├── src/
│   ├── sensor.c
│   └── sensor.h
├── test/
│   ├── test_sensor.c
│   └── support/          # Test helpers, stubs
└── vendor/               # Unity, CMock (git submodule or gem)

Minimal project.yml:

:project:
  :build_root: build
  :test_file_prefix: test_

:paths:
  :source: ["src/**"]
  :test:   ["test/**"]
  :include: ["src"]

:tools:
  :test_compiler:
    :arguments:
      - -std=c11
      - -DUNIT_TEST

:plugins:
  :load_paths: ["vendor/ceedling/plugins"]
  :enabled: [gcov, xml_tests_report]

:cmock:
  :enforce_strict_ordering: TRUE
  :plugins: [:ignore, :return_thru_ptr, :callback]

Run:

ceedling test:all           # All tests
ceedling test:sensor        # Single module
ceedling gcov:all           # Coverage
ceedling utils:gcov         # HTML coverage report

Pattern 2: Testable HAL Interface Pattern

The golden rule: drivers never call HAL_I2C_Master_Transmit directly. They call through a pointer.

/* hal_i2c.h */
typedef int (*i2c_write_fn)(uint8_t dev_addr, uint8_t reg_addr,
                             const uint8_t *data, uint8_t len);
typedef int (*i2c_read_fn)(uint8_t dev_addr, uint8_t reg_addr,
                            uint8_t *data, uint8_t len);

typedef struct {
    i2c_write_fn write;
    i2c_read_fn  read;
} i2c_ops_t;

/* sensor.c uses i2c_ops_t, not HAL directly */
static const i2c_ops_t *s_i2c;

int sensor_begin(const i2c_ops_t *i2c_ops) {
    s_i2c = i2c_ops;
    return s_i2c->write(SENSOR_ADDR, REG_RESET, (uint8_t[]){0xB6}, 1);
}

Production: pass a &stm32_i2c_ops that wraps HAL_I2C_Master_Transmit. Test: pass a &mock_i2c_ops backed by function pointers set by CMock.


Pattern 3: CMock Expect Chaining

Order matters. CMock verifies calls happen in declared order when enforce_strict_ordering: TRUE.

Read the full file on GitHub · 188 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. 2mo ago Changed · +5 lines · +62 tokens per session fe22c37e4386
  2. 3mo ago First seen · 183 lines · 0 tokens per session scan A fe2f3a1db7a4

Subscribe to this mod's changes

embedded-testing-patterns is a skill published in the GitHub repository HermeticOrmus/LibreEmbed-Claude-Code (50 stars, last pushed 1mo ago), licensed MIT. It adds 62 tokens to every session and 1,425 once invoked, about $0.0002 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-08-30.

Related

embedded-testing-patterns compared with skills from other repositories

embedded-testing-patterns next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
embedded-testing-patternsHermeticOrmus/LibreEmbed-Claude-CodeSkill501mo agoMITA62Claude Code
IoT Device TestingPramodDutta/qaskillsSkill2531mo agoMITA33Claude Code, Codex
volt-firmwaretonone-ai/tononeSkill852d agoMITA76Claude Code
volt-otatonone-ai/tononeSkill852d agoMITA70Claude Code
volt-drivertonone-ai/tononeSkill852d agoMITA63Claude Code
volt-powertonone-ai/tononeSkill852d agoMITA65Claude Code
volt-recontonone-ai/tononeSkill852d agoMITA52Claude Code