Skip to content

Update TESTNAME instructions in CONTRIBUTING.md #31339

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

Merged
merged 4 commits into from
Feb 2, 2016
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,10 @@ Some common make targets are:
& everything builds in the correct manner.
- `make check-stage1-std NO_REBUILD=1` - test the standard library without
rebuilding the entire compiler
- `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.
Copy link
Member

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.

Copy link
Contributor Author

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.

Copy link
Contributor

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.

Copy link
Member

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

`TESTNAME=collections::hash::map::test_map::test_capacity_not_less_than_len`
- `make check-stage1-rpass TESTNAME=<name-of-test-to-run>` - Run a single
rpass test with the stage1 compiler (this will be quicker than running the
command above as we only build the stage1 compiler, not the entire thing).
You can also leave off the `-rpass` to run all stage1 test types.
Expand Down