cpp-testing

Write, update, and diagnose C++ tests with GoogleTest and CTest.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/robinxin/AIFlomo --skill cpp-testing-robinxin
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cpp-testing
Source: https://github.com/robinxin/AIFlomo/tree/main/.claude/skills/cpp-testing
Command: npx skills add https://github.com/robinxin/AIFlomo --skill cpp-testing-robinxin

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides a structured approach to testing C++ projects by guiding teams to write, update, and diagnose tests using GoogleTest/GoogleMock with CMake/CTest, enabling reliable test coverage and robust CI workflows.

Core Features & Use Cases

  • Writing new C++ tests and fixing existing ones; configuring CMake/CTest workflows; enabling sanitizers and coverage; diagnosing flaky tests in modern C++ (C++17/20).
  • Use Case: A project needs consistent unit and integration tests, stable CI gating, and memory/race detection; this Skill provides a workflow and practical examples to implement it.

Quick Start

Run the C++ test suite locally with CMake/CTest and GoogleTest to validate changes and iteratively fix failures, enabling sanitizers and coverage as you go.

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 with CMake and CTest for C++ projects?

Setting up GoogleTest with CMake and CTest involves configuring CMakeLists.txt to discover and register tests, enabling automated execution and CI gating for C++17/20 codebases.

How do I enable sanitizers and coverage in a C++ CTest workflow?

Enabling sanitizers and coverage in a C++ CTest workflow requires configuring compiler flags for memory and race detection alongside coverage instrumentation, ensuring robust CI workflows and reliable test execution.

Does this testing approach support C++17 and C++20 codebases?

Yes, this testing approach explicitly supports modern C++17 and C++20 codebases, providing structured workflows for writing, updating, and diagnosing tests using GoogleTest and GoogleMock within CMake environments.

Why does my C++ test suite fail in CI but pass locally?

C++ test suites may fail in CI due to flaky tests or undetected data races; diagnosing flaky tests with sanitizers and coverage tooling helps identify environment-specific memory issues not visible during local execution.

What is the best way to diagnose flaky tests in modern C++?

The best way to diagnose flaky tests in modern C++ is by enabling sanitizers and coverage tooling within your CTest workflow, allowing iterative local runs to detect memory leaks and race conditions.