Cargo: Document how to run specific tests

Created on 11 Mar 2015  路  4Comments  路  Source: rust-lang/cargo

I found out on IRC that I could use cargo test test_name to run specific tests (actually any tests containing the text).

Despite being a very useful feature I couldn't find it documented anywhere.

A-documenting-cargo-itself

Most helpful comment

@arthurprs For what it's worth, I just googled rust run specific tests and found the answer here. :smile:

All 4 comments

Cargo doesn't actually support running specific tests, instead we just pass the test_name argument to the test binary itself, and then _rust's_ test runner uses that as a filter. This is also documented in cargo test -h, however, so I'm curious where you're thinking this documentation needs to go?

In my opinion it should be stated in Cargo Guide or FAQ.

I didn't realize it was at the cargo test -h though, it may be enough.

@arthurprs For what it's worth, I just googled rust run specific tests and found the answer here. :smile:

This thread is old.

Now

cargo test test_function_name

simply works!

Was this page helpful?
0 / 5 - 0 ratings