awesome-repositories.com
Blog
MCP
awesome-repositories.com

Discover the best open-source repositories with AI-powered search.

ExploreCurated searchesOpen-source alternativesSelf-hosted softwareBlogSitemap
ProjectMCP serverAboutHow we rankPress
LegalPrivacyTerms
© 2026 Bringes Technology SRL·VAT RO45896025·hello@awesome-repositories.com
doctest avatar

doctest/doctest

0
View on GitHub↗
6,765 stars·691 forks·C++·MIT·21 viewsbit.ly/doctest-docs↗

Doctest

doctest is a lightweight C++ unit testing framework and assertion library. It provides a single-header implementation that eliminates complex build dependencies, allowing developers to write and execute test cases directly within their source code.

The framework is distinguished by its focus on compile-time performance and binary overhead. It uses conditional compilation guards to strip all testing logic and metadata from production binaries. Additionally, it features hierarchical subcases that re-execute parent setup code to isolate different execution paths within a single test case.

Its capability surface includes a thread-safe test runner with support for parameterized tests, test suites, and custom reporters. It provides specialized tools for validating expressions, comparing floating point values, and verifying exception behavior. The system also integrates with build tools such as CMake and Bazel.

The entire framework is provided as a single-header library to simplify integration.

Features

  • Single-File Framework Distributions - Distributed as a single-header library to eliminate complex build dependencies and simplify project integration.
  • Unit Testing Frameworks - Provides a fast, thread-safe runner to execute automated unit tests and verify code correctness.
  • Testing Logic Stripping - Allows stripping all testing logic and metadata from production binaries via configuration flags.
  • Header-Only Libraries - Supplies a single-header implementation to eliminate complex build dependencies and simplify project integration.
  • Compile-Time Optimization - Minimizes compilation overhead and binary size by streamlining expression decomposition and stripping metadata.
  • Hierarchical Subcases - Implements hierarchical subcases that re-execute parent setup code to isolate different execution paths within a single test.
  • Assertion Libraries - Ships a set of thread-safe macros for validating boolean expressions and capturing variable states during runtime failures.
  • Expression Decomposition - Evaluates boolean expressions and prints expanded variable values upon failure to simplify debugging.
  • Test Grouping Utilities - Provides nested subcases to group related assertions and share setup code within a single test case.
  • Expression Decomposition - Evaluates boolean expressions and automatically prints the expanded values of variables upon failure to simplify debugging.
  • Test Case Definitions - Supports creating named units of execution using standard or BDD-style scenario syntax.
  • Test Execution Runners - Provides a thread-safe execution engine for filtering, running, and reporting the results of test suites.
  • Test Discovery Mechanisms - Automatically identifies and registers test cases using static initialization, removing the need for manual test lists.
  • Test Execution Filtering - Includes a powerful filtering system to select specific test cases or suites using wildcard patterns.
  • Hierarchical Suite Grouping - Implements hierarchical subcases that re-execute parent setup code for granular shared state management.
  • Automatic Test Discovery - Automatically collects and tracks test cases using static initialization to eliminate manual registration lists.
  • Nested Setup Nodes - Implements hierarchical subcases that re-execute parent setup code to isolate different execution paths.
  • Thread-Safe Assertions - Provides a thread-safe assertion library for verifying runtime logic outside of standard test cases.
  • Build System Integration - Integrates test execution and discovery into build systems like CMake and Bazel to automate verification.
  • Command Line Configuration - Allows the configuration of test execution options and behavior via command-line flags or code overrides.
  • Test Logging Utilities - Captures expressions lazily and prints them only upon subsequent assertion failure to provide diagnostic context.
  • Test Integration - Enables test cases to be embedded within header files using conditional guards to minimize compilation overhead.
  • Compilation Speed Optimizations - Decreases compilation overhead by utilizing streamlined machinery that avoids complex expression decomposition.
  • Exception-Free Configurations - Operate without using exceptions to meet strict environment constraints or performance requirements.
  • Binary Test Stripping - Strips all testing logic and metadata from production binaries using conditional compilation guards to eliminate overhead.
  • Conditional Compilation Utilities - Uses preprocessor macros to toggle the inclusion of testing logic and metadata during the build process.
  • Exception Support Configurations - Supports environments where exceptions are disabled by allowing the removal of try-catch blocks and the exception system.
  • Exception Verification - Verifies that specific code paths throw expected exception types or contain specific error messages.
  • Thread-Safe Registries - Uses atomic operations and mutexes to allow safe test registration and execution across concurrent threads.
  • Compilation Performance Optimizations - Reduces compile times by converting complex assertion macros into single function calls.
  • Concurrent Assertion Validation - Allows assertion and logging macros to be called safely from multiple threads to verify concurrent behavior.
  • Concurrent Software Testing - Provides a thread-safe environment for verifying concurrent behavior in C++ software.
  • Test Execution Overrides - Allows configuring test execution options, such as failure limits and filters, via code or command-line.
  • Custom Failure Messaging - Provides detailed diagnostic messages by capturing local variables and strings during assertion failures.
  • Test Reporters - Implements an extensible reporter system and event listeners to format and deliver test outcomes.
  • Result Formatters - Enables exporting test results into various formats, including console text and XML, for external analysis.
  • Test Result Reporters - Provides a pluggable event listener model to format and route test results to various output sinks.
  • Test Execution Controls - Provides control over test flow by distinguishing between non-fatal assertions and fatal requirements.
  • Test Parameterization - Enables executing the same test logic multiple times using different types or generated sets of values.
  • Type-Parameterized Tests - Allows executing the same test logic across different data types to verify multiple implementations satisfy a common interface.
  • Parallel Test Execution - Supports executing test cases and assertions across multiple threads for verifying multi-threaded behavior.
  • Expression Decomposition - Decomposes assertions into string representations only upon failure to improve performance and provide detailed diagnostics.
  • Test Metadata - Allows attaching metadata to tests to control execution timeouts, expected failure counts, or skip status.
  • Embedded Test Runners - Allows integrating a test runner within a functional application to execute tests alongside production logic.
  • Test Fixture Systems - Implements fixture systems using classes or structures to share member variables and methods across multiple tests.
  • Cross-Binary Registry Sharing - Enables multiple binaries to contribute to a single test summary by sharing the test registry via a shared library.
  • Test Suite Organization - Provides mechanisms to organize test cases into named suites for bulk execution and command-line filtering.
  • Developer Tools - Fast, feature-rich testing framework

