Skip to content
affaan-m avatar

Cpp Testing

Test-writing workflow for C++ with GoogleTest, GoogleMock, CMake, and CTest, including coverage and sanitizers.

CCM score
73 of 100
skills.sh installs
13K
GitHub stars
312.6K
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers TDD-style test writing, fixture and mock patterns, CTest discovery, and failure and flakiness debugging
  • Includes code examples for gtest unit tests, fixtures, gmock mocks, and a CMake/CTest quickstart with gtest_discover_tests()
  • Provides gcov/lcov and llvm-cov coverage recipes plus ASan, UBSan, and TSan options set as CMake flags
  • Designed for C++17/20 projects that need deterministic, isolated tests and sanitizer-backed CI

Install

$ npx -y skills add affaan-m/ecc --skill cpp-testing -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

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.

Details

Repository
github.com/affaan-m/ecc
Categories
Testing & QA, CLI & Terminal
First seen
Jul 14, 2026

Questions

What does the cpp-testing skill help an agent do?

The cpp-testing skill guides an agent through writing, updating and fixing C++ tests with GoogleTest and GoogleMock, configuring CMake and CTest, diagnosing failing or flaky tests, and adding coverage or sanitizers. It follows a red, green, refactor test-driven loop for C++17 and C++20 code.

Which tests and tools does the cpp-testing skill cover?

It covers unit and integration tests, GoogleTest fixtures and mocks, CTest discovery through gtest_discover_tests, and coverage with gcov, lcov or llvm-cov. It also explains enabling AddressSanitizer, UndefinedBehaviorSanitizer and ThreadSanitizer for memory and race diagnostics.

How do I install the cpp-testing skill?

Run npx -y skills add affaan-m/ecc --skill cpp-testing -y inside your project. Once installed, the agent can use the skill when you ask it to work on C++ tests, GoogleTest or CTest setup, or flaky test failures.

Where does cpp-testing rank in its category?

The skill sits in the Testing & QA category and ranks in the top 50 there, alongside skills such as tdd and webapp-testing. Its focus is C++ specifically, with GoogleTest and CMake/CTest workflows.

More from affaan-m/ecc

All 257

Similar to Cpp Testing

More Testing & QA