marlinfirmware/marlin/marlin-build-test
Claude Code and agent skill by marlinfirmware/marlin
- community
Checking that the SKILL.md file is still in the repository.
Use when you need to compile Marlin for a board, apply a CI test configuration, or run the build tests locally. Wraps buildroot/bin/mftest, mfenvs, run_tests, and the Makefile targets.
Install
npx vskill@latest install marlinfirmware/marlin/marlin-build-testSKILL.md
Build and Test Marlin
Requires PlatformIO (pio) in your PATH. Run everything from the repo root.
Build the configured board
- Set
MOTHERBOARDinMarlin/Configuration.hand set up your options. - List the PlatformIO environments for the board:
buildroot/bin/mfenvs - Build the auto-detected environment:
buildroot/bin/mftest -a(rebuild with-r, silent with-s). - Or build one environment directly:
pio run -e <env>
Apply a CI test config and build it
Tests live in buildroot/tests/<env>/config-NN.ini and are applied with the opt_* tools.
- Interactive menu:
buildroot/bin/mftest - Specific test:
buildroot/bin/mftest -t mega2560 -n 5 -y(-tenv name or shortcut,-ntest index,-ybuild without asking) - Start from default configs first: add
-d - Only emit the config changes without building: add
-i - Use the Docker/make method: add
-m
Shortcuts for -t: tree due esp lin lp8 lp9 m128 mega stm f1 f4 f7 s6 teensy t31 t35 t40.
Add tests for a new feature or option
A PR that adds a feature or option should add tests, so CI keeps it building and working.
Build test (buildroot/tests/<env>/config-NN.ini)
- Pick the env directory that matches a board and platform that can build the feature. Use
buildroot/bin/mfenvsor the existing directories underbuildroot/tests. - Prefer adding the option to an existing
config-NN.iniwith a similar feature set. Add a new file only for a combination that no existing test covers. Use the next free number. - Each file begins with a header (
# Test: <env>/config-NN.ini, then a one-line description of the main options) and a[config:base]section. Start from an example withini_use_config = example/..., or leave it out for the defaults. - Set options as
name = valueorname = on. Test the feature enabled along with the options it depends on, and with the dependent sub-options. - Run just your test:
buildroot/bin/mftest -t <env> -n <index> -yormake tests-single-local TEST_TARGET=<env> ONLY_TEST=<index>, where<index>is the test's position in file order (1-based) and normally matchesNN. - Keep the number of tests small. Every test adds to CI time.
Unit test (when the logic can be checked without hardware)
Unit tests run natively on the linux_native_test environment. Good candidates are parsing, math, conversions, state machines and G-code handling. Anything that needs real pins, timers, or devices isn't a good candidate. See test/README.md.
- Add
Marlin/tests/<area>/test_<name>.cpp. Copy the license header and theMARLIN_TEST(group, name)macros from an existing test such asMarlin/tests/feature/test_runout.cpp. - Wrap the file's contents in
#if ENABLED(FEATURE)so it compiles only for configs that enable it. - If no existing config in
test/*.inienables your feature, add one (test/NNN-name.ini). It must usemotherboard = BOARD_SIMULATEDand include only the options needed to pass the sanity checks. - Run:
make unit-test-all-local, or one config withmake unit-test-single-local UNIT_TEST_CONFIG=<name>. (There is a-dockervariant of each.)
Run the tests like CI does
- One environment:
make tests-single-local TEST_TARGET=mega2560 - One test of it:
make tests-single-local TEST_TARGET=mega2560 ONLY_TEST=2 - Everything (slow):
make tests-all-local - In Docker:
make tests-single-local-docker TEST_TARGET=mega2560(seemake help) - Unit tests:
make unit-test-all-local
The test runner restores the configs between tests and may git reset --hard (see GIT_RESET_HARD in make help), so commit or stash your work first.
Restore configuration files
After testing, run buildroot/bin/restore_configs. It deletes generated files (marlin_config.json, _Bootscreen.h, _Statusscreen.h) and does a git checkout of the configuration files, discarding any uncommitted edits to them. restore_configs -d instead loads the default example configs.
Choosing what to build
- Build at least one environment each for any HAL or board family you changed.
- A change to common code deserves an AVR build (tight flash) and a 32-bit build.
- For features, build with the feature both enabled and disabled.
- New feature or option: add a build test and, where it makes sense, a unit test (see above).
Report results
State exactly which envs and tests you built. Do not claim a pass that you did not see.
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-build-test/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-build-test)