0.1.0-0-pre.4

This commit is contained in:
2026-09-16 01:01:09 +02:00
parent 2c79a05dd6
commit dc22011997
38 changed files with 540 additions and 131 deletions

View File

@@ -0,0 +1,13 @@
// file: crates/common/game-logging-lib/src/test_support.rs
// version: 1
/// Executes one test body with a thread-local tracing subscriber configured for the Rust test writer.
pub fn with_test_tracing<T>(test_name: &str, operation: impl FnOnce() -> T) -> T {
let subscriber = tracing_subscriber::fmt().with_target(true).with_test_writer().without_time().finish();
return tracing::subscriber::with_default(subscriber, || {
tracing::debug!(test_name = test_name, "test started");
let result = operation();
tracing::debug!(test_name = test_name, "test completed");
return result;
});
}