54 releases (20 breaking)
Uses new Rust 2024
| new 0.50.0-rc.0 | Jun 9, 2026 |
|---|---|
| 0.46.0 | Apr 15, 2026 |
| 0.44.3 | Mar 16, 2026 |
| 0.41.0 | Dec 31, 2025 |
| 0.28.0 | Jul 24, 2025 |
#410 in Testing
1,568 downloads per month
Used in 41 crates
(26 directly)
15KB
121 lines
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-nextest
Then 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.
Dependencies
~5.5–9.5MB
~96K SLoC