cpp-testing

Automate C++ test setup, execution, and validation with GoogleTest/CTest and CMake.

2|Updated Apr 5, 2026
One-click install
npx skills add https://github.com/mbadoz/mbadoz-skills --skill cpp-testing-mbadoz
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cpp-testing
Source: https://github.com/mbadoz/mbadoz-skills/tree/main/plugins/built-planner/skills/built-planner/references/skills/cpp-testing
Command: npx skills add https://github.com/mbadoz/mbadoz-skills --skill cpp-testing-mbadoz

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill helps engineers write, update, and diagnose C++ tests by simplifying the setup and integration of GoogleTest/CTest with CMake, enabling reliable test execution and coverage.

Core Features & Use Cases

  • Guidance on configuring GoogleTest/CTest with CMake/CTest workflows for reliable test discovery and execution.
  • Best practices for unit/integration test organization, mocks, and fixtures to support TDD and CI pipelines.
  • Strategies for enabling sanitizers and coverage to diagnose memory and performance issues across C++ projects.

Quick Start

Run the CMake/CTest quickstart to configure, build, and run 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 for C++ unit testing?

To configure GoogleTest with CMake, you use CTest for automated test discovery and execution. This skill streamlines CMake workflow setup to build and run deterministic C++ test suites across local and CI environments.

What's the best way to structure C++ tests for a TDD workflow?

Structuring C++ tests for TDD involves organizing unit and integration tests using mocks and fixtures. This skill provides best practices for test organization to support reliable TDD cycles and CI pipelines.

Can I integrate CTest into my existing CI pipelines for C++ projects?

Yes, you can integrate CTest into CI pipelines for C++17 and C++20 projects. This skill automates test execution and validation across CI pipelines and local environments to ensure deterministic test outcomes.

How do I enable sanitizers and coverage in a C++ testing workflow?

To enable sanitizers and coverage in C++ testing, you apply specific build configurations within your CMake setup. This skill provides strategies to diagnose memory and performance issues across C++ projects.

Why is CTest test discovery not working with my GoogleTest configuration?

CTest test discovery fails when CMake configurations are not properly linked to GoogleTest output. This skill helps diagnose C++ tests by simplifying CMake and CTest integration for reliable test discovery.