pub struct TestGuard { /* private fields */ }Expand description
Zero-boilerplate test logger that auto-logs pass/fail on drop.
Unlike TestLogger, this guard automatically logs TEST PASS when dropped
normally, or TEST FAIL when dropped during a panic. This eliminates the
need to explicitly call .pass() or .fail().
§Usage
ⓘ
use rch_common::testing::TestGuard;
#[test]
fn test_example() {
let _guard = TestGuard::new("test_example");
// ... test logic ...
// TEST PASS logged automatically when _guard drops
}§Environment Variables
RCH_TEST_LOGGING=1: Enable logging (default: enabled in CI, disabled locally)RCH_TEST_LOGGING=0: Disable logging
When disabled, the guard is a no-op for maximum performance.
Implementations§
Source§impl TestGuard
impl TestGuard
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for TestGuard
impl RefUnwindSafe for TestGuard
impl Send for TestGuard
impl Sync for TestGuard
impl Unpin for TestGuard
impl UnsafeUnpin for TestGuard
impl UnwindSafe for TestGuard
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more