cpp-testing

Develop, configure, and debug C++ tests with GoogleTest and CTest.

Updated Feb 13, 2026
One-click install
npx skills add https://github.com/LiamVDB1/opencode-config --skill cpp-testing-liamvdb1
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cpp-testing
Source: https://github.com/LiamVDB1/opencode-config/tree/main/skills/cpp-testing
Command: npx skills add https://github.com/LiamVDB1/opencode-config --skill cpp-testing-liamvdb1

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) and assets (resource) components.

What problem does it solve?

This Skill streamlines the process of writing, configuring, and debugging C++ tests, ensuring robust and reliable software development.

Core Features & Use Cases

  • Test Development: Write new unit and integration tests, or fix existing ones.
  • Configuration: Set up CMake/CTest for consistent test execution.
  • Debugging: Diagnose and resolve failing or flaky tests.
  • Coverage & Sanitizers: Integrate code coverage and sanitizers for enhanced quality.
  • Use Case: You've just implemented a new feature in your C++ application and need to write comprehensive unit tests for it using GoogleTest, ensuring it integrates seamlessly with your CMake build system.

Quick Start

Use the cpp-testing skill to write a new GoogleTest for the Add function in src/add.cpp.

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 a C++ project using CMake?

GoogleTest unit tests for a C++ project can be written and configured using CMake and CTest. This process ensures new tests for C++17/20 codebases are developed, executed, and debugged consistently within the build system.

What is the best way to configure CTest to run GoogleTest suites?

Configuring CTest to run GoogleTest suites involves setting up the CMake build system for consistent test execution. This allows developers to diagnose failures, fix flaky tests, and ensure reliable test runs across C++17/20 projects.

How do I integrate code coverage and sanitizers into a C++ testing workflow?

Code coverage and sanitizers are integrated into a C++ testing workflow by configuring them alongside GoogleTest and CTest. This enhances quality by identifying untested code paths and diagnosing memory or undefined behavior issues during test execution.

Why does my GoogleTest fail when integrated with CMake, and how do I debug it?

Debugging a failing GoogleTest integrated with CMake involves diagnosing the test execution and configuration. The process targets flaky or failing tests in C++17/20 projects, resolving issues within the CMake build system to ensure reliable execution.

Can I use GoogleTest and CTest for C++17 or C++20 projects?

GoogleTest and CTest can be used for C++17 and C++20 projects. The setup supports writing new unit and integration tests, fixing existing ones, and configuring the CMake build system for these specific C++ standard versions.