cpp-testing

Optimize C++ test workflows with GoogleTest/CTest and CMake.

1|Updated Mar 19, 2026
One-click install
npx skills add https://github.com/devs6186/claude-private-skills-agents-commands --skill cpp-testing-devs6186
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cpp-testing
Source: https://github.com/devs6186/claude-private-skills-agents-commands/tree/main/skills/cpp-testing
Command: npx skills add https://github.com/devs6186/claude-private-skills-agents-commands --skill cpp-testing-devs6186

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill is designed to streamline and standardize C++ testing workflows by guiding users through writing, updating, and diagnosing tests with GoogleTest/GoogleMock and CMake/CTest, improving reliability, coverage, and debugging efficiency.

Core Features & Use Cases

  • Test organization: explains how to structure tests into unit, integration, and testdata layouts and how to apply the TDD loop.
  • CI and discovery: demonstrates GoogleTest discovery, CTest integration, and sanitizer/coverage configurations for robust pipelines.
  • Practical examples: provides representative test snippets, fixtures, mocks, and sample projects to illustrate best practices.

Quick Start

Run the GoogleTest/CTest workflow to execute the test suite for your C++ project.

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 my C++ project?

Setting up GoogleTest with CMake and CTest involves structuring tests into unit, integration, and testdata directories, configuring CTest integration, and enabling GoogleTest discovery to execute your C++ test suite efficiently.

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

The recommended C++ test layout structures code into tests/unit, tests/integration, and tests/testdata directories, ensuring proper test organization and supporting the TDD loop to improve coverage and debugging efficiency.

How do I configure sanitizers and coverage analysis for a C++ CTest workflow?

Configuring sanitizers and coverage analysis in a C++ CTest workflow involves applying sanitizer and coverage configurations within CMake, enabling robust CI pipelines to run unit, integration tests, and coverage analysis reliably.

Does this GoogleTest workflow support GoogleMock for writing C++ test fixtures?

Yes, this GoogleTest workflow supports GoogleMock, providing representative test snippets, fixtures, and mocks to illustrate best practices for writing, updating, and diagnosing C++ tests with GoogleTest and GoogleMock.

Can I integrate CMake GoogleTest discovery into my existing CI pipelines?

Yes, you can integrate CMake GoogleTest discovery into CI pipelines by configuring CTest integration and sanitizer settings, demonstrating robust pipeline configurations to run unit tests, integration tests, and coverage analysis automatically.

Why is my GoogleTest discovery not working with CTest in CMake?

GoogleTest discovery failures with CTest often stem from improper test layouts or missing CTest integration configurations, so ensuring proper directory structure and correct CMake setup helps streamline and diagnose C++ testing workflows.