cpp-testing

Configure GoogleTest and CMake workflows for C++ test development.

4|Updated Feb 14, 2026
One-click install
npx skills add https://github.com/KuaaMU/omnihive --skill cpp-testing-kuaamu
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cpp-testing
Source: https://github.com/KuaaMU/omnihive/tree/main/library/ecc-skills/cpp-testing
Command: npx skills add https://github.com/KuaaMU/omnihive --skill cpp-testing-kuaamu

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (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 for C++ code.
  • Configuration: Set up GoogleTest/GoogleMock and CMake/CTest workflows.
  • Debugging: Diagnose and fix failing or flaky tests.
  • Coverage & Sanitizers: Integrate code coverage and memory/thread sanitizers.
  • 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 correctly with your CMake build system.

Quick Start

Use the cpp-testing skill to write a new unit test 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 a unit test for a C++ function using GoogleTest?

To write a unit test for a C++ function using GoogleTest, you create test fixtures and assertions to verify behavior, integrating them directly into your CMake build system for automated execution.

How do I configure CMake and CTest for C++ test execution?

Configuring CMake and CTest for C++ test execution involves adding GoogleTest discovery scripts to your CMakeLists.txt, enabling automated test registration and execution within your build pipeline.

Does GoogleMock work with GoogleTest for mocking C++ dependencies?

GoogleMock works seamlessly with GoogleTest to mock C++ dependencies, allowing you to isolate units under test and avoid reliance on real-time dependencies or improper mocking.

What's the best way to generate code coverage reports for C++ with gcov and llvm-cov?

The best way to generate code coverage reports for C++ is by compiling with coverage flags and utilizing tools like gcov, lcov, or llvm-cov to produce detailed coverage metrics.

How do I integrate AddressSanitizer and UBSan into a C++ testing workflow?

You integrate AddressSanitizer and UBSan into a C++ testing workflow by enabling specific compiler flags, which allows the sanitizers to detect memory errors and undefined behavior during test execution.

Why are my C++ tests flaky and how do I fix them?

Flaky C++ tests often stem from reliance on real-time dependencies or improper mocking; fixing them involves isolating test cases using GoogleMock and removing non-deterministic behavior.