erbsland-unit-test

Automate C++ unit test setup and execution with Erbsland Unit Test.

Updated Feb 17, 2026
One-click install
npx skills add https://github.com/erbsland-dev/skills --skill erbsland-unit-test
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: erbsland-unit-test
Source: https://github.com/erbsland-dev/skills/tree/main/erbsland-unit-test
Command: npx skills add https://github.com/erbsland-dev/skills --skill erbsland-unit-test

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

The Erbsland Unit Test Skill provides a cohesive pattern and entry point to define, organize, and execute C++ unit tests using the Erbsland Unit Test framework, reducing setup friction and ensuring consistent conventions across projects.

Core Features & Use Cases

  • Establishes a standard test suite layout, naming conventions (e.g., SomethingTest with testSomething methods), and macros (REQUIRE, CHECK, WITH_CONTEXT, runWithContext) for robust diagnostics.
  • Integrates with CMake using erbsland_unittest targets, enabling centralized test compilation, discovery, and filtered execution by name, target, or tag.
  • Includes documented patterns for modular test design, helper subclasses, and diagnostic output via additionalErrorMessages() to simplify debugging.

Quick Start

Create a new test file named SomethingTest.cpp, include the Erbsland Unit Test header, declare a final test class SomethingTest deriving from UNITTEST_SUBCLASS or el::UnitTest, implement at least one public test method starting with 'test', and run the unittest target.

Frequently Asked Questions about erbsland-unit-test

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

FAQPage Schema
How do I set up and run C++ unit tests with CMake?

C++ unit tests are organized into suites by naming classes *Test and deriving from el::UnitTest, then executed via the CMake erbsland_unittest target which supports filtering by name, target, and tag.

What macros are available for C++ unit test assertions and diagnostics?

The framework provides REQUIRE and CHECK for assertions, alongside WITH_CONTEXT and runWithContext to attach diagnostic context, and additionalErrorMessages() to output extra debugging details.

How do I filter which C++ unit tests execute by name or tag?

Test execution filtering by name, target, and tag is handled through the CMake erbsland_unittest target, allowing you to selectively run specific C++ unit test suites during development.

Does CMake work with the Erbsland Unit Test framework for C++ projects?

CMake works with the framework by defining erbsland_unittest targets that centralize C++ test compilation, discovery, and filtered execution by name, target, or tag across your project.

What is the standard naming convention for C++ unit test suites and methods?

C++ unit test suites must be named with a *Test suffix and derive from el::UnitTest or UNITTEST_SUBCLASS, containing public test methods that start with the 'test' prefix to ensure correct discovery.