Expand description
§facet-testhelpers
Lightweight test helpers: a log facade that always does tracing (with colors), and color-backtrace using the btparse backend.
§Usage
Add this to your test files:
#[facet_testhelpers::test]
fn my_test() {
log::info!("This will be printed with color!");
// Your test code here
}The test macro sets up a simple logger that works with both cargo test and cargo nextest run.
§Recommendation
While this crate works with regular cargo test, we recommend using cargo-nextest for:
- Process-per-test isolation
- Faster parallel test execution
- Better test output and reporting
Install with:
cargo install cargo-nextestThen run tests with:
cargo nextest run§Sponsors
Thanks to all individual sponsors:
…along with corporate sponsors:
…without whom this work could not exist.
§Special thanks
The facet logo was drawn by Misiasart.
§License
Licensed under either of:
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Structs§
- IPanic
- An error type that panics when it’s built (such as when you use
?to coerce to it)
Functions§
- setup
- Set up a simple logger for tests.