Closed fknorr closed 8 months ago
Check-perf-impact results: (4c65f1399a47e0eb1340f63004745b17)
:question: No new benchmark data submitted. :question:
Please re-run the microbenchmarks and include the results if your commit could potentially affect performance.
I agree, finer control over which warnings to allow would be great in a follow-up PR!
I have created an issue about this.
This PR completely redefines how logging is handled inside unit tests.
It works by unconditionally capturing logs in the global thread-safe
test_utils::log_test_capture
. This allows the test code to query captured messages, and will echo the captured logs through a global Catch2 hook if the test fails. By default, this mechanism will fail any test that logs a warning or error, but it provides functions to relax that behavior either explicitly throughtest_utils::allow_max_log_level
or implicitly throughruntime_fixture
/device_queue_fixture
which permit system-dependent warnings to appear.The new mechanism is fully independent of the
CELERITY_LOG_LEVEL
environment, both in which messages it captures and also which ones it dumps in case of a test failure.Some refactorings and fixes happened alogn the way:
log_context
and its printing was unnecessarily complexutils::panic
independent of LOG_LEVEL when called from tests