When you're writing or debugging C++ tests with GoogleTest and CMake, this skill keeps you honest about the TDD loop and test isolation. It covers the practical stuff: fixture setup, GMock for interaction testing, CTest discovery with gtest_discover_tests, and CMake config for sanitizers and coverage. The flaky test guardrails are good reminders (no sleeps, unique temp paths, deterministic seeds). What I like is the explicit scoping: it tells you not to use it for feature work or refactors unrelated to tests, which prevents scope creep. If you're working in a modern C++ codebase and need test discipline without the ceremony, this is a solid reference.

skills.sh installs
5.6K
GitHub stars
229.1K
last updated
Jul 14, 2026

Install

$ npx -y skills add affaan-m/everything-claude-code --skill cpp-testing --agent claude-code

Installs into .claude/skills of the current project.

Files

C++ Testing (Agent Skill)

Agent-focused testing workflow for modern C++ (C++17/20) using GoogleTest/GoogleMock with CMake/CTest.

When to Use

  • Writing new C++ tests or fixing existing tests
  • Designing unit/integration test coverage for C++ components
  • Adding test coverage, CI gating, or regression protection
  • Configuring CMake/CTest workflows for consistent execution
  • Investigating test failures or flaky behavior
  • Enabling sanitizers for memory/race diagnostics

When NOT to Use

  • Implementing new product features without test changes
  • Large-scale refactors unrelated to test coverage or failures
  • Performance tuning without test regressions to validate
  • Non-C++ projects or non-test tasks

Core Concepts

  • TDD loop: red → green → refactor (tests first, minimal fix, then cleanups).
  • Isolation: prefer dependency injection and fakes over global state.
  • Test layout: tests/unit, tests/integration, tests/testdata.
  • Mocks vs fakes: mock for interactions, fake for stateful behavior.
  • CTest discovery: use gtest_discover_tests() for stable test discovery.
  • CI signal: run subset first, then full suite with --output-on-failure.

Sponsors

Details

Repository
github.com/affaan-m/everything-claude-code
Category
Testing & QA

More from affaan-m/everything-claude-code

All 256
1affaan-m avatarrust-testingaffaan-m/everything-claude-coderust testing5.3Kskills.sh installs
2affaan-m avatarlaravel-tddaffaan-m/everything-claude-codelaravel tdd5.1Kskills.sh installs
3affaan-m avatarai-regression-testingaffaan-m/everything-claude-codeai regression testing4.8Kskills.sh installs
4affaan-m avatarkotlin-testingaffaan-m/everything-claude-codekotlin testing4.8Kskills.sh installs
5affaan-m avatarperl-testingaffaan-m/everything-claude-codeperl testing4.5Kskills.sh installs
6affaan-m avatarbrowser-qaaffaan-m/everything-claude-codebrowser qa4.3Kskills.sh installs