Refactor fake_file() away from cargo_command tests#9767
Merged
bors merged 1 commit intorust-lang:masterfrom Aug 6, 2021
Merged
Refactor fake_file() away from cargo_command tests#9767bors merged 1 commit intorust-lang:masterfrom
bors merged 1 commit intorust-lang:masterfrom
Conversation
|
(rust-highfive has picked a reviewer for you, use r? to override) |
Member
|
Seems reasonable to me! I think there's some failures on CI though to fix first |
Contributor
Author
|
yep - booting up windows to figure out what's up over there. |
nipunn1313
commented
Aug 6, 2021
crates/cargo-test-support/src/lib.rs
Outdated
Contributor
Author
There was a problem hiding this comment.
Had to use EXE_EXTENSION instead of EXE_SUFFIX. Was getting "cargo-1..exe" instead of "cargo-1.exe"
There are already similar preexisting test helpers which also work on windows. Port over the executable-creation helper into the file() helper and things appear to pass.
nipunn1313
commented
Aug 6, 2021
| } else { | ||
| if let Some(ext) = self.dst.extension() { | ||
| if ext == env::consts::EXE_EXTENSION { | ||
| self.src.set_extension(ext); |
Contributor
Author
There was a problem hiding this comment.
Had to propagate the .exe to the src from the dst here as intended by the callsite.
nipunn1313
commented
Aug 6, 2021
| } | ||
|
|
||
| // Windows and symlinks don't currently mix well. | ||
| #[cfg(unix)] |
Contributor
Author
There was a problem hiding this comment.
woohoo coverage! They mix!
Member
|
@bors: r+ Thanks! |
Contributor
|
📌 Commit dde290e has been approved by |
Contributor
Contributor
|
☀️ Test successful - checks-actions |
JohnTitor
added a commit
to JohnTitor/rust
that referenced
this pull request
Aug 11, 2021
Update cargo 9 commits in cc17afbb0067b1f57d8882640f63b2168d5b7624..b51439fd8b505d4800a257acfecf3c69f81e35cf 2021-08-02 20:28:08 +0000 to 2021-08-09 18:40:05 +0000 - Deduplicate entries in cargo --list (rust-lang/cargo#9773) - Include aliases with other commands (rust-lang/cargo#9764) - Add a profile option to select the codegen backend (rust-lang/cargo#9118) - remove useless conversions (rust-lang/cargo#9617) - collapse nested if blocks (rust-lang/cargo#9613) - Refactor fake_file() away from cargo_command tests (rust-lang/cargo#9767) - Update cargo-platform to 0.1.2 (rust-lang/cargo#9762) - Bump to the latest jobserver dependency (rust-lang/cargo#9760) - Fix semver check for rust 1.54.0 (rust-lang/cargo#9763)
JohnTitor
added a commit
to JohnTitor/rust
that referenced
this pull request
Aug 11, 2021
Update cargo 9 commits in cc17afbb0067b1f57d8882640f63b2168d5b7624..b51439fd8b505d4800a257acfecf3c69f81e35cf 2021-08-02 20:28:08 +0000 to 2021-08-09 18:40:05 +0000 - Deduplicate entries in cargo --list (rust-lang/cargo#9773) - Include aliases with other commands (rust-lang/cargo#9764) - Add a profile option to select the codegen backend (rust-lang/cargo#9118) - remove useless conversions (rust-lang/cargo#9617) - collapse nested if blocks (rust-lang/cargo#9613) - Refactor fake_file() away from cargo_command tests (rust-lang/cargo#9767) - Update cargo-platform to 0.1.2 (rust-lang/cargo#9762) - Bump to the latest jobserver dependency (rust-lang/cargo#9760) - Fix semver check for rust 1.54.0 (rust-lang/cargo#9763)
JohnTitor
added a commit
to JohnTitor/rust
that referenced
this pull request
Aug 12, 2021
Update cargo 9 commits in cc17afbb0067b1f57d8882640f63b2168d5b7624..b51439fd8b505d4800a257acfecf3c69f81e35cf 2021-08-02 20:28:08 +0000 to 2021-08-09 18:40:05 +0000 - Deduplicate entries in cargo --list (rust-lang/cargo#9773) - Include aliases with other commands (rust-lang/cargo#9764) - Add a profile option to select the codegen backend (rust-lang/cargo#9118) - remove useless conversions (rust-lang/cargo#9617) - collapse nested if blocks (rust-lang/cargo#9613) - Refactor fake_file() away from cargo_command tests (rust-lang/cargo#9767) - Update cargo-platform to 0.1.2 (rust-lang/cargo#9762) - Bump to the latest jobserver dependency (rust-lang/cargo#9760) - Fix semver check for rust 1.54.0 (rust-lang/cargo#9763)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
There are already similar preexisting test helpers which
also work on windows. Port over the executable-creation
helper into the file() helper and things appear to pass.
Was inspired to do this when trying to add tests to solve a separate issue.