cpp-testing

Write, run, and maintain C++ tests with GoogleTest and CTest.

16|3|Updated Mar 12, 2026
One-click install
npx skills add https://github.com/sehoon787/my-claude --skill cpp-testing-sehoon787
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cpp-testing
Source: https://github.com/sehoon787/my-claude/tree/main/skills/ecc/cpp-testing
Command: npx skills add https://github.com/sehoon787/my-claude --skill cpp-testing-sehoon787

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Writing, maintaining, and diagnosing C++ tests across modern codebases can be error-prone and slow without a structured workflow. This skill provides a cohesive approach to organizing tests using GoogleTest/GoogleMock with CMake/CTest, enabling reliable builds, clearer test reports, and smoother CI integration.

Core Features & Use Cases

  • Unit and integration testing for C++17/20 projects using GoogleTest/GoogleMock.
  • Fixture and mock support for isolating components and validating interactions.
  • CI-ready workflows with CTest discovery and deterministic test execution across platforms.
  • Guidance on sanitizers and coverage to improve test quality and diagnostics.

Quick Start

Begin by configuring your CMake project to build tests with GoogleTest/CTest, integrate mocks as needed, and run the test suite to validate changes.

Frequently Asked Questions about cpp-testing

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I set up GoogleTest and CTest with CMake for C++ unit testing?

To set up C++ unit testing, configure your CMake project to discover and run GoogleTest suites via CTest, enabling reliable test builds and structured result reporting across platforms.

What is the best way to structure test fixtures and mocks in a modern C++ codebase?

The best way to structure C++ test fixtures and mocks is using GoogleTest and GoogleMock within a CMake-driven workflow, isolating components and validating interactions for clearer diagnostics.

Does this C++ testing approach work with C++17 and C++20 projects?

Yes, this C++ testing approach applies to modern C++17 and C++20 codebases, providing cohesive support for unit tests, integration tests, and test fixtures using GoogleTest and CMake.

How do I integrate sanitizers and code coverage into my CTest CI workflow?

You integrate sanitizers and code coverage into your CTest CI workflow by applying structured guidance for GoogleTest execution, improving test quality and runtime diagnostics across deterministic builds.

Why are my GoogleTest cases not discovered by CTest in my CMake build?

GoogleTest cases may not be discovered by CTest if CMake test discovery is not properly configured, requiring structured CTest integration to reliably run tests and report results.