Skip to content
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

Partially revert change to testing examples. #5464

Merged
merged 1 commit into from
May 3, 2018

Conversation

ehuss
Copy link
Contributor

@ehuss ehuss commented May 3, 2018

Fixes #5437

I don't think changing the behavior was quite the correct thing to do. This new behavior is very similar to the old with a few small differences:

cargo test
    ORGINAL: Only builds examples.
    NEW: Builds all examples.  Any example with `test` set is tested.

cargo test --tests
    ORIGINAL: Runs all examples as tests.
    NEW: Only runs examples as tests if `test` is set.

cargo test --examples
    ORIGINAL: Runs all examples as tests.
    NEW: (SAME)

cargo test --example foo
    ORIGINAL: Runs the given example as a test.
    NEW: (SAME)

cargo test --all-targets
    ORIGINAL: Runs all examples as tests.
    NEW: (SAME)

Fixes rust-lang#5437

I don't think changing the behavior was quite the correct thing to do.  This new behavior is very similar to the old with a few small differences:

```
cargo test
    ORGINAL: Only builds examples.
    NEW: Builds all examples.  Any example with `test` set is tested.

cargo test --tests
    ORIGINAL: Runs all examples as tests.
    NEW: Only runs examples as tests if `test` is set.

cargo test --examples
    ORIGINAL: Runs all examples as tests.
    NEW: (SAME)

cargo test --example foo
    ORIGINAL: Runs the given example as a test.
    NEW: (SAME)

cargo test --all-targets
    ORIGINAL: Runs all examples as tests.
    NEW: (SAME)
```
@rust-highfive
Copy link

r? @alexcrichton

(rust_highfive has picked a reviewer for you, use r? to override)

@alexcrichton
Copy link
Member

@bors: r+

Thanks!

@bors
Copy link
Contributor

bors commented May 3, 2018

📌 Commit dffc5ba has been approved by alexcrichton

@bors
Copy link
Contributor

bors commented May 3, 2018

⌛ Testing commit dffc5ba with merge 1f1da5bac8d05d53c114cbd14d00be5fb4b4c519...

@bors
Copy link
Contributor

bors commented May 3, 2018

💔 Test failed - status-appveyor

@alexcrichton
Copy link
Member

@bors: retry

@bors
Copy link
Contributor

bors commented May 3, 2018

⌛ Testing commit dffc5ba with merge 4dc5db2...

bors added a commit that referenced this pull request May 3, 2018
Partially revert change to testing examples.

Fixes #5437

I don't think changing the behavior was quite the correct thing to do.  This new behavior is very similar to the old with a few small differences:

```
cargo test
    ORGINAL: Only builds examples.
    NEW: Builds all examples.  Any example with `test` set is tested.

cargo test --tests
    ORIGINAL: Runs all examples as tests.
    NEW: Only runs examples as tests if `test` is set.

cargo test --examples
    ORIGINAL: Runs all examples as tests.
    NEW: (SAME)

cargo test --example foo
    ORIGINAL: Runs the given example as a test.
    NEW: (SAME)

cargo test --all-targets
    ORIGINAL: Runs all examples as tests.
    NEW: (SAME)
```
@bors
Copy link
Contributor

bors commented May 3, 2018

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

@bors bors merged commit dffc5ba into rust-lang:master May 3, 2018
ehuss added a commit to ehuss/cargo that referenced this pull request Aug 5, 2018
As part of rust-lang#5464 I forgot to update the help text.

Closes rust-lang#5177
@ehuss ehuss mentioned this pull request Aug 5, 2018
bors added a commit that referenced this pull request Aug 5, 2018
Fix test --example docs.

As part of #5464 I forgot to update the help text.

Closes #5177
@ehuss ehuss added this to the 1.27.0 milestone Feb 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Should examples be unit-testable?
4 participants