cpp-testing

Configure C++ testing with GoogleTest, CMake, CTest, sanitizers, and coverage.

1|Updated Feb 22, 2026
One-click install
npx skills add https://github.com/TakMczk/copilot-cli-ecc --skill cpp-testing-takmczk
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cpp-testing
Source: https://github.com/TakMczk/copilot-cli-ecc/tree/main/.github/skills/cpp-testing
Command: npx skills add https://github.com/TakMczk/copilot-cli-ecc --skill cpp-testing-takmczk

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill streamlines the process of writing, configuring, and debugging tests for C++ projects, ensuring robust and reliable code through modern testing practices.

Core Features & Use Cases

  • Test Development: Write new unit and integration tests using GoogleTest/GoogleMock.
  • CI/CD Integration: Configure CMake and CTest for consistent test execution and coverage reporting.
  • Debugging: Diagnose and fix failing or flaky tests efficiently.
  • Sanitizers & Coverage: Enable AddressSanitizer, UndefinedBehaviorSanitizer, ThreadSanitizer, and code coverage.

Quick Start

Use the cpp-testing skill to write 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 write a GoogleTest for a specific C++ function?

To write a GoogleTest for a C++ function, you create test cases using assertions and fixtures to verify behavior. This Skill guides writing unit and integration tests using GoogleTest and GoogleMock for modern C++.

How do I configure CMake and CTest for consistent test execution?

You configure CMake and CTest by adding test discovery directives to your CMakeLists.txt file. This Skill streamlines CI/CD integration to ensure consistent test execution and automated coverage reporting across your C++ project.

How do I enable AddressSanitizer and UndefinedBehaviorSanitizer in C++?

Enable AddressSanitizer and UndefinedBehaviorSanitizer by adding specific compiler flags to your CMake configuration. This Skill addresses challenges in configuring sanitizers like ASan, UBSan, and TSan for robust debugging.

What is the best way to generate C++ code coverage reports with lcov or llvm-cov?

Generating C++ code coverage reports involves compiling with coverage flags and processing output with lcov or llvm-cov. This Skill optimizes workflows to generate comprehensive coverage reports for GoogleTest suites.

Why are my C++ tests flaky and how do I fix them?

Flaky C++ tests usually stem from race conditions or non-deterministic execution order. This Skill diagnoses and fixes failing tests by optimizing for deterministic test execution and using ThreadSanitizer.

Does this approach support mocking for C++ integration tests?

Yes, mocking is fully supported for C++ integration tests. This Skill facilitates comprehensive test workflows using GoogleMock to isolate dependencies and ensure reliable code behavior.