marlinfirmware/marlin/marlin-unit-tests
Claude Code and agent skill by marlinfirmware/marlin
- community
Checking that the SKILL.md file is still in the repository.
Use when writing or running Marlin's native unit tests (make unit-test-*), or when a native unit-test build fails locally, especially on macOS.
Install
npx vskill@latest install marlinfirmware/marlin/marlin-unit-testsSKILL.md
Marlin Native Unit Tests
Background: test/README.md. For adding a test to a feature PR, see also the unit-test section of skill marlin-build-test.
Layout
- Test sources:
Marlin/tests/<area>/test_<name>.cpp(Unity,MARLIN_TEST(group, name)). - Test configurations:
test/NNN-name.ini. Each one builds a separate test binary with a different Marlin configuration. Suites are discovered from this folder bybuildroot/share/PlatformIO/scripts/collect-code-tests.py. - The PlatformIO environment is
linux_native_testinini/native.ini. It is built on the Linux native HAL, with-Werror.
Run
make unit-test-all-local # all configs make unit-test-single-local UNIT_TEST_CONFIG=default # one config (test/001-default.ini) make unit-test-all-local-docker # same, in a container
Write one
- Copy the license header and macros from an existing test, such as
Marlin/tests/feature/test_runout.cpp. - Wrap the file in
#if ENABLED(FEATURE)so it compiles only for configs that enable the feature. - If no
test/*.inienables the feature, add one withmotherboard = BOARD_SIMULATEDand only the options required to pass the sanity checks. - Test logic, not hardware: parsing, math, conversions, state machines. Anything needing real pins or timers isn't a good candidate.
macOS
On macOS /usr/bin/gcc is Clang, which cannot build Marlin. Install GCC with MacPorts or Homebrew, then:
buildroot/bin/mac_gcc macports # or: homebrew (apple resets to the system compiler) which gcc # should now be the real GCC
If the native build fails on macOS, first check the compiler diagnostics and which gcc you got. Don't assume the failure is a bug in the test wiring.
Pitfalls
- Test files are compiled with
-Werror. An unused variable or sign-compare warning fails the run. - Don't work around a compiler warning with duplicate includes or duplicate keys in the INI.
- Run the test configs one at a time. They share the
.piobuild directory.
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingbuildroot/skills/marlin-unit-tests/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/marlinfirmware/marlin/marlin-unit-tests)