Snaipe / Criterion

A cross-platform C and C++ unit testing framework for the 21st century
MIT License
1.94k stars 176 forks source link

How to use Criterion tests with code coverage? #498

Closed rjzak closed 1 year ago

rjzak commented 1 year ago

I have a project which successfully uses Criterion to run a few unit tests. However, adding -fprofile-arcs -ftest-coverage to the compilation arguments generates a binary which has this error at runtime:

criterion: Re-entering criterion from a test worker. This is a catastrophic bug, please report it on the issue tracker.
Bailing out to avoid fork-bombing the system.
criterion: Could not spawn test instance: Protocol error
Aborted

Compiler: gcc 10.2.1 Distro: Debian 11.7 Arch: ARM64 Criterion: 2.3.3 (from the Debian repo)

I see that this is a minor version behind, maybe this has been addressed, or maybe I'm missing something?

Snaipe commented 1 year ago

This is a bug in the Debian packaging of Criterion; https://bugs.launchpad.net/ubuntu/+source/criterion/+bug/2018156 tracks it.

rjzak commented 1 year ago

Closing, since it's a Debian packaging bug as @Snaipe stated above.