Multuiple integration test: eliminate noise when selecting single testcase

Hi, this is my first question on this forum.

In my project I have several integration tests. When I run just a single testcase, like cargo test my-test, all the integration tests are run. Each prints 4-5 lines stating that the executable got run and all its tests were filtered out. I always have to scroll a terminal to find out if the test passes OR I misspelled test name.

Is there a way to turn off output from a test binary that does not run any tests?
Alternatively, is there a way to have a final warning informing that no tests were executed?

You could further restrict your output by running cargo test my-test --test <test-target> where test-target is the filename of the file where my-test is located. That way all the other test targets are ignored. There's also the -q/--quiet option that reduces the terminal output.

Thanks a lot, this is what I looking for. A little drawback is that I need to know the target name, but since I'm focused on (usually) a single testcase, it's not a big deal.

1 Like

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.