What problem does it solve?
This Skill helps developers write, run, and stabilize C++ unit and integration tests by describing workflows and diagnostics for GoogleTest and GoogleMock with CMake and CTest. It reduces time spent reproducing and debugging failing or flaky tests, configuring CI test discovery, and collecting coverage and sanitizer outputs.
Core Features & Use Cases
- TDD guidance: follow the red → green → refactor loop and craft focused failing tests to drive minimal, safe changes.
- CMake and CTest integration: fetch and pin GoogleTest, configure targets, and use gtest_discover_tests for stable test discovery and CI gating.
- Debugging and stabilization: reproduce single failures with gtest filters, enable sanitizers to detect memory and race errors, and add scoped logging to narrow root causes.
- Coverage workflows: target-level coverage flags for gcov/lcov and llvm-cov workflows for actionable reports in CI.
- Flaky test guardrails: avoid sleeps, use condition variables, unique temp directories, deterministic seeds, and separate unit vs integration tests.
Quick Start
Build a Debug test target with sanitizers enabled and run the failing test via CTest to reproduce the failure and capture sanitizer output.