cpp-testing

Create, update, and debug C++ tests with GoogleTest and CMake.

Updated Mar 2, 2026
One-click install
npx skills add https://github.com/unju-ai/ecc --skill cpp-testing-unju-ai
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cpp-testing
Source: https://github.com/unju-ai/ecc/tree/main/docs/ja-JP/skills/cpp-testing
Command: npx skills add https://github.com/unju-ai/ecc --skill cpp-testing-unju-ai

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill automates the creation, updating, and debugging of C++ tests, ensuring robust software quality and efficient development cycles.

Core Features & Use Cases

  • Test Generation & Modification: Write new C++ unit and integration tests or refactor existing ones.
  • Framework Integration: Configure GoogleTest/GoogleMock and CMake/CTest for seamless testing.
  • Debugging & Diagnostics: Identify and fix failing or flaky tests, and enable sanitizers for deeper issue detection.
  • Code Coverage: Implement and analyze test coverage reports.
  • Use Case: When developing a new C++ feature, use this Skill to write comprehensive unit tests, configure them in CMake, and ensure they pass before merging.

Quick Start

Use the cpp-testing skill to create a new unit test for the calculate_sum function in src/math.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 C++ unit tests using GoogleTest and configure them with CMake?

To write C++ unit tests using GoogleTest, you create test cases and configure CMake/CTest to build and execute them. This streamlines test generation and execution for robust software quality.

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

Debugging failing or flaky C++ tests involves identifying diagnostic issues and integrating sanitizers for deeper detection. This approach addresses test instability and enhances overall code quality.

Can I use GoogleMock for C++ integration testing alongside CTest?

Yes, you can use GoogleMock for C++ integration testing. Configuring GoogleMock with CMake/CTest ensures seamless test execution and diagnostics for both unit and integration tests.

How do I analyze code coverage reports for a C++ project?

Analyzing C++ code coverage involves implementing and generating reports based on your test suite. Configuring CMake and CTest helps produce detailed coverage diagnostics for your codebase.

Why should I integrate sanitizers when debugging C++ tests?

Integrating sanitizers when debugging C++ tests enables deeper issue detection beyond standard test failures. This helps identify memory errors and undefined behavior during test execution.