/xmake-skills:xmake-testsfrom xmake-skills
Sets up and runs tests in Xmake projects: declaring cases with add_tests, running via xmake test, and wiring gtest/catch2/doctest frameworks.
Ships in xmake-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Xmake has built-in test support via add_tests on a target. xmake test builds and runs all declared test cases.
target("app_test")
set_kind("binary")
add_files("tests/*.cpp", "src/lib/*.cpp")
add_tests("default") -- run the binary with no args
add_tests("with_arg", {runargs = {"--quick"}})
add_tests("expect_zero", {trim_output = true, pass_outputs = "OK"})
add_tests("fail_case", {fail_outputs = {"ERROR", "FATAL"}})
Running:
xmake test # run all tests
xmake test app_test/default # run one case
xmake test -v # show output
xmake test -jN # parallel
Options per case:
runargs — arguments to passrundir — working directoryrunenvs — environment variables (table)trim_output — trim stdout before comparisonpass_outputs / fail_outputs — substring or list of substrings that decide pass/failgroup — tag tests into groups, e.g. group = "unit" → xmake test -g unitadd_requires("doctest")
target("unit")
set_kind("binary")
add_files("tests/*.cpp")
add_packages("doctest")
add_tests("default")
add_requires("gtest", {configs = {main = true}})
target("unit")
set_kind("binary")
add_files("tests/*.cpp", "src/lib/*.cpp")
add_packages("gtest")
add_tests("default")
A common convention: one test target per file, auto-generated.
for _, file in ipairs(os.files("tests/test_*.cpp")) do
local name = path.basename(file)
target(name)
set_kind("binary")
set_default(false) -- don't build with `xmake`
add_files(file, "src/lib/*.cpp")
add_tests("default")
end
set_default(false) keeps test binaries out of the default build; xmake test still picks them up.
xmake f -m release --yes
xmake build
xmake test -v
--yes auto-accepts package prompts.
xmake-packagesxmake-toolchainsWhat SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub xmake-io/xmake-skills --plugin xmake-skills58 skills in this plugin
/xmake-addon-developmentUse when writing an Xmake addon — the `addon.lua` manifest, the payload layout (plugins/rules/toolchains/modules/includes/templates), `@self` references, shipping package definitions with an addon, `add_globalmodules`, testing it locally, and publishing it to xmake-repo as an `addon` kind package./xmake-addonsUse when installing or using an Xmake addon — `xmake addon --install/--list/--remove/--upgrade/--search`, declaring `add_addons(...)` in a project, and referencing addon payloads with `@addon/<name>/<rule>`, `@addon.<name>.<module>` or `@self`. For writing and publishing one, see xmake-addon-development./xmake-async-jobsUse when running parallel / async work inside xmake scripts — `async.runjobs` for parallel job execution, `async.jobgraph` (DAG) for dependency-ordered jobs, `async.jobpool` (tree structure), `core.base.scheduler` coroutine scheduling, semaphores, and `on_build_files(..., {jobgraph = true})` in rules. For running external compile jobs faster, see `xmake-build-optimization`./xmake-basicsUse when the user is starting a new Xmake project, installing Xmake, or needs the minimal xmake.lua structure. Covers installation, `xmake create`, the project layout, and the smallest valid xmake.lua./xmake-build-cacheUse when configuring or debugging xmake's local build cache (built-in, replaces ccache) or the remote compile cache service (shared across machines via `xmake service --ccache`). Covers enabling/disabling, fallbacks to external ccache, remote cache server/client setup, and cache cleaning./xmake-build-optimizationUse when a project builds slowly and you want to make it faster — parallel jobs, unity build, precompiled headers, build cache, LTO, link-time improvements, binary package cache, and profiling with `XMAKE_PROFILE=perf:*`. Covers idiomatic xmake speedups and the order to try them.Other plugins' skills for the same job