cpp-testing

Generate and configure C++ GoogleTest/CMake/CTest workflows including fixes and sanitizers.

7|Updated Apr 7, 2026
One-click install
npx skills add https://github.com/chenziyang110/spec-kit-plus --skill cpp-testing-chenziyang110
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cpp-testing
Source: https://github.com/chenziyang110/spec-kit-plus/tree/main/templates/passive-skills/cpp-testing
Command: npx skills add https://github.com/chenziyang110/spec-kit-plus --skill cpp-testing-chenziyang110

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you add and debug C++ test coverage so failures are diagnosed quickly and your project stays protected against regressions.

Core Features & Use Cases

  • GoogleTest/GoogleMock test creation: Write unit and integration tests with appropriate mocks and fakes.
  • CMake/CTest integration: Ensure tests are discoverable and runnable consistently via CTest.
  • Flakiness and sanitizer support: Investigate failing or flaky tests and enable ASan/UBSan/TSan when needed.

Quick Start

Ask your agent to: "Write GoogleTest/CMake/CTest tests for the C++ components in src and make sure the tests catch the reported bug, then suggest sanitizer settings if the failure could be memory- or UB-related."

Frequently Asked Questions about cpp-testing

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

FAQPage Schema
How do I write GoogleTest unit tests for C++ components using CMake and CTest?

GoogleTest unit tests for C++ components are generated and configured using CMake and CTest, ensuring tests are discoverable, runnable, and cover happy paths, boundaries, and error cases with GoogleMock.

Why does my C++ test fail intermittently and how can sanitizers help diagnose flaky behavior?

Sanitizers like ASan, UBasan, and TSan help diagnose flaky C++ test behavior by detecting memory errors and concurrency issues, ensuring tests remain deterministic and isolated during ctest execution.

Can I use this to fix broken C++ tests and improve test coverage?

Broken C++ tests can be fixed and test coverage improved by diagnosing failures, designing careful test cases for boundaries and errors, and verifying fixes by compiling and running via ctest.

What's the best way to enable Address Sanitizer for C++ GoogleTest projects?

Address Sanitizer is suggested for C++ GoogleTest projects when failures could be memory-related, configuring the build to detect memory issues during ctest verification for robust regression protection.

Does this approach require an existing CMake test framework setup before generating tests?

An existing CMake test framework setup is detected to ensure proper integration, allowing the generation of GoogleTest and GoogleMock configurations that compile and run consistently via CTest.