cpp-testing

Automate C++ test maintenance and validation with GoogleTest/CTest.

Updated Apr 17, 2026
One-click install
npx skills add https://github.com/ccstudentcc/agent-prompts --skill cpp-testing-ccstudentcc
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cpp-testing
Source: https://github.com/ccstudentcc/agent-prompts/tree/main/.codex/skills/cpp-testing
Command: npx skills add https://github.com/ccstudentcc/agent-prompts --skill cpp-testing-ccstudentcc

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

这个技能帮助你高效编写、更新和修复C++测试,配置测试框架(如 GoogleTest/CTest),诊断失败或不稳定的测试,以及在需要时添加覆盖率/静默器。

Core Features & Use Cases

  • 提供清晰的测试工作流:从单元测试到集成测试的设计和执行。
  • 配置与调试:帮助设置 GoogleTest/CTest、CMake/CTest 工作流,定位失败原因。
  • 覆盖率与健壮性提升:支持覆盖率收集和容错诊断,提升测试稳定性和回归保护。

Quick Start

使用本技能快速启动并运行一个示例测试用例。

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 for a modern C++ project?

You can configure GoogleTest and CTest for a modern C++ project by setting up CMake workflows that integrate test execution and ensure deterministic runs across your build environment.

Why does my C++ unit test fail intermittently in CI and how can I diagnose it?

Intermittent C++ unit test failures in CI can be diagnosed by applying robust error handling and validating test configurations to ensure deterministic test runs and eliminate flaky behavior.

What is the best way to add sanitizer and coverage configuration to C++ tests?

The best way to add sanitizer and coverage configuration is to integrate them directly into your CMake and CTest workflow, enabling automated validation and robust regression protection during test execution.

Does this C++ testing approach support both unit and integration test workflows?

Yes, this C++ testing approach supports both unit and integration test workflows, providing a clear testing pipeline from initial test design through final execution and failure diagnosis.

How do I troubleshoot non-deterministic CTest results in my C++ build?

Troubleshoot non-deterministic CTest results by validating your CMake configuration and applying robust error handling to ensure your C++ tests run deterministically across different environments.