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

Implementation and CLI-support for `--all-$KIND` flags #3901

Merged
merged 7 commits into from Apr 24, 2017

Conversation

Projects
None yet
6 participants
@BenWiederhake
Copy link
Contributor

BenWiederhake commented Apr 5, 2017

This implements #3112.

This means all of the following commands are now possible and meaningful:

cargo build --all-bins
cargo build --all-tests
cargo test --all-tests
cargo test --all-bins
cargo check --all-bins --all-examples --all-tests --all-benches

The commits try to represent the incremental "propagation" of the new feature:

  • core functionality (cargo check --lib passes)
  • CLI suport (cargo build passes)
  • additional tests (cargo test covers new functionality)

Note that --all is already reserved to mean "all packages of the workspace", so it can't be used to mean --all-bins --all-examples --all-tests --all-benches.

I intend to follow this up by some other PRs, so please do tell me where I could improve.

@rust-highfive

This comment has been minimized.

Copy link

rust-highfive commented Apr 5, 2017

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @brson (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.

@BenWiederhake BenWiederhake force-pushed the BenWiederhake:all-kinds branch from 0e9a1fb to 93cfed7 Apr 5, 2017

@alexcrichton

This comment has been minimized.

Copy link
Member

alexcrichton commented Apr 7, 2017

Awesome thanks for the PR @BenWiederhake!

I'm currently traveling but I should be back next week, I'll try to review then.

@BenWiederhake

This comment has been minimized.

Copy link
Contributor

BenWiederhake commented Apr 7, 2017

Thanks for the heads-up, and no hurry :)

@alexcrichton
Copy link
Member

alexcrichton left a comment

This looks fantastic to me, thanks so much @BenWiederhake! All I really have is a stylistic nit and a bikeshed :)

@wycats, @carols10cents, @matklad, @brson, thoughts about the flag names here? I might lean toward --tests instead of --all-tests, but I'm curious what others think.

bins.iter().chain(examples)
.filter_map(|t| check(t))
.collect()
let all_bins: Vec<String> = bins.try_collect().unwrap_or_else(||

This comment has been minimized.

@alexcrichton

alexcrichton Apr 10, 2017

Member

Could this use {} to delimit the closure?

@matklad

This comment has been minimized.

Copy link
Member

matklad commented Apr 10, 2017

I'll second --tests, --bins etc, because we already have the --all flag, which controls an orthogonal feature, which packages in the workspace are build. It would be prudent to add a test with combination of both features, like cargo build --all --tests

@BenWiederhake BenWiederhake force-pushed the BenWiederhake:all-kinds branch from 93cfed7 to 01782fe Apr 10, 2017

@BenWiederhake

This comment has been minimized.

Copy link
Contributor

BenWiederhake commented Apr 10, 2017

@alexcrichton, re: stylistic nit: ah, yes, those braces belong there. Added.

@alexcrichton, @matklad, re: rename: ehh, I personally find --all-tests more intuitive, especially since it disables the usually automatic filtering for feature-compatible targets. But whatever, I changed it, it's only a string anyway.

@matklad, re: cargo build --all --tests: I added tests for the two scenarios in which cargo build --all --examples can occur. I thought that building examples is slightly more interesting because building the tests can already be done with cargo test --all --no-run.

re: readability of diffs: all my new commits can be found at the tip of my branch incremental, in case you want to see differences to the previous version of this PR. For all other purposes, the currently selected branch all-kinds contains appropriately squashed stuff that is freshly rebased on top of master. Have fun reading.

@alexcrichton

This comment has been minimized.

Copy link
Member

alexcrichton commented Apr 10, 2017

Looks great to me from a technical perspective, thanks again @BenWiederhake! I'll give others some time to weigh in and then we can see how to move forward.

@alexcrichton

This comment has been minimized.

Copy link
Member

alexcrichton commented Apr 24, 2017

Ok looks like we don't have too many more opinions, so I'll merge regardless :)

Thanks again for the PR @BenWiederhake!

@bors: r+

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Apr 24, 2017

📌 Commit 01782fe has been approved by alexcrichton

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Apr 24, 2017

⌛️ Testing commit 01782fe with merge b987ce4...

bors added a commit that referenced this pull request Apr 24, 2017

Auto merge of #3901 - BenWiederhake:all-kinds, r=alexcrichton
Implementation and CLI-support for `--all-$KIND` flags

This implements #3112.

This means all of the following commands are now possible and meaningful:
```
cargo build --all-bins
cargo build --all-tests
cargo test --all-tests
cargo test --all-bins
cargo check --all-bins --all-examples --all-tests --all-benches
```

The commits try to represent the incremental "propagation" of the new feature:
- core functionality (`cargo check --lib` passes)
- CLI suport (`cargo build` passes)
- additional tests (`cargo test` covers new functionality)

Note that `--all` is already reserved to mean "all packages of the workspace", so it can't be used to mean `--all-bins --all-examples --all-tests --all-benches`.

I intend to follow this up by some other PRs, so please do tell me where I could improve.
@bors

This comment has been minimized.

Copy link
Contributor

bors commented Apr 24, 2017

☀️ Test successful - status-appveyor, status-travis
Approved by: alexcrichton
Pushing b987ce4 to master...

@bors bors merged commit 01782fe into rust-lang:master Apr 24, 2017

3 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
homu Test successful
Details

@BenWiederhake BenWiederhake deleted the BenWiederhake:all-kinds branch Apr 24, 2017

@vrinek vrinek referenced this pull request Nov 8, 2017

Merged

Build examples on Travis #724

@matklad matklad referenced this pull request Mar 6, 2018

Merged

Drop ignored tests #5135

bors added a commit that referenced this pull request Mar 6, 2018

Auto merge of #5135 - matklad:drop-ignored-tests, r=alexcrichton
Drop ignored tests

r? @alexcrichton

These tests are ignored, so its better to remove them. `run` does not supports `--bins` argument, so I've left a single test that checks specifically for this.

cc #3901

bors added a commit that referenced this pull request Mar 6, 2018

Auto merge of #5135 - matklad:drop-ignored-tests, r=alexcrichton
Drop ignored tests

r? @alexcrichton

These tests are ignored, so its better to remove them. `run` does not supports `--bins` argument, so I've left a single test that checks specifically for this.

cc #3901
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment