snitch-org / snitch

Lightweight C++20 testing framework.
Boost Software License 1.0
252 stars 7 forks source link

`REGISTER_REPORTER` for reporter classes uses global state #171

Closed cschreib closed 1 month ago

cschreib commented 2 months ago

The REGISTER_REPORTER macro, which is used to register a reporter class into the main test registry, uses global state for the reporter instance. This is usually fine, since there is normally only one registry anyway, but it is uncomfortable. Ideally, the registry itself would own the reporter instance. This would prevent any risk of accidental sharing of state between registry instances.

cschreib commented 1 month ago

Completed in https://github.com/snitch-org/snitch/pull/172