affaan-m avatar

Cpp Testing

This one kicks in whenever you're writing C++ tests with GoogleTest or debugging why they're failing. It walks through TDD workflows (red, green, refactor), gives you GMock examples for interaction testing, and shows the CMake boilerplate to wire up CTest properly. The coverage and sanitizer sections are genuinely useful if you're trying to catch memory bugs or get CI gating right. The flaky test guardrails are the kind of thing you learn the hard way, so having them written down helps. It's opinionated about structure (tests/unit, dependency injection over globals) but in a way that keeps test suites maintainable as they grow.

skills.sh installs
5.8K
GitHub stars
300.3K
last updated
Aug 21, 2026

Install

$ npx -y skills add affaan-m/ecc --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/ecc
Categories
Testing & QA, Documentation
First seen
Jul 14, 2026

More from affaan-m/ecc

All 263
1affaan-m avatarspringboot-tddaffaan-m/eccTest-driven development for Spring Boot using JUnit 5, Mockito, MockMvc, Testcontainers, and JaCoCo. Use when adding features, fixing bugs, or refactoring.5.7Kskills.sh installs
2affaan-m avatarwindows-desktop-e2eaffaan-m/eccE2E testing for Windows native desktop apps (WPF, WinForms, Win32/MFC, Qt) using pywinauto and Windows UI Automation.5.7Kskills.sh installs
3affaan-m avatarswift-protocol-di-testingaffaan-m/eccProtocol-based dependency injection for testable Swift code — mock file system, network, and external APIs using focused protocols and Swift Testing.5.4Kskills.sh installs
4affaan-m avatarfsharp-testingaffaan-m/eccF# testing patterns with xUnit, FsUnit, Unquote, FsCheck property-based testing, integration tests, and test organization best practices.5.3Kskills.sh installs
5manaflow-ai avatarcmux-testingmanaflow-ai/cmuxcmux testing rules for Swift Testing, test target compilation, test wiring, and package/refactor validation. Use when adding or changing tests, touching package5.1Kskills.sh installs
6forcedotcom avatardx-devops-test-suite-assignments-configureforcedotcom/sf-skillsRecommends and manages DevOps Center test suite assignments for pipeline stages. Mode A analyzes a commit diff against assigned suite metadata to recommend rele5Kskills.sh installs