Per-DLL Test Registry and Public Runner API for Catch2

Open
#3,018 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 2 days

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Tech stack
cpp
Domain
testing-qa

Research direction

Start by mapping Catch2's current process-wide test registry, DLL loading behavior, and private APIs used to enumerate and run tests. Define the public registry and runner boundaries, then verify that separate test DLLs can be loaded and executed in isolation while supporting a custom runner.

Written by the indexing model from the issue text.

Description

Description

Currently, Catch2 can be built as a DLL, but building test modules as DLLs (rather than executables) and running them via a custom test runner is difficult due to the following limitations:

  • The test registry is global to the process. When Catch2 is linked dynamically, all loaded test DLLs share the same registry, causing all tests to be registered together and making isolation impossible.
  • To run tests programmatically, one must use private APIs, which are undocumented and subject to change.

Feature Request

  • Provide a way to define the test registry in a specific location (e.g., within each test DLL or the test runner), rather than always in Catch2.dll.
  • Expose a public API to enumerate and run individual tests from a registry, enabling custom runners to load and execute tests from multiple DLLs in isolation.

Additional Context

This feature would enable large projects to reduce binary size by sharing a single Catch2 DLL, and allow integration with other test harnesses (e.g., Python's unittest or pytest) by wrapping Catch2 tests. It would also facilitate advanced workflows, such as running tests in-process with custom UI or helpers.

Dominant language
C++
Stars
21.6k
Forks
3.4k
Avg merge
3d 12h
Merged PRs (30d)
5

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from catchorg/Catch2

All issues in catchorg/Catch2

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.