cpp-testing

Manage C++ GoogleTest/GoogleMock workflows with CMake/CTest, including debugging, sanitizers, and coverage reports.

3|1|Updated Mar 4, 2026
One-click install
npx skills add https://github.com/oabdelmaksoud/AGI-FARM-PLUGIN --skill cpp-testing-oabdelmaksoud
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cpp-testing
Source: https://github.com/oabdelmaksoud/AGI-FARM-PLUGIN/tree/main/ecc-resources/docs/ja-JP/skills/cpp-testing
Command: npx skills add https://github.com/oabdelmaksoud/AGI-FARM-PLUGIN --skill cpp-testing-oabdelmaksoud

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill streamlines the creation, updating, and debugging of C++ tests, ensuring robust software quality through effective unit and integration testing practices.

Core Features & Use Cases

  • Test Creation & Modification: Write new C++ unit and integration tests or refactor existing ones.
  • Framework Integration: Configure GoogleTest/GoogleMock with CMake/CTest for seamless testing workflows.
  • Debugging & Diagnostics: Diagnose failing or flaky tests and enable sanitizers (AddressSanitizer, UndefinedBehaviorSanitizer, ThreadSanitizer) for deeper insights.
  • Code Coverage: Implement and generate code coverage reports using gcov/lcov or llvm-cov.
  • Use Case: When developing a new C++ feature, use this Skill to write comprehensive unit tests using GoogleTest, configure CMake to build and run them, and ensure high code coverage.

Quick Start

Use the cpp-testing skill to create a new GoogleTest for the calculate_average function in src/stats.cpp.

Frequently Asked Questions about cpp-testing

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

FAQPage Schema
How do I generate C++ code coverage reports with gcov or llvm-cov?

Generate C++ code coverage reports by configuring gcov/lcov or llvm-cov within your build system. This process instruments your compiled tests to collect execution data and produce detailed coverage metrics.

Can I use AddressSanitizer and ThreadSanitizer to debug flaky C++ tests?

Yes, you can enable AddressSanitizer, ThreadSanitizer, or UndefinedBehaviorSanitizer during test builds. These sanitizers diagnose memory errors and thread data races that cause failing or flaky C++ tests.

What is the best way to mock dependencies in C++ integration tests?

The best way to mock dependencies in C++ integration tests is using the GoogleMock framework. It allows you to create mock objects and define expectations to isolate components under test.

How does CTest discover and run GoogleTest binaries in a CI pipeline?

CTest discovers GoogleTest binaries by parsing test lists generated during CMake configuration. It executes these tests automatically, making the results available for continuous integration pipeline reporting.