Star history

Star history chart for doctest/doctestStar history chart for doctest/doctest

How this analysis was created: This summary and feature list were written by an AI model that read the project's README and public documentation pages. Each feature links to the documentation it came from; stars, license and language come straight from the GitHub API. The model does not read the source code, and the analysis is refreshed when the project is re-analysed. Learn more on our About page.

AI search

Explore more awesome repositories

Describe what you need in plain English — the AI ranks thousands of curated open-source projects by relevance.

Start searching with AI

Open-source alternatives to Doctest

Similar open-source projects, ranked by how many features they share with Doctest.
  • onqtam/doctestonqtam avatar

    onqtam/doctest

    6,768View on GitHub↗

    doctest is a unit testing framework and assertion library for C++ delivered as a single-header library. It provides a test runner with a command line interface to execute tests, filter test suites, and generate execution reports. The framework supports in-source unit testing and allows for the complete removal of testing logic from compiled binaries via preprocessor stripping to eliminate performance overhead in production environments. It also enables cross-binary test registry sharing, allowing one executable to utilize the test runner of another. Capabilities include parameterized testing

    C++
    View on GitHub↗6,768
  • nextest-rs/nextestnextest-rs avatar

    nextest-rs/nextest

    2,828View on GitHub↗

    nextest is a high-performance test execution framework and Rust test runner designed to manage parallelism, retries, and timeouts. It serves as a test recording system that captures execution metadata and outputs into archives for later failure analysis and replay. The project distinguishes itself as a flakiness detection tool, identifying unstable tests through stress loops and automated retry policies. It also functions as a CI test orchestrator, capable of partitioning test suites across multiple workers and exporting results in standardized JUnit XML and JSON formats. The framework provi

    Rustcargo-plugincargo-subcommandflaky-tests
    View on GitHub↗2,828
  • thomhurst/tunitthomhurst avatar

    thomhurst/TUnit

    3,744View on GitHub↗

    TUnit is a comprehensive C# testing framework, mocking library, and fluent assertion tool. It utilizes source generation for test discovery and mock creation, ensuring compatibility with Native AOT and IL trimming by eliminating the need for runtime reflection and proxies. The framework provides specialized capabilities for integration testing, including the management of distributed application lifecycles, isolated database schemas, and the correlation of telemetry and logs across process boundaries via OTLP. It also includes an HTTP testing utility to intercept network exchanges and mock AP

    C#csharpdotnettest
    View on GitHub↗3,744
  • onsi/ginkgoonsi avatar

    onsi/ginkgo

    9,014View on GitHub↗

    Ginkgo is a behavior-driven development testing framework, assertion library, and test runner for Go. It provides a domain-specific language for writing human-readable specifications, organizing tests into hierarchical containers and subjects to describe system behavior. The project distinguishes itself through advanced execution control and observability, featuring a test runner capable of parallel distribution, sharding, and randomized execution order to detect flaky tests. It includes specialized diagnostic tools for goroutine leak detection, hanging spec monitoring, and failure state debu

    Go
    View on GitHub↗9,014
See all 30 alternatives to Doctest→

Frequently asked questions

What does doctest/doctest do?

doctest is a lightweight C++ unit testing framework and assertion library. It provides a single-header implementation that eliminates complex build dependencies, allowing developers to write and execute test cases directly within their source code.

What are the main features of doctest/doctest?

The main features of doctest/doctest are: Single-File Framework Distributions, Unit Testing Frameworks, Testing Logic Stripping, Header-Only Libraries, Compile-Time Optimization, Hierarchical Subcases, Assertion Libraries, Expression Decomposition.

What are some open-source alternatives to doctest/doctest?

Open-source alternatives to doctest/doctest include: onqtam/doctest — doctest is a unit testing framework and assertion library for C++ delivered as a single-header library. It provides a… nextest-rs/nextest — nextest is a high-performance test execution framework and Rust test runner designed to manage parallelism, retries,… thomhurst/tunit — TUnit is a comprehensive C# testing framework, mocking library, and fluent assertion tool. It utilizes source… onsi/ginkgo — Ginkgo is a behavior-driven development testing framework, assertion library, and test runner for Go. It provides a… philsquared/catch — Catch is a C++ testing toolset providing frameworks for unit testing, behavior-driven development, and… jasmine/jasmine — Jasmine is a JavaScript testing framework and test runner designed for behavior-driven development. It provides a…