cpp-testing

Automate C++ test setup and maintenance with GoogleTest and CTest.

3|Updated Mar 17, 2026
One-click install
npx skills add https://github.com/idiaz01/enterprise-superpowers --skill cpp-testing-idiaz01
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cpp-testing
Source: https://github.com/idiaz01/enterprise-superpowers/tree/main/content/skills/cpp-testing
Command: npx skills add https://github.com/idiaz01/enterprise-superpowers --skill cpp-testing-idiaz01

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

The skill helps teams write, configure, and maintain robust C++ tests using GoogleTest/CTest, ensuring consistent test execution across environments.

Core Features & Use Cases

  • TDD workflow guidance: red → green → refactor for C++ tests, with clear guidance on structuring tests, fixtures, and mocks.
  • GoogleTest/CTest integration: setup, discovery, fixtures, and CI-friendly test targets.
  • CI readiness & sanitizers: guidance for enabling sanitizers (ASan/UBSan/TSan) and test coverage in CI pipelines.

Quick Start

Initialize a new C++ test project by setting up GoogleTest/CTest in CMake and adding a starter test.

Frequently Asked Questions about cpp-testing

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

FAQPage Schema
How do I set up GoogleTest with CMake and CTest in a new C++ project?

GoogleTest integration with CMake involves configuring CTest for test discovery and establishing a clean layout with tests/unit and tests/integration directories to ensure consistent execution across environments.

What is the recommended directory layout for structuring C++ unit and integration tests?

A clean C++ test layout uses tests/unit and tests/integration directories to separate test scopes, enabling reliable GoogleTest discovery and consistent CMake integration across different execution environments.

How do I enable AddressSanitizer and UndefinedBehaviorSanitizer in a C++ CI pipeline?

Enabling sanitizers like ASan, UBSan, and TSan in a C++ CI pipeline requires configuring CMake build flags and CTest execution to instrument binaries and automatically report memory or undefined behavior issues.

Does this C++ testing workflow support Test Driven Development with fixtures and mocks?

The C++ testing workflow supports TDD by providing red, green, refactor guidance and clear instructions for structuring GoogleTest fixtures and mocks to ensure robust and maintainable test suites.

Can I generate test coverage reports when running GoogleTest in CI pipelines?

Generating test coverage reports involves configuring CMake builds with coverage flags and running GoogleTest through CTest, enabling CI pipelines to collect and report coverage metrics automatically.

What is the best way to automate C++ test discovery for CI pipelines using CTest?

Automating C++ test discovery is best achieved using CTest integrated with CMake to automatically register GoogleTest cases, creating CI-friendly test targets that execute consistently across different pipeline environments.