Describe the problem you are trying to solve
It's currently not possible (to my understanding) to filter out multiple tests with Cargo. It would be nice to be able to rerun all the tests in a CI build that failed, without running all the passing tests too.
Describe the solution you'd like
A --tests option that lets you pass a list of tests to run, excluding all other tests. Although I would like it if it were not limited to just integration tests (as --test is), and have it work on unit tests too. If I understand correctly, this would be the equivalent of passing --test to the underlying test runner, except that the test runner does not allow multiple --test options:
error: Option 'test' given more than once
Also it would be nice if at the end of a test run where there were failed tests, Cargo printed out the command that you can run to only re-run the failed tests.
Notes
I find the --test option confusing as it seems to only run integration tests. Could this be changed to allow you to use it with unit tests as well?
See https://rust-lang.zulipchat.com/#narrow/stream/122651-general/topic/.60cargo.20test.20--test.20foo.60.20for.20multiple.20tests for more context.
Cc @jyn514
Describe the problem you are trying to solve
It's currently not possible (to my understanding) to filter out multiple tests with Cargo. It would be nice to be able to rerun all the tests in a CI build that failed, without running all the passing tests too.
Describe the solution you'd like
A
--testsoption that lets you pass a list of tests to run, excluding all other tests. Although I would like it if it were not limited to just integration tests (as--testis), and have it work on unit tests too. If I understand correctly, this would be the equivalent of passing--testto the underlying test runner, except that the test runner does not allow multiple--testoptions:Also it would be nice if at the end of a test run where there were failed tests, Cargo printed out the command that you can run to only re-run the failed tests.
Notes
I find the
--testoption confusing as it seems to only run integration tests. Could this be changed to allow you to use it with unit tests as well?See https://rust-lang.zulipchat.com/#narrow/stream/122651-general/topic/.60cargo.20test.20--test.20foo.60.20for.20multiple.20tests for more context.
Cc @jyn514