What problem does it solve?
Writing and maintaining robust C++ tests (GoogleTest/CTest) across modern C++ projects can be error-prone and time-consuming. This skill provides a structured workflow to configure tests, integrate with CMake/CTest, and apply best practices like test doubles, fixtures, and sanitizers to ensure reliable test runs.
Core Features & Use Cases
- Test layout & conventions: guide for unit/integration test organization (tests/unit, tests/integration) and common patterns with GoogleTest/GoogleMock.
- CMake/CTest integration: instructions to wire GoogleTest into CMake and discover tests with CTest for CI reliability.
- Deterministic tests & best practices: use of fixtures, dependency injection, and isolation to avoid flakiness.
- Sanitizers & coverage guidance: enabling ASan/UBSan/TSan and collecting coverage data to improve code quality.
- Use Case: onboarding a new C++ project with a standard test setup and CI gating.
Quick Start
Run the C++ test suite via CTest to verify the GoogleTest/CTest setup.