cpp-testing

Automate C++ testing with GoogleTest and CMake, including coverage and sanitizers.

2|Updated Jun 30, 2026
One-click install
npx skills add https://github.com/Canhada-Labs/ceo-orchestration --skill cpp-testing-canhada-labs
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cpp-testing
Source: https://github.com/Canhada-Labs/ceo-orchestration/tree/main/.claude/skills/domains/cpp/skills/cpp-testing
Command: npx skills add https://github.com/Canhada-Labs/ceo-orchestration --skill cpp-testing-canhada-labs

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires gtest, gmock, cmake, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill automates the testing process for modern C++ applications, providing a structured workflow for unit and integration tests, ensuring quality and determinism in your development process.

Core Features & Use Cases

  • Automated Testing: Integrates with GoogleTest and CMake for automatic test discovery and execution.
  • Test Layout: Offers guidelines for organizing tests and test data for clarity and maintainability.
  • Coverage Collection: Enables the use of gcov, lcov, and llvm-cov for code coverage analysis.
  • Sanitizers: Utilizes AddressSanitizer, UBSan, and ThreadSanitizer to catch bugs during testing.
  • Use Case: For C++ developers aiming to create a suite of tests that are deterministic, isolated, and fast to iterate on, while also being honest under sanitizers.

Quick Start

Load the 'cpp-testing' skill and run tests for the 'example' project using CMake.

Frequently Asked Questions about cpp-testing

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

FAQPage Schema
How do I automate C++ testing with GoogleTest and CMake?

Automate C++ testing by integrating GoogleTest with CMake for automatic test discovery and execution. This approach structures unit and integration tests to ensure code quality and determinism throughout the development process.

What is the best way to collect code coverage for a C++ project?

Collect C++ code coverage by utilizing gcov, lcov, and llvm-cov alongside your testing workflow. This enables detailed analysis of which code paths are exercised by your GoogleTest suite.

Can I use AddressSanitizer and ThreadSanitizer with GoogleTest?

Yes, you can use AddressSanitizer, UBSan, and ThreadSanitizer with GoogleTest. Utilizing these sanitizers during test execution catches memory corruption, undefined behavior, and data races.

Do I need CMake to run GoogleTest in my C++ application?

CMake is required to build and run tests for your C++ application using this workflow. Along with GoogleTest and GoogleMock, CMake facilitates automatic test discovery and execution.

How should I organize test data and GoogleTest files for maintainability?

Organize GoogleTest files and test data by following structured layout guidelines for clarity. Proper test organization ensures your C++ test suites remain deterministic, isolated, and fast to iterate on.