cpp-testing

Configure GoogleTest/CTest workflows for modern C++ projects.

1|Updated Mar 18, 2026
One-click install
npx skills add https://github.com/ValenBorras/upscribe --skill cpp-testing-valenborras
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cpp-testing
Source: https://github.com/ValenBorras/upscribe/tree/main/.github/skills/cpp-testing
Command: npx skills add https://github.com/ValenBorras/upscribe --skill cpp-testing-valenborras

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides structured guidance for writing, updating, and diagnosing C++ tests, configuring GoogleTest/CTest, and ensuring robust test coverage and sanitizer usage.

Core Features & Use Cases

  • TDD workflow and test organization for modern C++ projects.
  • Guidance on configuring CMake/CTest workflows, test discovery, and CI integration.
  • Practical examples for unit tests, fixtures, and mocks using GoogleTest/GoogleMock.
  • Use cases include setting up tests for new features, debugging flaky tests, and adding sanitizers.

Quick Start

Set up a new C++ project with GoogleTest, configure CMake and CTest, and run the unit tests.

Frequently Asked Questions about cpp-testing

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

FAQPage Schema
How do I configure GoogleTest and CTest with CMake for a modern C++ project?

Configure GoogleTest and CTest by defining CMake targets and enabling test discovery, which structures your C++ testing workflow and allows you to run unit tests through CTest. This setup streamlines test execution and CI integration.

What is the best way to structure C++ unit tests using fixtures and mocks?

The best way to structure C++ unit tests is by using GoogleTest fixtures for shared setup and GoogleMock for creating mocks. This approach isolates dependencies and ensures robust test coverage for complex modern C++17/20 codebases.

How do I integrate sanitizers into my C++ testing workflow?

Integrate sanitizers into your C++ testing workflow by configuring specific compiler flags within your CMake build setup. This detects memory errors and undefined behavior during test execution, ensuring robust diagnostics for your GoogleTest suite.

Can I apply TDD workflows to existing C++17 and C++20 codebases?

Yes, you can apply TDD workflows to C++17 and C++20 codebases by following structured guidance for writing and updating tests. This ensures proper test organization and robust coverage when adding new features or debugging flaky tests.

Why does my CMake test discovery fail to find GoogleTest cases?

CMake test discovery fails when CTest configuration lacks proper target linking or test registration for GoogleTest. Ensure your CMake setup correctly integrates test discovery directives to expose and execute your unit tests properly.