cpp-testing

Write and debug C++ tests using GoogleTest, GoogleMock, CMake, and CTest.

3|Updated Feb 8, 2026
One-click install
npx skills add https://github.com/Nixdorfer/ClaudeCodeTool --skill cpp-testing-nixdorfer
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cpp-testing
Source: https://github.com/Nixdorfer/ClaudeCodeTool/tree/main/plugins/cache/everything-claude-code/everything-claude-code/1.4.1/skills/cpp-testing
Command: npx skills add https://github.com/Nixdorfer/ClaudeCodeTool --skill cpp-testing-nixdorfer

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill streamlines the process of writing, debugging, and maintaining tests for C++ projects, ensuring code quality and reliability.

Core Features & Use Cases

  • Test Development: Write new C++ tests or fix existing ones using GoogleTest/GoogleMock.
  • Configuration: Set up CMake/CTest for consistent test execution and integrate coverage and sanitizers.
  • Debugging: Diagnose and resolve failing or flaky tests efficiently.
  • Use Case: When you need to add unit tests for a new C++ feature, ensure they integrate with your CMake build, and run them with coverage enabled.

Quick Start

Use the cpp-testing skill to write a new GoogleTest for the calculate_sum function in src/calculator.cpp.

Frequently Asked Questions about cpp-testing

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

FAQPage Schema
How do I write GoogleTest unit tests for a new C++ feature?

To write C++ unit tests, you create test cases and assertions using GoogleTest, define mock objects with GoogleMock, and configure the execution environment using CMake and CTest to verify feature functionality.

How do I integrate CMake and CTest for consistent C++ test execution?

Integrating CMake and CTest for C++ test execution involves configuring your CMakeLists.txt to discover and register GoogleTest binaries, enabling automated test running, coverage tracking, and sanitizer integration within your build pipelines.

What is the best way to diagnose flaky or failing C++ tests?

Diagnosing flaky or failing C++ tests is best handled by using sanitizers to detect memory errors and race conditions, alongside analyzing code coverage reports to identify untested execution paths causing inconsistent test behavior.

Can I set up TDD workflows for C++ projects using GoogleMock?

You can set up TDD workflows for C++ projects by utilizing GoogleMock to create mock objects for dependencies, allowing you to define interfaces and write fixture-based tests before implementing the actual application logic.

How do I enable code coverage and sanitizers in my C++ CI/CD pipeline?

To enable code coverage and sanitizers in a C++ CI/CD pipeline, you configure CMake build flags to compile with sanitizer instrumentation and coverage mapping, then use CTest to execute tests and generate reports for analysis.