
Cpp testing
Guides an agent through writing, fixing and debugging C++ tests with GoogleTest and CTest
Cpp testing is an open-source agent skill for developer tools. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.
- Scripts
- None
- Platforms
- Claude Code, Codex, Cursor
- GitHub stars
- 66
- Last commit
- License
- MIT
- Listing updated
Similar skills
About Cpp testing
This skill gives an agent a test-first workflow for C++17 and C++20 projects built on GoogleTest and GoogleMock, driven by CMake and CTest. It covers writing new unit tests and fixtures, mocking interfaces, and organizing tests into unit and integration layers.
Beyond writing tests, it lays out how to configure test discovery with gtest_discover_tests, run a subset before the full suite, and narrow down a failing or flaky test with gtest filters and sanitizers. It also includes CMake options for GCC gcov/lcov and Clang llvm-cov coverage, plus ASan, UBSan and TSan toggles, along with guardrails against common flakiness sources such as sleeps, real clocks and shared temp paths.
The skill is instruction-only with no bundled scripts. It expects a C++ project with a CMake build and GoogleTest available, and it notes Catch2 and doctest as alternatives. Fuzzing with libFuzzer or RapidCheck is covered as an optional appendix for projects that already use them.
When your agent uses it
Use only when writing/updating/fixing C++ tests, configuring GoogleTest/CTest, diagnosing failing or flaky tests, or adding coverage/sanitizers.
From the skill's SKILL.md. Your agent reads this description to decide when to load the skill.
What it can access
From a static check of its 2 files (9 KB) on GitHub on 1 December 2026. Nothing was run. Read the files before you install a skill: it can tell your agent to run anything its tools allow.
Check another skill before you install it.
Install
This skill ships in the rea-skills plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):
/plugin marketplace add smartworldarafath/REA_Skill
/plugin install rea-skills@smartworldarafathOr copy only this skill to ~/.claude/skills/cpp-testing:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/smartworldarafath/REA_Skill.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/cpp-testing &&
cp -R "$tmp/.agents/skills/cpp-testing" ~/.claude/skills/cpp-testing &&
rm -rf "$tmp"For one project only, put the folder in .claude/skills/cpp-testing inside it instead.
Copy the skill folder to ~/.agents/skills/cpp-testing to use it in every repository:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/smartworldarafath/REA_Skill.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/cpp-testing &&
cp -R "$tmp/.agents/skills/cpp-testing" ~/.agents/skills/cpp-testing &&
rm -rf "$tmp"For one repository only, put the folder in .agents/skills/cpp-testing inside it instead.
Copy the skill folder to ~/.cursor/skills/cpp-testing to use it in every project:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/smartworldarafath/REA_Skill.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/cpp-testing &&
cp -R "$tmp/.agents/skills/cpp-testing" ~/.cursor/skills/cpp-testing &&
rm -rf "$tmp"For one project only, put the folder in .cursor/skills/cpp-testing inside it instead.
Run in a terminal (add --scope workspace to install it for the current workspace only):
gemini skills install https://github.com/smartworldarafath/REA_Skill.git --path .agents/skills/cpp-testingOr copy the folder to ~/.gemini/skills/cpp-testing yourself.
For GitHub Copilot in VS Code, copy the skill folder to ~/.copilot/skills/cpp-testing:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/smartworldarafath/REA_Skill.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/cpp-testing &&
cp -R "$tmp/.agents/skills/cpp-testing" ~/.copilot/skills/cpp-testing &&
rm -rf "$tmp"For one project only, put the folder in .github/skills/cpp-testing inside it instead.
Get the folder:
git clone --depth 1 https://github.com/smartworldarafath/REA_Skill.gitThen copy REA_Skill/.agents/skills/cpp-testing into your agent's skills folder as cpp-testing. Agents that support SKILL.md read one folder per skill.
What it does
- Red-green-refactor workflow
- Steps the agent through writing a failing test, a minimal fix, and cleanup.
- GoogleTest and GMock patterns
- Examples of fixtures, TEST_F cases and mock methods for interface-based code.
- CMake and CTest setup
- A FetchContent-based CMake quickstart with test discovery and CTest commands.
- Coverage configuration
- CMake options and commands for gcov/lcov with GCC and llvm-cov with Clang.
- Sanitizer builds
- CMake toggles for AddressSanitizer, UndefinedBehaviorSanitizer and ThreadSanitizer.
- Flaky test guardrails
- Rules against sleep-based synchronization, real time and shared temp paths in tests.
Good for
- Write unit tests for a new C++ class using GoogleTest
- Fix a failing or intermittent C++ test in a CMake project
- Set up CTest discovery and a test run command for a C++ repo
- Add gcov or llvm-cov coverage reporting to a C++ build
- Enable AddressSanitizer or ThreadSanitizer to chase a memory or race bug
- Mock an interface with GMock to isolate a service under test
Cpp testing FAQ
When does Cpp testing apply?
It is meant for writing, updating or fixing C++ tests, configuring GoogleTest or CTest, diagnosing failing or flaky tests, and adding coverage or sanitizers. It says not to use it for feature work without test changes or for non-C++ projects.
Does Cpp testing need any scripts or extra tools installed?
It bundles no scripts. The examples assume CMake, CTest and GoogleTest, with coverage steps needing gcov/lcov or llvm-cov depending on the compiler.
Which C++ standards does Cpp testing target?
The workflow is described for modern C++, specifically C++17 and C++20, and the CMake example sets C++20.
Are there alternatives to GoogleTest covered?
Yes, the skill briefly lists Catch2 and doctest as alternatives.
How do I install Cpp testing in Claude Code?
Copy the skill folder from GitHub to ~/.claude/skills/cpp-testing to use it in all your projects, or to .claude/skills/cpp-testing in one project. Or install the rea-skills plugin, which includes it: /plugin marketplace add smartworldarafath/REA_Skill, then /plugin install rea-skills@smartworldarafath.
Does Cpp testing run scripts?
No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.
Which AI agents can use Cpp testing?
Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose. Each reads skills in the SKILL.md format from its own folder; the install steps on this page list them.
What are the best alternatives to Cpp testing?
The closest alternatives to Cpp testing are TDD, Csharp testing, Java junit, Unittest skill and Mstest skill.
Where this comes from
- Description: from the skill's own SKILL.md.
More from smartworldarafath/REA_Skill

Guides building and auditing UI to WCAG 2.2 AA across web, iOS and Android
- Open source
- 66 GitHub stars
- Developer tools

Diagnoses agent and LLM stacks for hidden failures and ranks the fixes by severity
- Open source
- 66 GitHub stars
- Developer tools

Compare coding agents head-to-head on your own tasks by pass rate, cost and time
- Open source
- 66 GitHub stars
- Developer tools

Guides an agent to design tool sets, observations and error recovery for better completion
- Open source
- 66 GitHub stars
- Developer tools

Gives an agent a structured capture-diagnose-recover loop for failing runs
- Open source
- 66 GitHub stars
- Developer tools

Lets an AI agent make x402 payments within per-task budgets and spending policies
- Open source
- 66 GitHub stars
- Finance and payments




