When I create a test in VS Code, a clickable "Run test" will display.
The problem is: when I click the "Run test", all of my tests will compile, and run, it's not handy at all. Can I set it to run the only test which it is floating at?
By the way, when you add #[should_panic] below #[test], the "Run test" won't display, I think it could be a bug, or not implemented by the rust team.
I don't think it's possible to only compile what you need but the button runs only the test(s) you ask for and filter out the rest (at least on my computer).
The #[should_panic] issue is fixed in rust-analyzer (part of RLS v2.0).
It's OK to compile all but it's not OK to run all tests by the button, but it does happening in my computer.
I am using Win10, VS Code with extension Rust (rls) 0.6.1, it says it has rust-analyzer component, but looks like it doesn't fix the #[should_panic] issue. I couldn't tell it's using RLS v2.0 or not.
More specifically, I create a lib, code nothing in the lib src file; then I create the tests folder, and add some test files under the tests folder, that's all.
After playing a bit with the names, it seems that naming a test "test" will not filter anything out. Also tests are not filtered out if they have the same name but are in different files.