Unity ceedling integration
Reusable Agent Skills for embedded systems, MCU debugging, firmware workflows, and AI automation. (嵌入式、MCU 调试、固件流程与 AI 自动化的可复用 Agent Skills 集合)。
npx -y skills add easyzoom/aix-skills --skill unity-ceedling-integrationAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 22 stars22 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
Use when adding, configuring, or debugging Unity, Ceedling, CMock, or embedded C unit tests, mocks, fixtures, build variants, or CI test runs
SKILL.md
3.1 KB, 612 tokens by cl100k_base, as published. Nobody here has run it
Unity Ceedling Integration
Overview
Use this skill to add embedded C tests with Unity assertions, Ceedling builds, and CMock-generated mocks while keeping hardware code behind clear seams. Good embedded tests isolate logic from registers, clocks, and interrupts without pretending the hardware does not exist.
When To Use
Use this skill when:
- The user wants unit tests for C firmware, drivers, protocol parsers, state machines, or business logic.
- The issue involves Ceedling project setup, include paths, mocks, fixtures, test runners, coverage, or CI.
- The codebase uses vendor HALs, RTOS wrappers, static functions, compile-time flags, or hardware registers.
Do not use this skill for hardware-in-the-loop validation alone. Pair it with the relevant hardware or protocol skill.
First Questions
Ask for:
- Toolchain, host OS, Ceedling version, compiler, and CI environment.
- Code under test, dependencies, include paths, and hardware/HAL boundaries.
- Whether mocks, fakes, or real modules should be used.
- Build variants, configuration headers, and preprocessor flags.
- Current failing command and full test output.
Integration Checklist
-
Identify testable units. Start with pure logic, parsers, state machines, and error handling before register-level code.
-
Define hardware boundaries. Wrap HAL calls, RTOS calls, time, logging, and storage behind interfaces that can be mocked or faked.
-
Configure Ceedling deliberately. Set source paths, include paths, defines, vendor files, and plugins in
project.yml. -
Write tests around behavior. Prefer input/output and state transitions over checking private implementation details.
-
Use CMock where it clarifies intent. Mock external collaborators, but use small fakes for stateful dependencies when expectations become brittle.
-
Add CI and coverage last. Keep the command non-interactive and fast enough to run on every change.
Common Failures
- Tests include vendor headers that require target-only compiler extensions.
- Static functions are tested directly instead of through behavior.
- Mocks over-specify call order and make refactors painful.
- Configuration macros differ between tests and firmware builds.
- Global state is not reset in
setUportearDown. - CI uses a different Ruby, compiler, or path layout than local runs.
Verification
Before claiming tests are useful:
- State the Ceedling command and compiler used.
- Confirm at least one passing test for normal behavior and one edge/error case.
- Confirm mocks or fakes match the intended hardware boundary.
- Confirm CI can run the same command non-interactively.
Example
User:
想给驱动状态机加 Ceedling 测试。
Agent:
- Separates register access from state transition logic.
- Adds Unity tests for events, retries, timeout, and invalid transitions.
- Uses CMock only for external HAL/time dependencies.
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.