惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

MongoDB | Blog
MongoDB | Blog
B
Blog
Y
Y Combinator Blog
大猫的无限游戏
大猫的无限游戏
aimingoo的专栏
aimingoo的专栏
B
Blog RSS Feed
博客园 - Franky
V
V2EX
IT之家
IT之家
WordPress大学
WordPress大学
博客园 - 三生石上(FineUI控件)
J
Java Code Geeks
F
Fortinet All Blogs
I
InfoQ
云风的 BLOG
云风的 BLOG
腾讯CDC
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
月光博客
月光博客
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
N
Netflix TechBlog - Medium
宝玉的分享
宝玉的分享
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
P
Proofpoint News Feed
Microsoft Security Blog
Microsoft Security Blog

The Rust Programming Language Forum - Latest topics

Beginner building a Rust backend framework (AI-assisted) — feedback appreciated C++ to Rust -- Exceptions Re-exporting a trait with a custom derive_macro Gold linker is deprecated Why is using PhantomData valid in this case? Code review for Static Pool Allocator Looking for a pool based allocator Why is this legal? What does it mean for Rustc to run "out of TLS keys"? Using async/await internally with no internal runtime, but exposing a nonblocking poll API — is this a reasonable design? Testing functions that use randomness `cargo-path`: improve coding agents&#39; ability to find Rust documentation Rust task runners Lifetime weird case Windows - USB device not detected A random rustc-ice-[...].txt file appeared Develop rust where the environment is setup in a docker Undefined Behavior: in-bounds pointer arithmetic failed: attempting to offset pointer by 20 bytes, but got alloc238 which is only 1 byte from the end of the allocation Unbug 0.5 - Runtime debug assertions Is there a tiny error in section 6.2 Reference types? Lifetime woes implementing ratatui::Widget for a reference Rusqlite + Chrono: How do I simplify code to obtain chrono datetime value From OOP to Rust – struggling with code organization and data structure design Way to avoid a self-referential struct Rust RF and audio resources/communities Whyhttp - HTTP mocks that fail where the bug actually is Using tokio channel permits in a tower service Arc::increment_strong_count design question (cross-post) `&T`, `&mut T`, `Pin<&mut T>` and `&Cell<T>`: Ways of Borrowing a `T` Ratatui detect arrow key press and release
Cargo test's verbose output - can I quiet it?
worik · 2026-04-20 · via The Rust Programming Language Forum - Latest topics

1

Friends

When I run cargo test the_name_of_the_test I get screeds of output that is irrelevant.

Running cargo test --quiet... is better but still a lot of stuff I do not care about.

Am I missing something? Is there a better way of running them?

E.g:

$ cargo test --quiet engine_send_to_loop_without_channel_errors 

running 1 test
.
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 33 filtered out; finished in 0.00s


running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s


running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s


running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 2 filtered out; finished in 0.00s

There is one line, amongst 20, that has useful information for me.

2

I don't think there is currently a way to get rid of those starting and finishing lines, but it looks like your project has 2 Cargo targets (out of 4) which have no tests at all (0 filtered out). You can exclude those targets by default, and cut the amount of output in half, by setting test = false in the relevant target section in your Cargo.toml, e.g.

[[bin]]
name = "my-program"
test = false

You could also use Nextest which takes over all test output.

1 Like

3

Nope. The "protocol" between Cargo and glue code from rustc that runs the tests is basically non-existent, so Cargo doesn't know what has tests and what doesn't, and has no way of removing those "ran 0 tests" bits.

There was an attempt to make a protocol or harness for tests that would let Cargo fix the absurdity, but it was a case of perfect being enemy of good. The paralysis of designing a perfect universal stable custom test framework harness that solves all problems for everyone, means that nothing ever got implemented and we're stuck forever with dumb protocol that doesn't solve even basic problems for anybody.

1 Like