In PR #31901, Coverage.cpp was introduced as a separate utility file, based on existing code. However, the macro defined in Coverage.cpp was limited to Clang and Linux, which caused issues for users on macOS when using the newly introduced deterministic test tooling.
This change adds fallback functions which are used when building without code coverage on non linux env.
This adds support for macOS to ResetCoverageCounters. ResetCoverageCounters is used by the unit tests in g_rng_temp_path_init
to support the deterministic unit test tooling. It is also used in fuzz tests to completely suppress coverage from anything init-related.
See Readme on how to test this for deterministic unit & fuzz test.
Suggestion for test files:
- for unit test:
util_string_tests
- for fuzz test:
addition_overflow
These files should give deterministic results