-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update TESTNAME instructions in CONTRIBUTING.md #31339
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @alexcrichton (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
- `make check TESTNAME=<path-to-test-file>.rs` - Run a single test file | ||
- `make check-stage1-rpass TESTNAME=<path-to-test-file>.rs` - Run a single | ||
- `make check TESTNAME=<name-of-test-to-run>` - Run a single test file | ||
- `TESTNAME` should be the fully qualified name of the test function, e.g. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually I think that TESTNAME
is basically just a string match against the name of each test. For example all of the run-pass tests are named after the basename of their files, and the libstd tests are named based on modules and such. So for example the test you mentioned below would also be matched with the filters collections
, capacity
, hash::map
, etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, thanks Alex - I've been trying to find how this is matched with not much luck. The reason I wanted to make it a little clearer was when I tried with the file path as suggested I couldn't get it to work - e.g. I used TESTNAME=src/libstd/collections/hash/map.rs
to try to run the tests there.
I'd like to try to find how this is implemented, so I can update the docs if it is just pattern matching as you say.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's most likely implemented in src/libtest/lib.rs
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes this is specifically implemented here
This uses substring match. You can use TESTNAME=abc to run all the tests with abc in the name. |
Thanks all, I've updated the docs again to specify substring matching. |
When trying to run a specific test, I found the contributing docs a bit confusing and through a bit of googling found out that TESTNAME takes the fully qual'd name of the test. I'm unsure if this can also take the source file, but I was unable to get that to work.
Should these documentation improvements also be made in Here are the relevant testing bits currently outputted by
I'd be happy to make these updates/edits if you all think they're worth making. 😄 |
When trying to run a specific test, I found the contributing docs a bit confusing and through a bit of googling found out that TESTNAME takes the fully qual'd name of the test.
I'm unsure if this can also take the source file, but I was unable to get that to work.