Skip to content

Commit

Permalink
test(msrv): Prep for config to be added
Browse files Browse the repository at this point in the history
  • Loading branch information
epage committed Apr 17, 2024
1 parent 906ce09 commit d37aaea
Show file tree
Hide file tree
Showing 9 changed files with 88 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/testsuite/cargo_add/rust_version_ignore/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ fn case() {
.arg("--ignore-rust-version")
.arg_line("rust-version-user")
.current_dir(cwd)
.env(
"CARGO_RESOLVER_SOMETHING_LIKE_PRECEDENCE",
"something-like-rust-version",
)
.masquerade_as_nightly_cargo(&["msrv-policy"])
.assert()
.code(0)
Expand Down
4 changes: 4 additions & 0 deletions tests/testsuite/cargo_add/rust_version_incompatible/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ fn case() {
.arg("add")
.arg_line("rust-version-user")
.current_dir(cwd)
.env(
"CARGO_RESOLVER_SOMETHING_LIKE_PRECEDENCE",
"something-like-rust-version",
)
.masquerade_as_nightly_cargo(&["msrv-policy"])
.assert()
.failure()
Expand Down
4 changes: 4 additions & 0 deletions tests/testsuite/cargo_add/rust_version_latest/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ fn case() {
.arg("add")
.arg_line("rust-version-user")
.current_dir(cwd)
.env(
"CARGO_RESOLVER_SOMETHING_LIKE_PRECEDENCE",
"something-like-rust-version",
)
.masquerade_as_nightly_cargo(&["msrv-policy"])
.assert()
.success()
Expand Down
4 changes: 4 additions & 0 deletions tests/testsuite/cargo_add/rust_version_older/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ fn case() {
.arg("add")
.arg_line("rust-version-user")
.current_dir(cwd)
.env(
"CARGO_RESOLVER_SOMETHING_LIKE_PRECEDENCE",
"something-like-rust-version",
)
.masquerade_as_nightly_cargo(&["msrv-policy"])
.assert()
.success()
Expand Down
4 changes: 4 additions & 0 deletions tests/testsuite/cargo_add/rustc_ignore/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ fn case() {
.arg("--ignore-rust-version")
.arg_line("rust-version-user")
.current_dir(cwd)
.env(
"CARGO_RESOLVER_SOMETHING_LIKE_PRECEDENCE",
"something-like-rust-version",
)
.masquerade_as_nightly_cargo(&["msrv-policy"])
.assert()
.code(0)
Expand Down
4 changes: 4 additions & 0 deletions tests/testsuite/cargo_add/rustc_incompatible/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ fn case() {
.arg("add")
.arg_line("rust-version-user")
.current_dir(cwd)
.env(
"CARGO_RESOLVER_SOMETHING_LIKE_PRECEDENCE",
"something-like-rust-version",
)
.masquerade_as_nightly_cargo(&["msrv-policy"])
.assert()
.failure()
Expand Down
4 changes: 4 additions & 0 deletions tests/testsuite/cargo_add/rustc_latest/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ fn case() {
.arg("add")
.arg_line("rust-version-user")
.current_dir(cwd)
.env(
"CARGO_RESOLVER_SOMETHING_LIKE_PRECEDENCE",
"something-like-rust-version",
)
.masquerade_as_nightly_cargo(&["msrv-policy"])
.assert()
.success()
Expand Down
4 changes: 4 additions & 0 deletions tests/testsuite/cargo_add/rustc_older/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ fn case() {
.arg("add")
.arg_line("rust-version-user")
.current_dir(cwd)
.env(
"CARGO_RESOLVER_SOMETHING_LIKE_PRECEDENCE",
"something-like-rust-version",
)
.masquerade_as_nightly_cargo(&["msrv-policy"])
.assert()
.success()
Expand Down
56 changes: 56 additions & 0 deletions tests/testsuite/rust_version.rs
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,10 @@ fn resolve_with_rust_version() {
.build();

p.cargo("generate-lockfile --ignore-rust-version")
.env(
"CARGO_RESOLVER_SOMETHING_LIKE_PRECEDENCE",
"something-like-rust-version",
)
.arg("-Zmsrv-policy")
.masquerade_as_nightly_cargo(&["msrv-policy"])
.with_stderr(
Expand All @@ -332,6 +336,10 @@ foo v0.0.1 ([CWD])
.run();

p.cargo("generate-lockfile")
.env(
"CARGO_RESOLVER_SOMETHING_LIKE_PRECEDENCE",
"something-like-rust-version",
)
.arg("-Zmsrv-policy")
.masquerade_as_nightly_cargo(&["msrv-policy"])
.with_stderr(
Expand Down Expand Up @@ -388,6 +396,10 @@ fn resolve_with_rustc() {
.build();

p.cargo("generate-lockfile --ignore-rust-version")
.env(
"CARGO_RESOLVER_SOMETHING_LIKE_PRECEDENCE",
"something-like-rust-version",
)
.arg("-Zmsrv-policy")
.masquerade_as_nightly_cargo(&["msrv-policy"])
.with_stderr(
Expand All @@ -408,6 +420,10 @@ foo v0.0.1 ([CWD])
.run();

p.cargo("generate-lockfile")
.env(
"CARGO_RESOLVER_SOMETHING_LIKE_PRECEDENCE",
"something-like-rust-version",
)
.arg("-Zmsrv-policy")
.masquerade_as_nightly_cargo(&["msrv-policy"])
.with_stderr(
Expand Down Expand Up @@ -462,6 +478,10 @@ fn resolve_with_backtracking() {
.build();

p.cargo("generate-lockfile --ignore-rust-version")
.env(
"CARGO_RESOLVER_SOMETHING_LIKE_PRECEDENCE",
"something-like-rust-version",
)
.arg("-Zmsrv-policy")
.masquerade_as_nightly_cargo(&["msrv-policy"])
.with_stderr(
Expand All @@ -483,6 +503,10 @@ foo v0.0.1 ([CWD])

// Ideally we'd pick `has-rust-version` 1.6.0 which requires backtracking
p.cargo("generate-lockfile")
.env(
"CARGO_RESOLVER_SOMETHING_LIKE_PRECEDENCE",
"something-like-rust-version",
)
.arg("-Zmsrv-policy")
.masquerade_as_nightly_cargo(&["msrv-policy"])
.with_stderr(
Expand Down Expand Up @@ -561,6 +585,10 @@ fn resolve_with_multiple_rust_versions() {
.build();

p.cargo("generate-lockfile --ignore-rust-version")
.env(
"CARGO_RESOLVER_SOMETHING_LIKE_PRECEDENCE",
"something-like-rust-version",
)
.arg("-Zmsrv-policy")
.masquerade_as_nightly_cargo(&["msrv-policy"])
.with_stderr(
Expand All @@ -581,6 +609,10 @@ higher v0.0.1 ([CWD])
.run();

p.cargo("generate-lockfile")
.env(
"CARGO_RESOLVER_SOMETHING_LIKE_PRECEDENCE",
"something-like-rust-version",
)
.arg("-Zmsrv-policy")
.masquerade_as_nightly_cargo(&["msrv-policy"])
.with_stderr(
Expand Down Expand Up @@ -671,6 +703,10 @@ fn update_msrv_resolve() {
.build();

p.cargo("update")
.env(
"CARGO_RESOLVER_SOMETHING_LIKE_PRECEDENCE",
"something-like-rust-version",
)
.arg("-Zmsrv-policy")
.masquerade_as_nightly_cargo(&["msrv-policy"])
.with_stderr(
Expand All @@ -692,6 +728,10 @@ See https://github.com/rust-lang/cargo/issues/9930 for more information about th
)
.run();
p.cargo("update --ignore-rust-version")
.env(
"CARGO_RESOLVER_SOMETHING_LIKE_PRECEDENCE",
"something-like-rust-version",
)
.arg("-Zmsrv-policy")
.masquerade_as_nightly_cargo(&["msrv-policy"])
.with_stderr(
Expand Down Expand Up @@ -733,6 +773,10 @@ fn update_precise_overrides_msrv_resolver() {
.build();

p.cargo("update")
.env(
"CARGO_RESOLVER_SOMETHING_LIKE_PRECEDENCE",
"something-like-rust-version",
)
.arg("-Zmsrv-policy")
.masquerade_as_nightly_cargo(&["msrv-policy"])
.with_stderr(
Expand All @@ -744,6 +788,10 @@ fn update_precise_overrides_msrv_resolver() {
)
.run();
p.cargo("update --precise 1.6.0 bar")
.env(
"CARGO_RESOLVER_SOMETHING_LIKE_PRECEDENCE",
"something-like-rust-version",
)
.arg("-Zmsrv-policy")
.masquerade_as_nightly_cargo(&["msrv-policy"])
.with_stderr(
Expand Down Expand Up @@ -790,6 +838,10 @@ fn check_msrv_resolve() {
.build();

p.cargo("check --ignore-rust-version")
.env(
"CARGO_RESOLVER_SOMETHING_LIKE_PRECEDENCE",
"something-like-rust-version",
)
.arg("-Zmsrv-policy")
.masquerade_as_nightly_cargo(&["msrv-policy"])
.with_stderr(
Expand Down Expand Up @@ -818,6 +870,10 @@ foo v0.0.1 ([CWD])

std::fs::remove_file(p.root().join("Cargo.lock")).unwrap();
p.cargo("check")
.env(
"CARGO_RESOLVER_SOMETHING_LIKE_PRECEDENCE",
"something-like-rust-version",
)
.arg("-Zmsrv-policy")
.masquerade_as_nightly_cargo(&["msrv-policy"])
.with_stderr(
Expand Down

0 comments on commit d37aaea

Please sign in to comment.