From 1873c33482d258e737d333ba59b3355a1dd4181b Mon Sep 17 00:00:00 2001 From: Scott Schafer Date: Fri, 3 Feb 2023 14:59:17 -0600 Subject: [PATCH 01/62] chore: update `alt_registry` test to use check --- tests/testsuite/alt_registry.rs | 74 ++++++++++++++++----------------- 1 file changed, 37 insertions(+), 37 deletions(-) diff --git a/tests/testsuite/alt_registry.rs b/tests/testsuite/alt_registry.rs index 6f0d3f7119e1..6370f133aff1 100644 --- a/tests/testsuite/alt_registry.rs +++ b/tests/testsuite/alt_registry.rs @@ -28,14 +28,14 @@ fn depend_on_alt_registry() { Package::new("bar", "0.0.1").alternative(true).publish(); - p.cargo("build") + p.cargo("check") .with_stderr( "\ [UPDATING] `alternative` index [DOWNLOADING] crates ... [DOWNLOADED] bar v0.0.1 (registry `alternative`) -[COMPILING] bar v0.0.1 (registry `alternative`) -[COMPILING] foo v0.0.1 ([CWD]) +[CHECKING] bar v0.0.1 (registry `alternative`) +[CHECKING] foo v0.0.1 ([CWD]) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..]s ", ) @@ -44,11 +44,11 @@ fn depend_on_alt_registry() { p.cargo("clean").run(); // Don't download a second time - p.cargo("build") + p.cargo("check") .with_stderr( "\ -[COMPILING] bar v0.0.1 (registry `alternative`) -[COMPILING] foo v0.0.1 ([CWD]) +[CHECKING] bar v0.0.1 (registry `alternative`) +[CHECKING] foo v0.0.1 ([CWD]) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..]s ", ) @@ -81,16 +81,16 @@ fn depend_on_alt_registry_depends_on_same_registry_no_index() { .alternative(true) .publish(); - p.cargo("build") + p.cargo("check") .with_stderr( "\ [UPDATING] `alternative` index [DOWNLOADING] crates ... [DOWNLOADED] [..] v0.0.1 (registry `alternative`) [DOWNLOADED] [..] v0.0.1 (registry `alternative`) -[COMPILING] baz v0.0.1 (registry `alternative`) -[COMPILING] bar v0.0.1 (registry `alternative`) -[COMPILING] foo v0.0.1 ([CWD]) +[CHECKING] baz v0.0.1 (registry `alternative`) +[CHECKING] bar v0.0.1 (registry `alternative`) +[CHECKING] foo v0.0.1 ([CWD]) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..]s ", ) @@ -123,16 +123,16 @@ fn depend_on_alt_registry_depends_on_same_registry() { .alternative(true) .publish(); - p.cargo("build") + p.cargo("check") .with_stderr( "\ [UPDATING] `alternative` index [DOWNLOADING] crates ... [DOWNLOADED] [..] v0.0.1 (registry `alternative`) [DOWNLOADED] [..] v0.0.1 (registry `alternative`) -[COMPILING] baz v0.0.1 (registry `alternative`) -[COMPILING] bar v0.0.1 (registry `alternative`) -[COMPILING] foo v0.0.1 ([CWD]) +[CHECKING] baz v0.0.1 (registry `alternative`) +[CHECKING] bar v0.0.1 (registry `alternative`) +[CHECKING] foo v0.0.1 ([CWD]) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..]s ", ) @@ -165,7 +165,7 @@ fn depend_on_alt_registry_depends_on_crates_io() { .alternative(true) .publish(); - p.cargo("build") + p.cargo("check") .with_stderr_unordered( "\ [UPDATING] `alternative` index @@ -173,9 +173,9 @@ fn depend_on_alt_registry_depends_on_crates_io() { [DOWNLOADING] crates ... [DOWNLOADED] baz v0.0.1 (registry `dummy-registry`) [DOWNLOADED] bar v0.0.1 (registry `alternative`) -[COMPILING] baz v0.0.1 -[COMPILING] bar v0.0.1 (registry `alternative`) -[COMPILING] foo v0.0.1 ([CWD]) +[CHECKING] baz v0.0.1 +[CHECKING] bar v0.0.1 (registry `alternative`) +[CHECKING] foo v0.0.1 ([CWD]) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..]s ", ) @@ -205,11 +205,11 @@ fn registry_and_path_dep_works() { .file("bar/src/lib.rs", "") .build(); - p.cargo("build") + p.cargo("check") .with_stderr( "\ -[COMPILING] bar v0.0.1 ([CWD]/bar) -[COMPILING] foo v0.0.1 ([CWD]) +[CHECKING] bar v0.0.1 ([CWD]/bar) +[CHECKING] foo v0.0.1 ([CWD]) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..]s ", ) @@ -237,7 +237,7 @@ fn registry_incompatible_with_git() { .file("src/main.rs", "fn main() {}") .build(); - p.cargo("build") + p.cargo("check") .with_status(101) .with_stderr_contains( " dependency (bar) specification is ambiguous. \ @@ -377,7 +377,7 @@ fn alt_registry_and_crates_io_deps() { .alternative(true) .publish(); - p.cargo("build") + p.cargo("check") .with_stderr_unordered( "\ [UPDATING] `alternative` index @@ -385,9 +385,9 @@ fn alt_registry_and_crates_io_deps() { [DOWNLOADING] crates ... [DOWNLOADED] crates_io_dep v0.0.1 (registry `dummy-registry`) [DOWNLOADED] alt_reg_dep v0.1.0 (registry `alternative`) -[COMPILING] alt_reg_dep v0.1.0 (registry `alternative`) -[COMPILING] crates_io_dep v0.0.1 -[COMPILING] foo v0.0.1 ([CWD]) +[CHECKING] alt_reg_dep v0.1.0 (registry `alternative`) +[CHECKING] crates_io_dep v0.0.1 +[CHECKING] foo v0.0.1 ([CWD]) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..]s ", ) @@ -580,12 +580,12 @@ fn patch_alt_reg() { .file("bar/src/lib.rs", "pub fn bar() {}") .build(); - p.cargo("build") + p.cargo("check") .with_stderr( "\ [UPDATING] `alternative` index -[COMPILING] bar v0.1.0 ([CWD]/bar) -[COMPILING] foo v0.0.1 ([CWD]) +[CHECKING] bar v0.1.0 ([CWD]/bar) +[CHECKING] foo v0.0.1 ([CWD]) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", ) @@ -662,14 +662,14 @@ fn no_api() { .file("src/lib.rs", "") .build(); - p.cargo("build") + p.cargo("check") .with_stderr( "\ [UPDATING] `alternative` index [DOWNLOADING] crates ... [DOWNLOADED] bar v0.0.1 (registry `alternative`) -[COMPILING] bar v0.0.1 (registry `alternative`) -[COMPILING] foo v0.0.1 ([CWD]) +[CHECKING] bar v0.0.1 (registry `alternative`) +[CHECKING] foo v0.0.1 ([CWD]) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..]s ", ) @@ -1050,7 +1050,7 @@ fn unknown_registry() { config.insert(start + start_index, '#'); fs::write(&cfg_path, config).unwrap(); - p.cargo("build").run(); + p.cargo("check").run(); // Important parts: // foo -> bar registry = null @@ -1212,14 +1212,14 @@ fn registries_index_relative_url() { Package::new("bar", "0.0.1").alternative(true).publish(); - p.cargo("build") + p.cargo("check") .with_stderr( "\ [UPDATING] `relative` index [DOWNLOADING] crates ... [DOWNLOADED] bar v0.0.1 (registry `relative`) -[COMPILING] bar v0.0.1 (registry `relative`) -[COMPILING] foo v0.0.1 ([CWD]) +[CHECKING] bar v0.0.1 (registry `relative`) +[CHECKING] foo v0.0.1 ([CWD]) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..]s ", ) @@ -1259,7 +1259,7 @@ fn registries_index_relative_path_not_allowed() { Package::new("bar", "0.0.1").alternative(true).publish(); - p.cargo("build") + p.cargo("check") .with_stderr(&format!( "\ error: failed to parse manifest at `{root}/foo/Cargo.toml` From 9174c22744cb1c41a9c5d37f0e2c25e46d5812b1 Mon Sep 17 00:00:00 2001 From: Scott Schafer Date: Fri, 3 Feb 2023 15:26:55 -0600 Subject: [PATCH 02/62] chore: update `build_config` test to use check --- tests/testsuite/bad_config.rs | 76 +++++++++++++++++------------------ 1 file changed, 38 insertions(+), 38 deletions(-) diff --git a/tests/testsuite/bad_config.rs b/tests/testsuite/bad_config.rs index a6fe93cf39ab..fe72155f4c13 100644 --- a/tests/testsuite/bad_config.rs +++ b/tests/testsuite/bad_config.rs @@ -15,7 +15,7 @@ fn bad1() { "#, ) .build(); - p.cargo("build -v --target=nonexistent-target") + p.cargo("check -v --target=nonexistent-target") .with_status(101) .with_stderr( "\ @@ -161,7 +161,7 @@ fn invalid_global_config() { .file("src/lib.rs", "") .build(); - p.cargo("build -v") + p.cargo("check -v") .with_status(101) .with_stderr( "\ @@ -191,7 +191,7 @@ fn bad_cargo_lock() { .file("src/lib.rs", "") .build(); - p.cargo("build -v") + p.cargo("check -v") .with_status(101) .with_stderr( "\ @@ -246,7 +246,7 @@ fn duplicate_packages_in_cargo_lock() { ) .build(); - p.cargo("build") + p.cargo("check") .with_status(101) .with_stderr( "\ @@ -295,7 +295,7 @@ fn bad_source_in_cargo_lock() { ) .build(); - p.cargo("build --verbose") + p.cargo("check --verbose") .with_status(101) .with_stderr( "\ @@ -326,7 +326,7 @@ fn bad_dependency_in_lockfile() { ) .build(); - p.cargo("build").run(); + p.cargo("check").run(); } #[cargo_test] @@ -347,7 +347,7 @@ fn bad_git_dependency() { .file("src/lib.rs", "") .build(); - p.cargo("build -v") + p.cargo("check -v") .with_status(101) .with_stderr( "\ @@ -416,7 +416,7 @@ fn malformed_override() { .file("src/lib.rs", "") .build(); - p.cargo("build") + p.cargo("check") .with_status(101) .with_stderr( "\ @@ -461,7 +461,7 @@ fn duplicate_binary_names() { .file("b.rs", r#"fn main() -> () {}"#) .build(); - p.cargo("build") + p.cargo("check") .with_status(101) .with_stderr( "\ @@ -498,7 +498,7 @@ fn duplicate_example_names() { .file("examples/ex2.rs", r#"fn main () -> () {}"#) .build(); - p.cargo("build --example ex") + p.cargo("check --example ex") .with_status(101) .with_stderr( "\ @@ -573,7 +573,7 @@ fn duplicate_deps() { .file("src/main.rs", r#"fn main () {}"#) .build(); - p.cargo("build") + p.cargo("check") .with_status(101) .with_stderr( "\ @@ -612,7 +612,7 @@ fn duplicate_deps_diff_sources() { .file("src/main.rs", r#"fn main () {}"#) .build(); - p.cargo("build") + p.cargo("check") .with_status(101) .with_stderr( "\ @@ -644,11 +644,11 @@ fn unused_keys() { .file("src/lib.rs", "") .build(); - p.cargo("build") + p.cargo("check") .with_stderr( "\ warning: unused manifest key: target.foo.bar -[COMPILING] foo v0.1.0 ([CWD]) +[CHECKING] foo v0.1.0 ([CWD]) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", ) @@ -668,11 +668,11 @@ warning: unused manifest key: target.foo.bar ) .file("src/lib.rs", "pub fn foo() {}") .build(); - p.cargo("build") + p.cargo("check") .with_stderr( "\ warning: unused manifest key: package.bulid -[COMPILING] foo [..] +[CHECKING] foo [..] [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", ) @@ -695,11 +695,11 @@ warning: unused manifest key: package.bulid ) .file("src/lib.rs", "pub fn foo() {}") .build(); - p.cargo("build") + p.cargo("check") .with_stderr( "\ warning: unused manifest key: lib.build -[COMPILING] foo [..] +[CHECKING] foo [..] [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", ) @@ -720,11 +720,11 @@ fn unused_keys_in_virtual_manifest() { .file("bar/Cargo.toml", &basic_manifest("bar", "0.0.1")) .file("bar/src/lib.rs", "") .build(); - p.cargo("build --workspace") + p.cargo("check --workspace") .with_stderr( "\ [WARNING] [..]/foo/Cargo.toml: unused manifest key: workspace.bulid -[COMPILING] bar [..] +[CHECKING] bar [..] [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", ) @@ -751,7 +751,7 @@ fn empty_dependencies() { Package::new("bar", "0.0.1").publish(); - p.cargo("build") + p.cargo("check") .with_stderr_contains( "\ warning: dependency (bar) specified without providing a local path, Git repository, or version \ @@ -768,7 +768,7 @@ fn invalid_toml_historically_allowed_fails() { .file("src/main.rs", "fn main() {}") .build(); - p.cargo("build") + p.cargo("check") .with_status(101) .with_stderr( "\ @@ -812,7 +812,7 @@ fn ambiguous_git_reference() { .file("src/lib.rs", "") .build(); - p.cargo("build -v") + p.cargo("check -v") .with_status(101) .with_stderr( "\ @@ -843,7 +843,7 @@ fn fragment_in_git_url() { .file("src/lib.rs", "") .build(); - p.cargo("build -v") + p.cargo("check -v") .with_status(101) .with_stderr_contains( "\ @@ -862,7 +862,7 @@ fn bad_source_config1() { .file(".cargo/config", "[source.foo]") .build(); - p.cargo("build") + p.cargo("check") .with_status(101) .with_stderr("error: no source location specified for `source.foo`, need [..]") .run(); @@ -894,7 +894,7 @@ fn bad_source_config2() { ) .build(); - p.cargo("build") + p.cargo("check") .with_status(101) .with_stderr( "\ @@ -940,7 +940,7 @@ fn bad_source_config3() { ) .build(); - p.cargo("build") + p.cargo("check") .with_status(101) .with_stderr( "\ @@ -988,7 +988,7 @@ fn bad_source_config4() { ) .build(); - p.cargo("build") + p.cargo("check") .with_status(101) .with_stderr( "\ @@ -1037,7 +1037,7 @@ fn bad_source_config5() { ) .build(); - p.cargo("build") + p.cargo("check") .with_status(101) .with_stderr( "\ @@ -1069,7 +1069,7 @@ fn both_git_and_path_specified() { .file("src/lib.rs", "") .build(); - foo.cargo("build -v") + foo.cargo("check -v") .with_status(101) .with_stderr( "\ @@ -1108,7 +1108,7 @@ fn bad_source_config6() { ) .build(); - p.cargo("build") + p.cargo("check") .with_status(101) .with_stderr( "\ @@ -1146,7 +1146,7 @@ error: failed to parse manifest at `[..]` Caused by: key `branch` is ignored for dependency (bar). "; - foo.cargo("build -v") + foo.cargo("check -v") .with_status(101) .with_stderr(err_msg) .run(); @@ -1163,7 +1163,7 @@ Caused by: bar = { path = "bar", branch = "spam" } "#, ); - foo.cargo("build") + foo.cargo("check") .with_status(101) .with_stderr(err_msg) .run(); @@ -1197,7 +1197,7 @@ fn bad_source_config7() { Package::new("bar", "0.1.0").publish(); - p.cargo("build") + p.cargo("check") .with_status(101) .with_stderr("error: more than one source location specified for `source.foo`") .run(); @@ -1228,7 +1228,7 @@ fn bad_source_config8() { ) .build(); - p.cargo("build") + p.cargo("check") .with_status(101) .with_stderr( "[ERROR] source definition `source.foo` specifies `branch`, \ @@ -1255,7 +1255,7 @@ fn bad_dependency() { .file("src/lib.rs", "") .build(); - p.cargo("build") + p.cargo("check") .with_status(101) .with_stderr( "\ @@ -1287,7 +1287,7 @@ fn bad_debuginfo() { .file("src/lib.rs", "") .build(); - p.cargo("build") + p.cargo("check") .with_status(101) .with_stderr( "\ @@ -1317,7 +1317,7 @@ fn bad_opt_level() { .file("src/lib.rs", "") .build(); - p.cargo("build") + p.cargo("check") .with_status(101) .with_stderr( "\ From 7fcb542f7f74789cc2043fb2e037d68b00a9a93e Mon Sep 17 00:00:00 2001 From: Scott Schafer Date: Fri, 3 Feb 2023 15:28:28 -0600 Subject: [PATCH 03/62] chore: update `bad_manifest_path` test to use check --- tests/testsuite/bad_manifest_path.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/testsuite/bad_manifest_path.rs b/tests/testsuite/bad_manifest_path.rs index 12b89c6f4b09..fb214e32173f 100644 --- a/tests/testsuite/bad_manifest_path.rs +++ b/tests/testsuite/bad_manifest_path.rs @@ -63,7 +63,7 @@ fn bench_dir_to_nonexistent_cargo_toml() { #[cargo_test] fn build_dir_containing_cargo_toml() { - assert_not_a_cargo_toml("build", "foo"); + assert_not_a_cargo_toml("check", "foo"); } #[cargo_test] @@ -78,7 +78,7 @@ fn build_dir_plus_path() { #[cargo_test] fn build_dir_to_nonexistent_cargo_toml() { - assert_cargo_toml_doesnt_exist("build", "foo/bar/baz/Cargo.toml"); + assert_cargo_toml_doesnt_exist("check", "foo/bar/baz/Cargo.toml"); } #[cargo_test] From ee85ea1d711ce9a0e90f8d4e7da71edde0e5b545 Mon Sep 17 00:00:00 2001 From: Scott Schafer Date: Wed, 15 Feb 2023 15:48:14 -0600 Subject: [PATCH 04/62] chore: update `build_script` test to use check --- tests/testsuite/build_script.rs | 186 ++++++++++++++++---------------- 1 file changed, 93 insertions(+), 93 deletions(-) diff --git a/tests/testsuite/build_script.rs b/tests/testsuite/build_script.rs index d5ee1f99c9ab..1b727c2fd49e 100644 --- a/tests/testsuite/build_script.rs +++ b/tests/testsuite/build_script.rs @@ -32,7 +32,7 @@ fn custom_build_script_failed() { .file("src/main.rs", "fn main() {}") .file("build.rs", "fn main() { std::process::exit(101); }") .build(); - p.cargo("build -v") + p.cargo("check -v") .with_status(101) .with_stderr( "\ @@ -68,7 +68,7 @@ fn custom_build_script_failed_backtraces_message() { .file("src/main.rs", "fn main() {}") .file("build.rs", "fn main() { std::process::exit(101); }") .build(); - p.cargo("build -v") + p.cargo("check -v") .env("RUST_BACKTRACE", "1") .with_status(101) .with_stderr( @@ -122,7 +122,7 @@ fn custom_build_script_failed_backtraces_message_with_debuginfo() { .file("src/main.rs", "fn main() {}") .file("build.rs", "fn main() { std::process::exit(101); }") .build(); - p.cargo("build -v") + p.cargo("check -v") .env("RUST_BACKTRACE", "1") .env("CARGO_PROFILE_DEV_BUILD_OVERRIDE_DEBUG", "true") .with_status(101) @@ -241,8 +241,8 @@ fn custom_build_env_vars() { let p = p.file("bar/build.rs", &file_content).build(); - p.cargo("build --features bar_feat").run(); - p.cargo("build --features bar_feat") + p.cargo("check --features bar_feat").run(); + p.cargo("check --features bar_feat") // we use rustc since $CARGO is only used if it points to a path that exists .env("CHECK_CARGO_IS_RUSTC", "1") .env(cargo::CARGO_ENV, rustc) @@ -450,7 +450,7 @@ fn custom_build_env_var_rustc_linker() { // no crate type set => linker never called => build succeeds if and // only if build.rs succeeds, despite linker binary not existing. - p.cargo("build --target").arg(&target).run(); + p.cargo("check --target").arg(&target).run(); } #[cargo_test] @@ -472,7 +472,7 @@ fn custom_build_env_var_rustc_linker_bad_host_target() { .build(); // build.rs should fail since host == target when no target is set - p.cargo("build --verbose") + p.cargo("check --verbose") .with_status(101) .with_stderr_contains( "\ @@ -514,7 +514,7 @@ fn custom_build_env_var_rustc_linker_host_target() { // no crate type set => linker never called => build succeeds if and // only if build.rs succeeds, despite linker binary not existing. - p.cargo("build -Z target-applies-to-host --target") + p.cargo("check -Z target-applies-to-host --target") .arg(&target) .masquerade_as_nightly_cargo(&["target-applies-to-host"]) .run(); @@ -549,7 +549,7 @@ fn custom_build_env_var_rustc_linker_host_target_env() { // no crate type set => linker never called => build succeeds if and // only if build.rs succeeds, despite linker binary not existing. - p.cargo("build -Z target-applies-to-host --target") + p.cargo("check -Z target-applies-to-host --target") .env("CARGO_TARGET_APPLIES_TO_HOST", "false") .arg(&target) .masquerade_as_nightly_cargo(&["target-applies-to-host"]) @@ -575,7 +575,7 @@ fn custom_build_invalid_host_config_feature_flag() { .build(); // build.rs should fail due to -Zhost-config being set without -Ztarget-applies-to-host - p.cargo("build -Z host-config --target") + p.cargo("check -Z host-config --target") .arg(&target) .masquerade_as_nightly_cargo(&["host-config"]) .with_status(101) @@ -608,7 +608,7 @@ fn custom_build_linker_host_target_with_bad_host_config() { .build(); // build.rs should fail due to bad host linker being set - p.cargo("build -Z target-applies-to-host -Z host-config --verbose --target") + p.cargo("check -Z target-applies-to-host -Z host-config --verbose --target") .arg(&target) .masquerade_as_nightly_cargo(&["target-applies-to-host", "host-config"]) .with_status(101) @@ -643,7 +643,7 @@ fn custom_build_linker_bad_host() { .build(); // build.rs should fail due to bad host linker being set - p.cargo("build -Z target-applies-to-host -Z host-config --verbose --target") + p.cargo("check -Z target-applies-to-host -Z host-config --verbose --target") .arg(&target) .masquerade_as_nightly_cargo(&["target-applies-to-host", "host-config"]) .with_status(101) @@ -680,7 +680,7 @@ fn custom_build_linker_bad_host_with_arch() { .build(); // build.rs should fail due to bad host linker being set - p.cargo("build -Z target-applies-to-host -Z host-config --verbose --target") + p.cargo("check -Z target-applies-to-host -Z host-config --verbose --target") .arg(&target) .masquerade_as_nightly_cargo(&["target-applies-to-host", "host-config"]) .with_status(101) @@ -726,7 +726,7 @@ fn custom_build_env_var_rustc_linker_cross_arch_host() { // build.rs should be built fine since cross target != host target. // assertion should succeed since it's still passed the target linker - p.cargo("build -Z target-applies-to-host -Z host-config --verbose --target") + p.cargo("check -Z target-applies-to-host -Z host-config --verbose --target") .arg(&target) .masquerade_as_nightly_cargo(&["target-applies-to-host", "host-config"]) .run(); @@ -756,7 +756,7 @@ fn custom_build_linker_bad_cross_arch_host() { .build(); // build.rs should fail due to bad host linker being set - p.cargo("build -Z target-applies-to-host -Z host-config --verbose --target") + p.cargo("check -Z target-applies-to-host -Z host-config --verbose --target") .arg(&target) .masquerade_as_nightly_cargo(&["target-applies-to-host", "host-config"]) .with_status(101) @@ -791,7 +791,7 @@ fn custom_build_script_wrong_rustc_flags() { ) .build(); - p.cargo("build") + p.cargo("check") .with_status(101) .with_stderr_contains( "[ERROR] Only `-l` and `-L` flags are allowed in build script of `foo v0.5.0 ([CWD])`: \ @@ -839,7 +839,7 @@ fn custom_build_script_rustc_flags() { ) .build(); - p.cargo("build --verbose") + p.cargo("check --verbose") .with_stderr( "\ [COMPILING] foo [..] @@ -848,7 +848,7 @@ fn custom_build_script_rustc_flags() { [RUNNING] `rustc --crate-name foo foo/src/lib.rs [..]\ -L dependency=[CWD]/target/debug/deps \ -L /dummy/path1 -L /dummy/path2 -l nonexistinglib` -[COMPILING] bar [..] +[CHECKING] bar [..] [RUNNING] `rustc --crate-name bar src/main.rs [..]\ -L dependency=[CWD]/target/debug/deps \ --extern foo=[..]libfoo-[..] \ @@ -898,7 +898,7 @@ fn custom_build_script_rustc_flags_no_space() { ) .build(); - p.cargo("build --verbose") + p.cargo("check --verbose") .with_stderr( "\ [COMPILING] foo [..] @@ -907,7 +907,7 @@ fn custom_build_script_rustc_flags_no_space() { [RUNNING] `rustc --crate-name foo foo/src/lib.rs [..]\ -L dependency=[CWD]/target/debug/deps \ -L /dummy/path1 -L /dummy/path2 -l nonexistinglib` -[COMPILING] bar [..] +[CHECKING] bar [..] [RUNNING] `rustc --crate-name bar src/main.rs [..]\ -L dependency=[CWD]/target/debug/deps \ --extern foo=[..]libfoo-[..] \ @@ -934,7 +934,7 @@ fn links_no_build_cmd() { .file("src/lib.rs", "") .build(); - p.cargo("build") + p.cargo("check") .with_status(101) .with_stderr( "\ @@ -983,7 +983,7 @@ fn links_duplicates() { .file("a-sys/build.rs", "") .build(); - p.cargo("build").with_status(101) + p.cargo("check").with_status(101) .with_stderr("\ error: failed to select a version for `a-sys`. ... required by package `foo v0.5.0 ([..])` @@ -1031,7 +1031,7 @@ fn links_duplicates_old_registry() { .file("src/lib.rs", "") .build(); - p.cargo("build") + p.cargo("check") .with_status(101) .with_stderr( "\ @@ -1102,7 +1102,7 @@ fn links_duplicates_deep_dependency() { .file("a/a-sys/build.rs", "") .build(); - p.cargo("build").with_status(101) + p.cargo("check").with_status(101) .with_stderr("\ error: failed to select a version for `a-sys`. ... required by package `a v0.5.0 ([..])` @@ -1175,7 +1175,7 @@ fn overrides_and_links() { .file("a/build.rs", "not valid rust code") .build(); - p.cargo("build -v") + p.cargo("check -v") .with_stderr( "\ [..] @@ -1221,7 +1221,7 @@ fn unused_overrides() { ) .build(); - p.cargo("build -v").run(); + p.cargo("check -v").run(); } #[cargo_test] @@ -1278,7 +1278,7 @@ fn links_passes_env_vars() { ) .build(); - p.cargo("build -v").run(); + p.cargo("check -v").run(); } #[cargo_test] @@ -1298,13 +1298,13 @@ fn only_rerun_build_script() { .file("build.rs", "fn main() {}") .build(); - p.cargo("build -v").run(); + p.cargo("check -v").run(); p.root().move_into_the_past(); p.change_file("some-new-file", ""); p.root().move_into_the_past(); - p.cargo("build -v") + p.cargo("check -v") .with_stderr( "\ [DIRTY] foo v0.5.0 ([CWD]): the precalculated components changed @@ -1377,13 +1377,13 @@ fn rebuild_continues_to_pass_env_vars() { ) .build(); - p.cargo("build -v").run(); + p.cargo("check -v").run(); p.root().move_into_the_past(); p.change_file("some-new-file", ""); p.root().move_into_the_past(); - p.cargo("build -v").run(); + p.cargo("check -v").run(); } #[cargo_test] @@ -1404,7 +1404,7 @@ fn testing_and_such() { .build(); println!("build"); - p.cargo("build -v").run(); + p.cargo("check -v").run(); p.root().move_into_the_past(); p.change_file("src/lib.rs", ""); @@ -1511,11 +1511,11 @@ fn propagation_of_l_flags() { ) .build(); - p.cargo("build -v -j1") + p.cargo("check -v -j1") .with_stderr_contains( "\ [RUNNING] `rustc --crate-name a [..] -L bar[..]-L foo[..]` -[COMPILING] foo v0.5.0 ([CWD]) +[CHECKING] foo v0.5.0 ([CWD]) [RUNNING] `rustc --crate-name foo [..] -L bar -L foo` ", ) @@ -1586,11 +1586,11 @@ fn propagation_of_l_flags_new() { ) .build(); - p.cargo("build -v -j1") + p.cargo("check -v -j1") .with_stderr_contains( "\ [RUNNING] `rustc --crate-name a [..] -L bar[..]-L foo[..]` -[COMPILING] foo v0.5.0 ([CWD]) +[CHECKING] foo v0.5.0 ([CWD]) [RUNNING] `rustc --crate-name foo [..] -L bar -L foo` ", ) @@ -1625,7 +1625,7 @@ fn build_deps_simple() { .file("a/src/lib.rs", "") .build(); - p.cargo("build -v") + p.cargo("check -v") .with_stderr( "\ [COMPILING] a v0.5.0 ([CWD]/a) @@ -1672,7 +1672,7 @@ fn build_deps_not_for_normal() { .file("a/src/lib.rs", "") .build(); - p.cargo("build -v --target") + p.cargo("check -v --target") .arg(&target) .with_status(101) .with_stderr_contains("[..]can't find crate for `aaaaa`[..]") @@ -1794,7 +1794,7 @@ fn out_dir_is_preserved() { .build(); // Make the file - p.cargo("build -v").run(); + p.cargo("check -v").run(); // Change to asserting that it's there p.change_file( @@ -1809,7 +1809,7 @@ fn out_dir_is_preserved() { } "#, ); - p.cargo("build -v") + p.cargo("check -v") .with_stderr( "\ [DIRTY] foo [..]: the file `build.rs` has changed ([..]) @@ -1823,7 +1823,7 @@ fn out_dir_is_preserved() { .run(); // Run a fresh build where file should be preserved - p.cargo("build -v") + p.cargo("check -v") .with_stderr( "\ [FRESH] foo [..] @@ -1834,7 +1834,7 @@ fn out_dir_is_preserved() { // One last time to make sure it's still there. p.change_file("foo", ""); - p.cargo("build -v") + p.cargo("check -v") .with_stderr( "\ [DIRTY] foo [..]: the precalculated components changed @@ -2006,7 +2006,7 @@ fn release_with_build_script() { ) .build(); - p.cargo("build -v --release").run(); + p.cargo("check -v --release").run(); } #[cargo_test] @@ -2024,7 +2024,7 @@ fn build_script_only() { ) .file("build.rs", r#"fn main() {}"#) .build(); - p.cargo("build -v") + p.cargo("check -v") .with_status(101) .with_stderr( "\ @@ -2084,7 +2084,7 @@ fn shared_dep_with_a_build_script() { ) .file("b/src/lib.rs", "") .build(); - p.cargo("build -v").run(); + p.cargo("check -v").run(); } #[cargo_test] @@ -2136,7 +2136,7 @@ fn transitive_dep_host() { ) .file("b/src/lib.rs", "") .build(); - p.cargo("build").run(); + p.cargo("check").run(); } #[cargo_test] @@ -2304,7 +2304,7 @@ fn build_script_with_dynamic_native_dependency() { .run(); let root = build.root().join("target").join("debug"); - foo.cargo("build -v") + foo.cargo("check -v") .env("BUILDER_ROOT", root) .env("CARGO_LOG", "cargo::ops::cargo_rustc") .run(); @@ -2368,7 +2368,7 @@ fn profile_debug_0() { "#, ) .build(); - p.cargo("build").run(); + p.cargo("check").run(); } #[cargo_test] @@ -2390,7 +2390,7 @@ fn build_script_with_lto() { .file("src/lib.rs", "") .file("build.rs", "fn main() {}") .build(); - p.cargo("build").run(); + p.cargo("check").run(); } #[cargo_test] @@ -2430,7 +2430,7 @@ fn test_duplicate_deps() { .file("bar/src/lib.rs", "pub fn do_nothing() {}") .build(); - p.cargo("build").run(); + p.cargo("check").run(); } #[cargo_test] @@ -2452,7 +2452,7 @@ fn cfg_feedback() { r#"fn main() { println!("cargo:rustc-cfg=foo"); }"#, ) .build(); - p.cargo("build -v").run(); + p.cargo("check -v").run(); } #[cargo_test] @@ -2485,7 +2485,7 @@ fn cfg_override() { ) .build(); - p.cargo("build -v").run(); + p.cargo("check -v").run(); } #[cargo_test] @@ -2739,7 +2739,7 @@ fn env_build() { r#"fn main() { println!("cargo:rustc-env=FOO=foo"); }"#, ) .build(); - p.cargo("build -v").run(); + p.cargo("check -v").run(); p.cargo("run -v").with_stdout("foo\n").run(); } @@ -2969,18 +2969,18 @@ fn diamond_passes_args_only_once() { .file("c/src/lib.rs", "") .build(); - p.cargo("build -v") + p.cargo("check -v") .with_stderr( "\ [COMPILING] c v0.5.0 ([..] [RUNNING] `rustc [..]` [RUNNING] `[..]` [RUNNING] `rustc [..]` -[COMPILING] b v0.5.0 ([..] +[CHECKING] b v0.5.0 ([..] [RUNNING] `rustc [..]` -[COMPILING] a v0.5.0 ([..] +[CHECKING] a v0.5.0 ([..] [RUNNING] `rustc [..]` -[COMPILING] foo v0.5.0 ([..] +[CHECKING] foo v0.5.0 ([..] [RUNNING] `[..]rmeta -L native=test` [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", @@ -3015,7 +3015,7 @@ fn adding_an_override_invalidates() { ) .build(); - p.cargo("build -v") + p.cargo("check -v") .with_stderr( "\ [COMPILING] foo v0.5.0 ([..] @@ -3038,7 +3038,7 @@ fn adding_an_override_invalidates() { ), ); - p.cargo("build -v") + p.cargo("check -v") .with_stderr( "\ [COMPILING] foo v0.5.0 ([..] @@ -3078,7 +3078,7 @@ fn changing_an_override_invalidates() { .file("build.rs", "") .build(); - p.cargo("build -v") + p.cargo("check -v") .with_stderr( "\ [COMPILING] foo v0.5.0 ([..] @@ -3099,7 +3099,7 @@ fn changing_an_override_invalidates() { ), ); - p.cargo("build -v") + p.cargo("check -v") .with_stderr( "\ [DIRTY] foo v0.5.0 ([..]): the precalculated components changed @@ -3143,7 +3143,7 @@ fn fresh_builds_possible_with_link_libs() { .file("build.rs", "") .build(); - p.cargo("build -v") + p.cargo("check -v") .with_stderr( "\ [COMPILING] foo v0.5.0 ([..] @@ -3153,7 +3153,7 @@ fn fresh_builds_possible_with_link_libs() { ) .run(); - p.cargo("build -v") + p.cargo("check -v") .with_stderr( "\ [FRESH] foo v0.5.0 ([..]) @@ -3197,7 +3197,7 @@ fn fresh_builds_possible_with_multiple_metadata_overrides() { .file("build.rs", "") .build(); - p.cargo("build -v") + p.cargo("check -v") .with_stderr( "\ [COMPILING] foo v0.5.0 ([..] @@ -3207,7 +3207,7 @@ fn fresh_builds_possible_with_multiple_metadata_overrides() { ) .run(); - p.cargo("build -v") + p.cargo("check -v") .env("CARGO_LOG", "cargo::ops::cargo_rustc::fingerprint=info") .with_stderr( "\ @@ -3386,11 +3386,11 @@ fn rebuild_only_on_explicit_paths() { ) .build(); - p.cargo("build -v").run(); + p.cargo("check -v").run(); // files don't exist, so should always rerun if they don't exist println!("run without"); - p.cargo("build -v") + p.cargo("check -v") .with_stderr( "\ [DIRTY] foo v0.5.0 ([..]): the file `foo` is missing @@ -3409,7 +3409,7 @@ fn rebuild_only_on_explicit_paths() { // now the exist, so run once, catch the mtime, then shouldn't run again println!("run with"); - p.cargo("build -v") + p.cargo("check -v") .with_stderr( "\ [DIRTY] foo v0.5.0 ([..]): the file `foo` has changed ([..]) @@ -3422,7 +3422,7 @@ fn rebuild_only_on_explicit_paths() { .run(); println!("run with2"); - p.cargo("build -v") + p.cargo("check -v") .with_stderr( "\ [FRESH] foo v0.5.0 ([..]) @@ -3436,7 +3436,7 @@ fn rebuild_only_on_explicit_paths() { // random other files do not affect freshness println!("run baz"); p.change_file("baz", ""); - p.cargo("build -v") + p.cargo("check -v") .with_stderr( "\ [FRESH] foo v0.5.0 ([..]) @@ -3448,7 +3448,7 @@ fn rebuild_only_on_explicit_paths() { // but changing dependent files does println!("run foo change"); p.change_file("foo", ""); - p.cargo("build -v") + p.cargo("check -v") .with_stderr( "\ [DIRTY] foo v0.5.0 ([..]): the file `foo` has changed ([..]) @@ -3463,7 +3463,7 @@ fn rebuild_only_on_explicit_paths() { // .. as does deleting a file println!("run bar delete"); fs::remove_file(p.root().join("bar")).unwrap(); - p.cargo("build -v") + p.cargo("check -v") .with_stderr( "\ [DIRTY] foo v0.5.0 ([..]): the file `bar` is missing @@ -3567,7 +3567,7 @@ fn please_respect_the_dag() { ) .build(); - p.cargo("build -v") + p.cargo("check -v") .with_stderr_contains("[RUNNING] `rustc [..] -L native=foo -L native=bar[..]`") .run(); } @@ -3606,7 +3606,7 @@ fn non_utf8_output() { .file("src/main.rs", "#[cfg(foo)] fn main() {}") .build(); - p.cargo("build -v").run(); + p.cargo("check -v").run(); } #[cargo_test] @@ -3646,7 +3646,7 @@ fn custom_target_dir() { .file("a/src/lib.rs", "") .build(); - p.cargo("build -v").run(); + p.cargo("check -v").run(); } #[cargo_test] @@ -3702,7 +3702,7 @@ fn panic_abort_with_build_scripts() { .file("b/src/lib.rs", "") .build(); - p.cargo("build -v --release").run(); + p.cargo("check -v --release").run(); p.root().join("target").rm_rf(); @@ -3736,7 +3736,7 @@ fn warnings_emitted() { ) .build(); - p.cargo("build -v") + p.cargo("check -v") .with_stderr( "\ [COMPILING] foo v0.5.0 ([..]) @@ -3777,7 +3777,7 @@ fn warnings_emitted_when_build_script_panics() { ) .build(); - p.cargo("build") + p.cargo("check") .with_status(101) .with_stdout("") .with_stderr_contains("warning: foo\nwarning: bar") @@ -3825,7 +3825,7 @@ fn warnings_hidden_for_upstream() { .file("src/lib.rs", "") .build(); - p.cargo("build -v") + p.cargo("check -v") .with_stderr( "\ [UPDATING] `[..]` index @@ -3835,7 +3835,7 @@ fn warnings_hidden_for_upstream() { [RUNNING] `rustc [..]` [RUNNING] `[..]` [RUNNING] `rustc [..]` -[COMPILING] foo v0.5.0 ([..]) +[CHECKING] foo v0.5.0 ([..]) [RUNNING] `rustc [..]` [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", @@ -3884,7 +3884,7 @@ fn warnings_printed_on_vv() { .file("src/lib.rs", "") .build(); - p.cargo("build -vv") + p.cargo("check -vv") .with_stderr( "\ [UPDATING] `[..]` index @@ -3896,7 +3896,7 @@ fn warnings_printed_on_vv() { warning: foo warning: bar [RUNNING] `[..] rustc [..]` -[COMPILING] foo v0.5.0 ([..]) +[CHECKING] foo v0.5.0 ([..]) [RUNNING] `[..] rustc [..]` [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", @@ -3931,7 +3931,7 @@ fn output_shows_on_vv() { ) .build(); - p.cargo("build -vv") + p.cargo("check -vv") .with_stdout("[foo 0.5.0] stdout") .with_stderr( "\ @@ -3983,7 +3983,7 @@ fn links_with_dots() { ) .build(); - p.cargo("build -v") + p.cargo("check -v") .with_stderr_contains("[RUNNING] `rustc --crate-name foo [..] [..] -L foo[..]`") .run(); } @@ -4276,7 +4276,7 @@ fn deterministic_rustc_dependency_flags() { .file("src/main.rs", "fn main() {}") .build(); - p.cargo("build -v") + p.cargo("check -v") .with_stderr_contains( "\ [RUNNING] `rustc --crate-name foo [..] -L native=test1 -L native=test2 \ @@ -4337,7 +4337,7 @@ fn links_duplicates_with_cycle() { .file("b/src/lib.rs", "") .build(); - p.cargo("build").with_status(101) + p.cargo("check").with_status(101) .with_stderr("\ error: failed to select a version for `a`. ... required by package `foo v0.5.0 ([..])` @@ -4651,8 +4651,8 @@ fn using_rerun_if_changed_does_not_rebuild() { .file("src/lib.rs", "") .build(); - p.cargo("build").run(); - p.cargo("build").with_stderr("[FINISHED] [..]").run(); + p.cargo("check").run(); + p.cargo("check").with_stderr("[FINISHED] [..]").run(); } #[cargo_test] @@ -4720,11 +4720,11 @@ fn links_interrupted_can_restart() { ) .build(); - p.cargo("build").run(); + p.cargo("check").run(); // Simulate the user hitting Ctrl-C during a build. p.change_file("abort", ""); // Set SOMEVAR to trigger a rebuild. - p.cargo("build") + p.cargo("check") .env("SOMEVAR", "1") .with_stderr_contains("[..]Crash![..]") .with_status(101) @@ -4732,7 +4732,7 @@ fn links_interrupted_can_restart() { fs::remove_file(p.root().join("abort")).unwrap(); // Try again without aborting the script. // ***This is currently broken, the script does not re-run. - p.cargo("build -v") + p.cargo("check -v") .env("SOMEVAR", "1") .with_stderr_contains("[RUNNING] [..]/foo-[..]/build-script-build[..]") .run(); @@ -5127,7 +5127,7 @@ fn wrong_output() { ) .build(); - p.cargo("build") + p.cargo("check") .with_status(101) .with_stderr( "\ @@ -5164,5 +5164,5 @@ fn custom_build_closes_stdin() { }"#, ) .build(); - p.cargo("build").run(); + p.cargo("check").run(); } From 65d968b1e44800477d42c3d425ae497b135a9557 Mon Sep 17 00:00:00 2001 From: Scott Schafer Date: Wed, 15 Feb 2023 15:49:38 -0600 Subject: [PATCH 05/62] chore: update `build_script_env` test to use check --- tests/testsuite/build_script_env.rs | 34 ++++++++++++++--------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/tests/testsuite/build_script_env.rs b/tests/testsuite/build_script_env.rs index 119e4210a2d1..6ad4ab97b197 100644 --- a/tests/testsuite/build_script_env.rs +++ b/tests/testsuite/build_script_env.rs @@ -18,7 +18,7 @@ fn rerun_if_env_changes() { ) .build(); - p.cargo("build") + p.cargo("check") .with_stderr( "\ [COMPILING] foo v0.0.1 ([..]) @@ -26,7 +26,7 @@ fn rerun_if_env_changes() { ", ) .run(); - p.cargo("build") + p.cargo("check") .env("FOO", "bar") .with_stderr( "\ @@ -35,7 +35,7 @@ fn rerun_if_env_changes() { ", ) .run(); - p.cargo("build") + p.cargo("check") .env("FOO", "baz") .with_stderr( "\ @@ -44,11 +44,11 @@ fn rerun_if_env_changes() { ", ) .run(); - p.cargo("build") + p.cargo("check") .env("FOO", "baz") .with_stderr("[FINISHED] [..]") .run(); - p.cargo("build") + p.cargo("check") .with_stderr( "\ [COMPILING] foo v0.0.1 ([..]) @@ -74,7 +74,7 @@ fn rerun_if_env_or_file_changes() { .file("foo", "") .build(); - p.cargo("build") + p.cargo("check") .with_stderr( "\ [COMPILING] foo v0.0.1 ([..]) @@ -82,7 +82,7 @@ fn rerun_if_env_or_file_changes() { ", ) .run(); - p.cargo("build") + p.cargo("check") .env("FOO", "bar") .with_stderr( "\ @@ -91,13 +91,13 @@ fn rerun_if_env_or_file_changes() { ", ) .run(); - p.cargo("build") + p.cargo("check") .env("FOO", "bar") .with_stderr("[FINISHED] [..]") .run(); sleep_ms(1000); p.change_file("foo", ""); - p.cargo("build") + p.cargo("check") .env("FOO", "bar") .with_stderr( "\ @@ -121,7 +121,7 @@ fn rustc_bootstrap() { .file("build.rs", build_rs) .build(); // RUSTC_BOOTSTRAP unset on stable should error - p.cargo("build") + p.cargo("check") .with_stderr_contains("error: Cannot set `RUSTC_BOOTSTRAP=1` [..]") .with_stderr_contains( "help: [..] set the environment variable `RUSTC_BOOTSTRAP=has_dashes` [..]", @@ -129,7 +129,7 @@ fn rustc_bootstrap() { .with_status(101) .run(); // nightly should warn whether or not RUSTC_BOOTSTRAP is set - p.cargo("build") + p.cargo("check") .masquerade_as_nightly_cargo(&["RUSTC_BOOTSTRAP"]) // NOTE: uses RUSTC_BOOTSTRAP so it will be propagated to rustc // (this matters when tests are being run with a beta or stable cargo) @@ -137,12 +137,12 @@ fn rustc_bootstrap() { .with_stderr_contains("warning: Cannot set `RUSTC_BOOTSTRAP=1` [..]") .run(); // RUSTC_BOOTSTRAP set to the name of the library should warn - p.cargo("build") + p.cargo("check") .env("RUSTC_BOOTSTRAP", "has_dashes") .with_stderr_contains("warning: Cannot set `RUSTC_BOOTSTRAP=1` [..]") .run(); // RUSTC_BOOTSTRAP set to some random value should error - p.cargo("build") + p.cargo("check") .env("RUSTC_BOOTSTRAP", "bar") .with_stderr_contains("error: Cannot set `RUSTC_BOOTSTRAP=1` [..]") .with_stderr_contains( @@ -158,7 +158,7 @@ fn rustc_bootstrap() { .file("build.rs", build_rs) .build(); // nightly should warn when there's no library whether or not RUSTC_BOOTSTRAP is set - p.cargo("build") + p.cargo("check") .masquerade_as_nightly_cargo(&["RUSTC_BOOTSTRAP"]) // NOTE: uses RUSTC_BOOTSTRAP so it will be propagated to rustc // (this matters when tests are being run with a beta or stable cargo) @@ -166,7 +166,7 @@ fn rustc_bootstrap() { .with_stderr_contains("warning: Cannot set `RUSTC_BOOTSTRAP=1` [..]") .run(); // RUSTC_BOOTSTRAP conditionally set when there's no library should error (regardless of the value) - p.cargo("build") + p.cargo("check") .env("RUSTC_BOOTSTRAP", "foo") .with_stderr_contains("error: Cannot set `RUSTC_BOOTSTRAP=1` [..]") .with_stderr_contains("help: [..] set the environment variable `RUSTC_BOOTSTRAP=1` [..]") @@ -202,7 +202,7 @@ fn build_script_sees_cfg_target_feature() { .file("build.rs", build_rs) .build(); - p.cargo("build -vv") + p.cargo("check -vv") .with_stderr_contains("[foo 0.0.1] CARGO_CFG_TARGET_FEATURE=[..]sse4.2[..]") .with_stderr_contains("[..]-Ctarget-feature=[..]+sse4.2[..]") .run(); @@ -233,7 +233,7 @@ fn cfg_paradox() { .file("build.rs", build_rs) .build(); - p.cargo("build -vv") + p.cargo("check -vv") .with_stderr_contains("[WARNING] non-trivial mutual dependency between target-specific configuration and RUSTFLAGS") .with_stderr_contains("[foo 0.0.1] cfg!(bertrand)=true") .with_stderr_contains("[..]--cfg=bertrand[..]") From ab73fec37670cb4db300b1cbbe6cc90715c4dd94 Mon Sep 17 00:00:00 2001 From: Scott Schafer Date: Wed, 15 Feb 2023 15:51:24 -0600 Subject: [PATCH 06/62] chore: update `build_script_extra_link_arg` test to use check --- tests/testsuite/build_script_extra_link_arg.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/testsuite/build_script_extra_link_arg.rs b/tests/testsuite/build_script_extra_link_arg.rs index ade262fec7fc..2a4b74e9b558 100644 --- a/tests/testsuite/build_script_extra_link_arg.rs +++ b/tests/testsuite/build_script_extra_link_arg.rs @@ -22,7 +22,7 @@ fn build_script_extra_link_arg_bin() { ) .build(); - p.cargo("build -v") + p.cargo("check -v") .without_status() .with_stderr_contains( "[RUNNING] `rustc --crate-name foo [..]-C link-arg=--this-is-a-bogus-flag[..]", @@ -61,7 +61,7 @@ fn build_script_extra_link_arg_bin_single() { ) .build(); - p.cargo("build -v") + p.cargo("check -v") .without_status() .with_stderr_contains( "[RUNNING] `rustc --crate-name foo [..]-C link-arg=--bogus-flag-all -C link-arg=--bogus-flag-foo[..]", @@ -87,7 +87,7 @@ fn build_script_extra_link_arg() { ) .build(); - p.cargo("build -v") + p.cargo("check -v") .without_status() .with_stderr_contains( "[RUNNING] `rustc --crate-name foo [..]-C link-arg=--this-is-a-bogus-flag[..]", @@ -197,7 +197,7 @@ fn cdylib_link_arg_transitive() { "#, ) .build(); - p.cargo("build -v") + p.cargo("check -v") .without_status() .with_stderr_contains( "\ @@ -210,7 +210,7 @@ warning: cargo:rustc-link-arg-cdylib was specified in the build script of bar v1 Allowing this was an unintended change in the 1.50 release, and may become an error in \ the future. For more information, see . [RUNNING] `rustc --crate-name bar bar/src/lib.rs [..] -[COMPILING] foo v0.1.0 [..] +[CHECKING] foo v0.1.0 [..] [RUNNING] `rustc --crate-name foo src/lib.rs [..]-C link-arg=--bogus[..]` ", ) @@ -254,7 +254,7 @@ fn link_arg_transitive_not_allowed() { .file("src/lib.rs", "") .build(); - p.cargo("build -v") + p.cargo("check -v") .with_stderr( "\ [UPDATING] [..] @@ -264,7 +264,7 @@ fn link_arg_transitive_not_allowed() { [RUNNING] `rustc --crate-name build_script_build [..] [RUNNING] `[..]/build-script-build[..] [RUNNING] `rustc --crate-name bar [..] -[COMPILING] foo v0.1.0 [..] +[CHECKING] foo v0.1.0 [..] [RUNNING] `rustc --crate-name foo src/lib.rs [..] [FINISHED] dev [..] ", @@ -367,7 +367,7 @@ fn build_script_extra_link_arg_examples() { ) .build(); - p.cargo("build -v --examples") + p.cargo("check -v --examples") .without_status() .with_stderr_contains( "[RUNNING] `rustc --crate-name example_foo [..]-C link-arg=--this-is-a-bogus-flag[..]", From fd8ebad7301ffa229fd81facb4a01f4b4adfda80 Mon Sep 17 00:00:00 2001 From: Scott Schafer Date: Wed, 15 Feb 2023 15:53:16 -0600 Subject: [PATCH 07/62] chore: update `cache_messages` test to use check --- tests/testsuite/cache_messages.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/testsuite/cache_messages.rs b/tests/testsuite/cache_messages.rs index 526abe52b40a..b856ed1525c3 100644 --- a/tests/testsuite/cache_messages.rs +++ b/tests/testsuite/cache_messages.rs @@ -297,7 +297,7 @@ fn doesnt_create_extra_files() { .file("src/main.rs", "fn main() {}") .build(); - p.cargo("build").run(); + p.cargo("check").run(); assert_eq!( p.glob("target/debug/.fingerprint/foo-*/output-*").count(), @@ -311,7 +311,7 @@ fn doesnt_create_extra_files() { sleep_ms(1000); } p.change_file("src/lib.rs", "fn unused() {}"); - p.cargo("build").run(); + p.cargo("check").run(); assert_eq!( p.glob("target/debug/.fingerprint/foo-*/output-*").count(), 1 @@ -475,14 +475,14 @@ fn wacky_hashless_fingerprint() { .file("src/bin/a.rs", "fn main() { let unused = 1; }") .file("src/bin/b.rs", "fn main() {}") .build(); - p.cargo("build --bin b") + p.cargo("check --bin b") .with_stderr_does_not_contain("[..]unused[..]") .run(); - p.cargo("build --bin a") + p.cargo("check --bin a") .with_stderr_contains("[..]unused[..]") .run(); // This should not pick up the cache from `a`. - p.cargo("build --bin b") + p.cargo("check --bin b") .with_stderr_does_not_contain("[..]unused[..]") .run(); } From 92c885f4565735d69fda2629d5ac0f4fa13770b6 Mon Sep 17 00:00:00 2001 From: Scott Schafer Date: Wed, 15 Feb 2023 15:57:30 -0600 Subject: [PATCH 08/62] chore: update `cargo_env_config` test to use check --- tests/testsuite/cargo_env_config.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/testsuite/cargo_env_config.rs b/tests/testsuite/cargo_env_config.rs index 1872d56c0047..d80c38d0e4bd 100644 --- a/tests/testsuite/cargo_env_config.rs +++ b/tests/testsuite/cargo_env_config.rs @@ -51,7 +51,7 @@ fn env_invalid() { ) .build(); - p.cargo("build") + p.cargo("check") .with_status(101) .with_stderr_contains("[..]could not load config key `env.ENV_TEST_BOOL`") .run(); @@ -77,7 +77,7 @@ fn env_no_cargo_home() { ) .build(); - p.cargo("build") + p.cargo("check") .with_status(101) .with_stderr_contains("[..]setting the `CARGO_HOME` environment variable is not supported in the `[env]` configuration table") .run(); From b5a3360b2003e8eb3f59c2f58a85ea32fea7c5a0 Mon Sep 17 00:00:00 2001 From: Scott Schafer Date: Wed, 15 Feb 2023 16:08:55 -0600 Subject: [PATCH 09/62] chore: update `cargo_features` tests to use check --- tests/testsuite/cargo_features.rs | 70 +++++++++++++++---------------- 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/tests/testsuite/cargo_features.rs b/tests/testsuite/cargo_features.rs index 46bafb111aa7..88817b736a89 100644 --- a/tests/testsuite/cargo_features.rs +++ b/tests/testsuite/cargo_features.rs @@ -18,7 +18,7 @@ fn feature_required() { ) .file("src/lib.rs", "") .build(); - p.cargo("build") + p.cargo("check") .masquerade_as_nightly_cargo(&["test-dummy-unstable"]) .with_status(101) .with_stderr( @@ -42,7 +42,7 @@ Caused by: .run(); // Same, but stable. - p.cargo("build") + p.cargo("check") .with_status(101) .with_stderr( "\ @@ -97,7 +97,7 @@ fn feature_required_dependency() { .file("src/lib.rs", "") .build(); - p.cargo("build") + p.cargo("check") .masquerade_as_nightly_cargo(&["test-dummy-unstable"]) .with_status(101) .with_stderr( @@ -126,7 +126,7 @@ Caused by: .run(); // Same, but stable. - p.cargo("build") + p.cargo("check") .with_status(101) .with_stderr( "\ @@ -173,7 +173,7 @@ fn unknown_feature() { ) .file("src/lib.rs", "") .build(); - p.cargo("build") + p.cargo("check") .with_status(101) .with_stderr( "\ @@ -202,13 +202,13 @@ fn stable_feature_warns() { ) .file("src/lib.rs", "") .build(); - p.cargo("build") + p.cargo("check") .with_stderr( "\ warning: the cargo feature `test-dummy-stable` has been stabilized in the 1.0 \ release and is no longer necessary to be listed in the manifest See https://doc.rust-lang.org/[..]cargo/ for more information about using this feature. -[COMPILING] a [..] +[CHECKING] a [..] [FINISHED] [..] ", ) @@ -233,17 +233,17 @@ fn allow_features() { .file("src/lib.rs", "") .build(); - p.cargo("-Zallow-features=test-dummy-unstable build") + p.cargo("-Zallow-features=test-dummy-unstable check") .masquerade_as_nightly_cargo(&["allow-features", "test-dummy-unstable"]) .with_stderr( "\ -[COMPILING] a [..] +[CHECKING] a [..] [FINISHED] [..] ", ) .run(); - p.cargo("-Zallow-features=test-dummy-unstable,print-im-a-teapot -Zprint-im-a-teapot build") + p.cargo("-Zallow-features=test-dummy-unstable,print-im-a-teapot -Zprint-im-a-teapot check") .masquerade_as_nightly_cargo(&[ "allow-features", "test-dummy-unstable", @@ -252,7 +252,7 @@ fn allow_features() { .with_stdout("im-a-teapot = true") .run(); - p.cargo("-Zallow-features=test-dummy-unstable -Zprint-im-a-teapot build") + p.cargo("-Zallow-features=test-dummy-unstable -Zprint-im-a-teapot check") .masquerade_as_nightly_cargo(&[ "allow-features", "test-dummy-unstable", @@ -266,7 +266,7 @@ error: the feature `print-im-a-teapot` is not in the list of allowed features: [ ) .run(); - p.cargo("-Zallow-features= build") + p.cargo("-Zallow-features= check") .masquerade_as_nightly_cargo(&["allow-features", "test-dummy-unstable"]) .with_status(101) .with_stderr( @@ -300,17 +300,17 @@ fn allow_features_to_rustc() { ) .build(); - p.cargo("-Zallow-features= build") + p.cargo("-Zallow-features= check") .masquerade_as_nightly_cargo(&["allow-features"]) .with_status(101) .with_stderr_contains("[..]E0725[..]") .run(); - p.cargo("-Zallow-features=test_2018_feature build") + p.cargo("-Zallow-features=test_2018_feature check") .masquerade_as_nightly_cargo(&["allow-features"]) .with_stderr( "\ -[COMPILING] a [..] +[CHECKING] a [..] [FINISHED] [..] ", ) @@ -342,7 +342,7 @@ fn allow_features_in_cfg() { .file("src/lib.rs", "") .build(); - p.cargo("build") + p.cargo("check") .masquerade_as_nightly_cargo(&[ "allow-features", "test-dummy-unstable", @@ -350,13 +350,13 @@ fn allow_features_in_cfg() { ]) .with_stderr( "\ -[COMPILING] a [..] +[CHECKING] a [..] [FINISHED] [..] ", ) .run(); - p.cargo("-Zprint-im-a-teapot build") + p.cargo("-Zprint-im-a-teapot check") .masquerade_as_nightly_cargo(&[ "allow-features", "test-dummy-unstable", @@ -366,7 +366,7 @@ fn allow_features_in_cfg() { .with_stderr("[FINISHED] [..]") .run(); - p.cargo("-Zunstable-options build") + p.cargo("-Zunstable-options check") .masquerade_as_nightly_cargo(&["allow-features", "test-dummy-unstable", "print-im-a-teapot"]) .with_status(101) .with_stderr( @@ -377,7 +377,7 @@ error: the feature `unstable-options` is not in the list of allowed features: [p .run(); // -Zallow-features overrides .cargo/config - p.cargo("-Zallow-features=test-dummy-unstable -Zprint-im-a-teapot build") + p.cargo("-Zallow-features=test-dummy-unstable -Zprint-im-a-teapot check") .masquerade_as_nightly_cargo(&[ "allow-features", "test-dummy-unstable", @@ -391,7 +391,7 @@ error: the feature `print-im-a-teapot` is not in the list of allowed features: [ ) .run(); - p.cargo("-Zallow-features= build") + p.cargo("-Zallow-features= check") .masquerade_as_nightly_cargo(&[ "allow-features", "test-dummy-unstable", @@ -426,17 +426,17 @@ fn nightly_feature_requires_nightly() { ) .file("src/lib.rs", "") .build(); - p.cargo("build") + p.cargo("check") .masquerade_as_nightly_cargo(&["test-dummy-unstable"]) .with_stderr( "\ -[COMPILING] a [..] +[CHECKING] a [..] [FINISHED] [..] ", ) .run(); - p.cargo("build") + p.cargo("check") .with_status(101) .with_stderr( "\ @@ -483,18 +483,18 @@ fn nightly_feature_requires_nightly_in_dep() { ) .file("a/src/lib.rs", "") .build(); - p.cargo("build") + p.cargo("check") .masquerade_as_nightly_cargo(&["test-dummy-unstable"]) .with_stderr( "\ -[COMPILING] a [..] -[COMPILING] b [..] +[CHECKING] a [..] +[CHECKING] b [..] [FINISHED] [..] ", ) .run(); - p.cargo("build") + p.cargo("check") .with_status(101) .with_stderr( "\ @@ -537,17 +537,17 @@ fn cant_publish() { ) .file("src/lib.rs", "") .build(); - p.cargo("build") + p.cargo("check") .masquerade_as_nightly_cargo(&["test-dummy-unstable"]) .with_stderr( "\ -[COMPILING] a [..] +[CHECKING] a [..] [FINISHED] [..] ", ) .run(); - p.cargo("build") + p.cargo("check") .with_status(101) .with_stderr( "\ @@ -581,7 +581,7 @@ fn z_flags_rejected() { ) .file("src/lib.rs", "") .build(); - p.cargo("build -Zprint-im-a-teapot") + p.cargo("check -Zprint-im-a-teapot") .with_status(101) .with_stderr( "error: the `-Z` flag is only accepted on the nightly \ @@ -590,18 +590,18 @@ fn z_flags_rejected() { ) .run(); - p.cargo("build -Zarg") + p.cargo("check -Zarg") .masquerade_as_nightly_cargo(&["test-dummy-unstable"]) .with_status(101) .with_stderr("error: unknown `-Z` flag specified: arg") .run(); - p.cargo("build -Zprint-im-a-teapot") + p.cargo("check -Zprint-im-a-teapot") .masquerade_as_nightly_cargo(&["test-dummy-unstable"]) .with_stdout("im-a-teapot = true\n") .with_stderr( "\ -[COMPILING] a [..] +[CHECKING] a [..] [FINISHED] [..] ", ) From b183a160200f33e29d407a73a68d298ea95277a1 Mon Sep 17 00:00:00 2001 From: Scott Schafer Date: Wed, 15 Feb 2023 16:12:57 -0600 Subject: [PATCH 10/62] chore: update `cfg` tests to use check --- tests/testsuite/cfg.rs | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/tests/testsuite/cfg.rs b/tests/testsuite/cfg.rs index aac5c02b65a4..dcce65402596 100644 --- a/tests/testsuite/cfg.rs +++ b/tests/testsuite/cfg.rs @@ -25,7 +25,7 @@ fn cfg_easy() { .file("b/Cargo.toml", &basic_manifest("b", "0.0.1")) .file("b/src/lib.rs", "") .build(); - p.cargo("build -v").run(); + p.cargo("check -v").run(); } #[cargo_test] @@ -51,10 +51,10 @@ fn dont_include() { .file("b/Cargo.toml", &basic_manifest("b", "0.0.1")) .file("b/src/lib.rs", "") .build(); - p.cargo("build") + p.cargo("check") .with_stderr( "\ -[COMPILING] a v0.0.1 ([..]) +[CHECKING] a v0.0.1 ([..]) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", ) @@ -88,16 +88,16 @@ fn works_through_the_registry() { ) .build(); - p.cargo("build") + p.cargo("check") .with_stderr( "\ [UPDATING] [..] index [DOWNLOADING] crates ... [DOWNLOADED] [..] [DOWNLOADED] [..] -[COMPILING] baz v0.1.0 -[COMPILING] bar v0.1.0 -[COMPILING] foo v0.0.1 ([..]) +[CHECKING] baz v0.1.0 +[CHECKING] bar v0.1.0 +[CHECKING] foo v0.0.1 ([..]) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", ) @@ -136,14 +136,14 @@ fn ignore_version_from_other_platform() { ) .build(); - p.cargo("build") + p.cargo("check") .with_stderr( "\ [UPDATING] [..] index [DOWNLOADING] crates ... [DOWNLOADED] [..] -[COMPILING] bar v0.1.0 -[COMPILING] foo v0.0.1 ([..]) +[CHECKING] bar v0.1.0 +[CHECKING] foo v0.0.1 ([..]) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", ) @@ -168,7 +168,7 @@ fn bad_target_spec() { .file("src/lib.rs", "") .build(); - p.cargo("build") + p.cargo("check") .with_status(101) .with_stderr( "\ @@ -199,7 +199,7 @@ fn bad_target_spec2() { .file("src/lib.rs", "") .build(); - p.cargo("build") + p.cargo("check") .with_status(101) .with_stderr( "\ @@ -245,7 +245,7 @@ fn multiple_match_ok() { .file("b/Cargo.toml", &basic_manifest("b", "0.0.1")) .file("b/src/lib.rs", "") .build(); - p.cargo("build -v").run(); + p.cargo("check -v").run(); } #[cargo_test] @@ -267,7 +267,7 @@ fn any_ok() { .file("b/Cargo.toml", &basic_manifest("b", "0.0.1")) .file("b/src/lib.rs", "") .build(); - p.cargo("build -v").run(); + p.cargo("check -v").run(); } // https://github.com/rust-lang/cargo/issues/5313 @@ -300,7 +300,7 @@ fn cfg_looks_at_rustflags_for_target() { .file("b/src/lib.rs", "pub fn foo() {}") .build(); - p.cargo("build --target x86_64-unknown-linux-gnu") + p.cargo("check --target x86_64-unknown-linux-gnu") .env("RUSTFLAGS", "--cfg with_b") .run(); } @@ -385,7 +385,7 @@ fn bad_cfg_discovery() { let p = project().file("src/lib.rs", "").build(); - p.cargo("build") + p.cargo("check") .env("RUSTC", &funky_rustc) .env("FUNKY_MODE", "bad-version") .with_status(101) @@ -398,7 +398,7 @@ foo ) .run(); - p.cargo("build") + p.cargo("check") .env("RUSTC", &funky_rustc) .env("FUNKY_MODE", "no-crate-types") .with_status(101) @@ -411,7 +411,7 @@ command was: `[..]compiler[..] --crate-name ___ [..]` ) .run(); - p.cargo("build") + p.cargo("check") .env("RUSTC", &funky_rustc) .env("FUNKY_MODE", "no-sysroot") .with_status(101) @@ -432,7 +432,7 @@ command was: `[..]compiler[..]--crate-type [..]` ) .run(); - p.cargo("build") + p.cargo("check") .env("RUSTC", &funky_rustc) .env("FUNKY_MODE", "no-split-debuginfo") .with_status(101) @@ -454,7 +454,7 @@ command was: `[..]compiler[..]--crate-type [..]` ) .run(); - p.cargo("build") + p.cargo("check") .env("RUSTC", &funky_rustc) .env("FUNKY_MODE", "bad-cfg") .with_status(101) From d245d0bf063ec2293778a86994a73236378641b4 Mon Sep 17 00:00:00 2001 From: Scott Schafer Date: Wed, 15 Feb 2023 16:14:38 -0600 Subject: [PATCH 11/62] chore: update `check_cfg` tests to use check --- tests/testsuite/check_cfg.rs | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/tests/testsuite/check_cfg.rs b/tests/testsuite/check_cfg.rs index 8d2baed9c711..c35da637de3e 100644 --- a/tests/testsuite/check_cfg.rs +++ b/tests/testsuite/check_cfg.rs @@ -47,7 +47,7 @@ fn features() { .file("src/main.rs", "fn main() {}") .build(); - p.cargo("build -v -Zcheck-cfg=features") + p.cargo("check -v -Zcheck-cfg=features") .masquerade_as_nightly_cargo(&["check-cfg"]) .with_stderr_contains(x!("rustc" => "values" of "feature" with "f_a" "f_b")) .run(); @@ -76,7 +76,7 @@ fn features_with_deps() { .file("bar/src/lib.rs", "#[allow(dead_code)] fn bar() {}") .build(); - p.cargo("build -v -Zcheck-cfg=features") + p.cargo("check -v -Zcheck-cfg=features") .masquerade_as_nightly_cargo(&["check-cfg"]) .with_stderr_contains(x!("rustc" => "values" of "feature")) .with_stderr_contains(x!("rustc" => "values" of "feature" with "f_a" "f_b")) @@ -107,7 +107,7 @@ fn features_with_opt_deps() { .file("bar/src/lib.rs", "#[allow(dead_code)] fn bar() {}") .build(); - p.cargo("build -v -Zcheck-cfg=features") + p.cargo("check -v -Zcheck-cfg=features") .masquerade_as_nightly_cargo(&["check-cfg"]) .with_stderr_contains(x!("rustc" => "values" of "feature")) .with_stderr_contains(x!("rustc" => "values" of "feature" with "bar" "default" "f_a" "f_b")) @@ -137,7 +137,7 @@ fn features_with_namespaced_features() { .file("bar/src/lib.rs", "#[allow(dead_code)] fn bar() {}") .build(); - p.cargo("build -v -Zcheck-cfg=features") + p.cargo("check -v -Zcheck-cfg=features") .masquerade_as_nightly_cargo(&["check-cfg"]) .with_stderr_contains(x!("rustc" => "values" of "feature" with "f_a" "f_b")) .run(); @@ -150,7 +150,7 @@ fn well_known_names() { .file("src/main.rs", "fn main() {}") .build(); - p.cargo("build -v -Zcheck-cfg=names") + p.cargo("check -v -Zcheck-cfg=names") .masquerade_as_nightly_cargo(&["check-cfg"]) .with_stderr_contains(x!("rustc" => "names")) .run(); @@ -163,7 +163,7 @@ fn well_known_values() { .file("src/main.rs", "fn main() {}") .build(); - p.cargo("build -v -Zcheck-cfg=values") + p.cargo("check -v -Zcheck-cfg=values") .masquerade_as_nightly_cargo(&["check-cfg"]) .with_stderr_contains(x!("rustc" => "values")) .run(); @@ -187,7 +187,7 @@ fn cli_all_options() { .file("src/main.rs", "fn main() {}") .build(); - p.cargo("build -v -Zcheck-cfg=features,names,values") + p.cargo("check -v -Zcheck-cfg=features,names,values") .masquerade_as_nightly_cargo(&["check-cfg"]) .with_stderr_contains(x!("rustc" => "names")) .with_stderr_contains(x!("rustc" => "values")) @@ -394,7 +394,7 @@ fn build_script_feedback() { ) .build(); - p.cargo("build -v -Zcheck-cfg=output") + p.cargo("check -v -Zcheck-cfg=output") .masquerade_as_nightly_cargo(&["check-cfg"]) .with_stderr_contains(x!("rustc" => "names" of "foo")) .run(); @@ -465,7 +465,7 @@ fn build_script_override() { ) .build(); - p.cargo("build -v -Zcheck-cfg=output") + p.cargo("check -v -Zcheck-cfg=output") .with_stderr_contains(x!("rustc" => "names" of "foo")) .masquerade_as_nightly_cargo(&["check-cfg"]) .run(); @@ -551,7 +551,7 @@ fn config_valid() { ) .build(); - p.cargo("build -v -Zcheck-cfg=features,names,values") + p.cargo("check -v -Zcheck-cfg=features,names,values") .masquerade_as_nightly_cargo(&["check-cfg"]) .with_stderr_contains(x!("rustc" => "names")) .with_stderr_contains(x!("rustc" => "values")) @@ -580,7 +580,7 @@ fn config_invalid() { ) .build(); - p.cargo("build") + p.cargo("check") .masquerade_as_nightly_cargo(&["check-cfg"]) .with_stderr_contains("error: unstable check-cfg only takes `features`, `names`, `values` or `output` as valid inputs") .with_status(101) From 340ef738f6eaac47bdb407da9d569330aae2336a Mon Sep 17 00:00:00 2001 From: Scott Schafer Date: Wed, 15 Feb 2023 16:18:16 -0600 Subject: [PATCH 12/62] chore: update `clean` tests to use check --- tests/testsuite/clean.rs | 47 ++++++++++++++++++++-------------------- 1 file changed, 23 insertions(+), 24 deletions(-) diff --git a/tests/testsuite/clean.rs b/tests/testsuite/clean.rs index e0885fd269ea..837114639626 100644 --- a/tests/testsuite/clean.rs +++ b/tests/testsuite/clean.rs @@ -15,7 +15,7 @@ fn cargo_clean_simple() { .file("src/foo.rs", &main_file(r#""i am foo""#, &[])) .build(); - p.cargo("build").run(); + p.cargo("check").run(); assert!(p.build_dir().is_dir()); p.cargo("clean").run(); @@ -30,7 +30,7 @@ fn different_dir() { .file("src/bar/a.rs", "") .build(); - p.cargo("build").run(); + p.cargo("check").run(); assert!(p.build_dir().is_dir()); p.cargo("clean").cwd("src").with_stdout("").run(); @@ -147,7 +147,7 @@ fn clean_p_only_cleans_specified_package() { let fingerprint_path = &p.build_dir().join("debug").join(".fingerprint"); - p.cargo("build -p foo -p foo_core -p foo-base").run(); + p.cargo("check -p foo -p foo_core -p foo-base").run(); let mut fingerprint_names = get_fingerprints_without_hashes(fingerprint_path); @@ -223,22 +223,22 @@ fn clean_release() { .file("a/src/lib.rs", "") .build(); - p.cargo("build --release").run(); + p.cargo("check --release").run(); p.cargo("clean -p foo").run(); - p.cargo("build --release").with_stdout("").run(); + p.cargo("check --release").with_stdout("").run(); p.cargo("clean -p foo --release").run(); - p.cargo("build --release") + p.cargo("check --release") .with_stderr( "\ -[COMPILING] foo v0.0.1 ([..]) +[CHECKING] foo v0.0.1 ([..]) [FINISHED] release [optimized] target(s) in [..] ", ) .run(); - p.cargo("build").run(); + p.cargo("check").run(); p.cargo("clean").arg("--release").run(); assert!(p.build_dir().is_dir()); @@ -311,9 +311,9 @@ fn build_script() { .file("a/src/lib.rs", "") .build(); - p.cargo("build").env("FIRST", "1").run(); + p.cargo("check").env("FIRST", "1").run(); p.cargo("clean -p foo").run(); - p.cargo("build -v") + p.cargo("check -v") .with_stderr( "\ [COMPILING] foo v0.0.1 ([..]) @@ -353,9 +353,9 @@ fn clean_git() { .file("src/main.rs", "fn main() {}") .build(); - p.cargo("build").run(); + p.cargo("check").run(); p.cargo("clean -p dep").with_stdout("").run(); - p.cargo("build").run(); + p.cargo("check").run(); } #[cargo_test] @@ -378,9 +378,9 @@ fn registry() { Package::new("bar", "0.1.0").publish(); - p.cargo("build").run(); + p.cargo("check").run(); p.cargo("clean -p bar").with_stdout("").run(); - p.cargo("build").run(); + p.cargo("check").run(); } #[cargo_test] @@ -402,11 +402,10 @@ fn clean_verbose() { Package::new("bar", "0.1.0").publish(); - p.cargo("build").run(); + p.cargo("check").run(); let mut expected = String::from( "\ [REMOVING] [..]target/debug/.fingerprint/bar[..] -[REMOVING] [..]target/debug/deps/libbar[..].rlib [REMOVING] [..]target/debug/deps/bar-[..].d [REMOVING] [..]target/debug/deps/libbar[..].rmeta ", @@ -420,7 +419,7 @@ fn clean_verbose() { p.cargo("clean -p bar --verbose") .with_stderr_unordered(&expected) .run(); - p.cargo("build").run(); + p.cargo("check").run(); } #[cargo_test] @@ -470,7 +469,7 @@ fn package_cleans_all_the_things() { ) .file("src/lib.rs", "") .build(); - p.cargo("build").run(); + p.cargo("check").run(); p.cargo("clean -p foo-bar").run(); assert_all_clean(&p.build_dir()); } @@ -512,7 +511,7 @@ fn package_cleans_all_the_things() { .file("build.rs", "fn main() {}") .build(); - p.cargo("build --all-targets") + p.cargo("check --all-targets") .env("CARGO_INCREMENTAL", "1") .run(); p.cargo("test --all-targets") @@ -525,7 +524,7 @@ fn package_cleans_all_the_things() { assert_all_clean(&p.build_dir()); // Try some targets. - p.cargo("build --all-targets --target") + p.cargo("check --all-targets --target") .arg(rustc_host()) .run(); p.cargo("clean -p foo-bar --target").arg(rustc_host()).run(); @@ -590,7 +589,7 @@ fn clean_spec_multiple() { .file("src/lib.rs", "") .build(); - p.cargo("build").run(); + p.cargo("check").run(); // Check suggestion for bad pkgid. p.cargo("clean -p baz") @@ -648,7 +647,7 @@ fn clean_spec_reserved() { .file("tests/build.rs", "") .build(); - p.cargo("build --all-targets").run(); + p.cargo("check --all-targets").run(); assert!(p.target_debug_dir().join("build").is_dir()); let build_test = p.glob("target/debug/deps/build-*").next().unwrap().unwrap(); assert!(build_test.exists()); @@ -660,11 +659,11 @@ fn clean_spec_reserved() { assert!(p.target_debug_dir().join("build").is_dir()); // This should not rebuild bar. - p.cargo("build -v --all-targets") + p.cargo("check -v --all-targets") .with_stderr( "\ [FRESH] bar v1.0.0 -[COMPILING] foo v0.1.0 [..] +[CHECKING] foo v0.1.0 [..] [RUNNING] `rustc [..] [RUNNING] `rustc [..] [RUNNING] `rustc [..] From db0012293058f86a99ece9fdd100270a924659bb Mon Sep 17 00:00:00 2001 From: Scott Schafer Date: Wed, 15 Feb 2023 16:22:19 -0600 Subject: [PATCH 13/62] chore: update `concurrent` tests to use check --- tests/testsuite/concurrent.rs | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/tests/testsuite/concurrent.rs b/tests/testsuite/concurrent.rs index fe4ecfc42296..dadcf22732da 100644 --- a/tests/testsuite/concurrent.rs +++ b/tests/testsuite/concurrent.rs @@ -231,8 +231,8 @@ fn git_same_repo_different_tags() { ); let p = p.build(); - let mut a = p.cargo("build -v").cwd("a").build_command(); - let mut b = p.cargo("build -v").cwd("b").build_command(); + let mut a = p.cargo("check -v").cwd("a").build_command(); + let mut b = p.cargo("check -v").cwd("b").build_command(); a.stdout(Stdio::piped()).stderr(Stdio::piped()); b.stdout(Stdio::piped()).stderr(Stdio::piped()); @@ -299,7 +299,7 @@ fn git_same_branch_different_revs() { // Generate a Cargo.lock pointing at the current rev, then clear out the // target directory - p.cargo("build").cwd("a").run(); + p.cargo("check").cwd("a").run(); fs::remove_dir_all(p.root().join("a/target")).unwrap(); // Make a new commit on the master branch @@ -310,8 +310,8 @@ fn git_same_branch_different_revs() { // Now run both builds in parallel. The build of `b` should pick up the // newest commit while the build of `a` should use the locked old commit. - let mut a = p.cargo("build").cwd("a").build_command(); - let mut b = p.cargo("build").cwd("b").build_command(); + let mut a = p.cargo("check").cwd("a").build_command(); + let mut b = p.cargo("check").cwd("b").build_command(); a.stdout(Stdio::piped()).stderr(Stdio::piped()); b.stdout(Stdio::piped()).stderr(Stdio::piped()); @@ -333,8 +333,8 @@ fn same_project() { .file("src/lib.rs", ""); let p = p.build(); - let mut a = p.cargo("build").build_command(); - let mut b = p.cargo("build").build_command(); + let mut a = p.cargo("check").build_command(); + let mut b = p.cargo("check").build_command(); a.stdout(Stdio::piped()).stderr(Stdio::piped()); b.stdout(Stdio::piped()).stderr(Stdio::piped()); @@ -385,8 +385,8 @@ fn killing_cargo_releases_the_lock() { // it's started and that's how we know that `a` will have the lock // when we kill it. let l = TcpListener::bind("127.0.0.1:0").unwrap(); - let mut a = p.cargo("build").build_command(); - let mut b = p.cargo("build").build_command(); + let mut a = p.cargo("check").build_command(); + let mut b = p.cargo("check").build_command(); a.stdout(Stdio::piped()).stderr(Stdio::piped()); b.stdout(Stdio::piped()).stderr(Stdio::piped()); a.env("ADDR", l.local_addr().unwrap().to_string()) @@ -417,11 +417,11 @@ fn debug_release_ok() { let p = project().file("src/main.rs", "fn main() {}"); let p = p.build(); - p.cargo("build").run(); + p.cargo("check").run(); fs::remove_dir_all(p.root().join("target")).unwrap(); - let mut a = p.cargo("build").build_command(); - let mut b = p.cargo("build --release").build_command(); + let mut a = p.cargo("check").build_command(); + let mut b = p.cargo("check --release").build_command(); a.stdout(Stdio::piped()).stderr(Stdio::piped()); b.stdout(Stdio::piped()).stderr(Stdio::piped()); let a = a.spawn().unwrap(); @@ -433,7 +433,7 @@ fn debug_release_ok() { execs() .with_stderr_contains( "\ -[COMPILING] foo v0.0.1 [..] +[CHECKING] foo v0.0.1 [..] [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", ) @@ -441,7 +441,7 @@ fn debug_release_ok() { execs() .with_stderr_contains( "\ -[COMPILING] foo v0.0.1 [..] +[CHECKING] foo v0.0.1 [..] [FINISHED] release [optimized] target(s) in [..] ", ) @@ -488,7 +488,7 @@ fn no_deadlock_with_git_dependencies() { let (tx, rx) = channel(); for _ in 0..n_concurrent_builds { let cmd = p - .cargo("build") + .cargo("check") .build_command() .stdout(Stdio::piped()) .stderr(Stdio::piped()) From 01e340c41eb35bf0f5479c1d1303dc998f0bea48 Mon Sep 17 00:00:00 2001 From: Scott Schafer Date: Wed, 15 Feb 2023 16:23:30 -0600 Subject: [PATCH 14/62] chore: update `config` tests to use check --- tests/testsuite/config.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/testsuite/config.rs b/tests/testsuite/config.rs index be3f312f1ab9..0835c03070e6 100644 --- a/tests/testsuite/config.rs +++ b/tests/testsuite/config.rs @@ -131,7 +131,7 @@ fn read_env_vars_for_config() { ) .build(); - p.cargo("build").env("CARGO_BUILD_JOBS", "100").run(); + p.cargo("check").env("CARGO_BUILD_JOBS", "100").run(); } pub fn write_config(config: &str) { @@ -1471,7 +1471,7 @@ target-dir = '' fn cargo_target_empty_env() { let project = project().build(); - project.cargo("build") + project.cargo("check") .env("CARGO_TARGET_DIR", "") .with_stderr("error: the target directory is set to an empty string in the `CARGO_TARGET_DIR` environment variable") .with_status(101) From dca8931cc96c91b05df0f099f7939c6b3dfdaa12 Mon Sep 17 00:00:00 2001 From: Scott Schafer Date: Wed, 15 Feb 2023 16:45:45 -0600 Subject: [PATCH 15/62] chore: update `config_include` tests to use check --- tests/testsuite/config_include.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/testsuite/config_include.rs b/tests/testsuite/config_include.rs index 26167ad26205..ae568065acd1 100644 --- a/tests/testsuite/config_include.rs +++ b/tests/testsuite/config_include.rs @@ -61,21 +61,21 @@ fn works_with_cli() { ", ); let p = project().file("src/lib.rs", "").build(); - p.cargo("build -v") + p.cargo("check -v") .with_stderr( "\ -[COMPILING] foo v0.0.1 [..] +[CHECKING] foo v0.0.1 [..] [RUNNING] `rustc [..]-W unused` [FINISHED] [..] ", ) .run(); - p.cargo("build -v -Z config-include") + p.cargo("check -v -Z config-include") .masquerade_as_nightly_cargo(&["config-include"]) .with_stderr( "\ [DIRTY] foo v0.0.1 ([..]): the rustflags changed -[COMPILING] foo v0.0.1 [..] +[CHECKING] foo v0.0.1 [..] [RUNNING] `rustc [..]-W unsafe-code -W unused` [FINISHED] [..] ", From d5a811c3de675d50b5cf60a16575dfe73b71e1f3 Mon Sep 17 00:00:00 2001 From: Scott Schafer Date: Wed, 15 Feb 2023 16:46:35 -0600 Subject: [PATCH 16/62] chore: update `corrupt_git` tests to use check --- tests/testsuite/corrupt_git.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/testsuite/corrupt_git.rs b/tests/testsuite/corrupt_git.rs index a0bd416daa26..2569e460b271 100644 --- a/tests/testsuite/corrupt_git.rs +++ b/tests/testsuite/corrupt_git.rs @@ -34,7 +34,7 @@ fn deleting_database_files() { .file("src/lib.rs", "") .build(); - project.cargo("build").run(); + project.cargo("check").run(); let mut files = Vec::new(); find_files(&paths::home().join(".cargo/git/db"), &mut files); @@ -47,7 +47,7 @@ fn deleting_database_files() { } println!("deleting {}", file.display()); cargopaths::remove_file(&file).unwrap(); - project.cargo("build -v").env("CARGO_LOG", log).run(); + project.cargo("check -v").env("CARGO_LOG", log).run(); if !file.exists() { continue; @@ -60,7 +60,7 @@ fn deleting_database_files() { .unwrap() .set_len(2) .unwrap(); - project.cargo("build -v").env("CARGO_LOG", log).run(); + project.cargo("check -v").env("CARGO_LOG", log).run(); } } @@ -92,7 +92,7 @@ fn deleting_checkout_files() { .file("src/lib.rs", "") .build(); - project.cargo("build").run(); + project.cargo("check").run(); let dir = paths::home() .join(".cargo/git/checkouts") @@ -123,7 +123,7 @@ fn deleting_checkout_files() { } println!("deleting {}", file.display()); cargopaths::remove_file(&file).unwrap(); - project.cargo("build -v").env("CARGO_LOG", log).run(); + project.cargo("check -v").env("CARGO_LOG", log).run(); if !file.exists() { continue; @@ -136,7 +136,7 @@ fn deleting_checkout_files() { .unwrap() .set_len(2) .unwrap(); - project.cargo("build -v").env("CARGO_LOG", log).run(); + project.cargo("check -v").env("CARGO_LOG", log).run(); } } From f9e6ddaf81af84cc9379a0811cbc9e7fbe3d28d5 Mon Sep 17 00:00:00 2001 From: Scott Schafer Date: Wed, 15 Feb 2023 16:54:35 -0600 Subject: [PATCH 17/62] chore: update `custom_target` tests to use check --- tests/testsuite/custom_target.rs | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/tests/testsuite/custom_target.rs b/tests/testsuite/custom_target.rs index b7ad4d835ec3..a59d77d38e02 100644 --- a/tests/testsuite/custom_target.rs +++ b/tests/testsuite/custom_target.rs @@ -50,8 +50,8 @@ fn custom_target_minimal() { .file("custom-target.json", SIMPLE_SPEC) .build(); - p.cargo("build --lib --target custom-target.json -v").run(); - p.cargo("build --lib --target src/../custom-target.json -v") + p.cargo("check --lib --target custom-target.json -v").run(); + p.cargo("check --lib --target src/../custom-target.json -v") .run(); // Ensure that the correct style of flag is passed to --target with doc tests. @@ -110,7 +110,7 @@ fn custom_target_dependency() { .file("custom-target.json", SIMPLE_SPEC) .build(); - p.cargo("build --lib --target custom-target.json -v").run(); + p.cargo("check --lib --target custom-target.json -v").run(); } #[cargo_test(nightly, reason = "requires features no_core, lang_items")] @@ -127,7 +127,7 @@ fn custom_bin_target() { .file("custom-bin-target.json", SIMPLE_SPEC) .build(); - p.cargo("build --target custom-bin-target.json -v").run(); + p.cargo("check --target custom-bin-target.json -v").run(); } #[cargo_test(nightly, reason = "requires features no_core, lang_items")] @@ -148,8 +148,8 @@ fn changing_spec_rebuilds() { .file("custom-target.json", SIMPLE_SPEC) .build(); - p.cargo("build --lib --target custom-target.json -v").run(); - p.cargo("build --lib --target custom-target.json -v") + p.cargo("check --lib --target custom-target.json -v").run(); + p.cargo("check --lib --target custom-target.json -v") .with_stderr( "\ [FRESH] foo [..] @@ -162,10 +162,10 @@ fn changing_spec_rebuilds() { // Some arbitrary change that I hope is safe. let spec = spec.replace('{', "{\n\"vendor\": \"unknown\",\n"); fs::write(&spec_path, spec).unwrap(); - p.cargo("build --lib --target custom-target.json -v") + p.cargo("check --lib --target custom-target.json -v") .with_stderr( "\ -[COMPILING] foo v0.0.1 [..] +[CHECKING] foo v0.0.1 [..] [RUNNING] `rustc [..] [FINISHED] [..] ", @@ -203,10 +203,10 @@ fn changing_spec_relearns_crate_types() { let spec = spec.replace('{', "{\n\"dynamic-linking\": true,\n"); fs::write(&spec_path, spec).unwrap(); - p.cargo("build --lib --target custom-target.json -v") + p.cargo("check --lib --target custom-target.json -v") .with_stderr( "\ -[COMPILING] foo [..] +[CHECKING] foo [..] [RUNNING] `rustc [..] [FINISHED] [..] ", @@ -234,17 +234,17 @@ fn custom_target_ignores_filepath() { .build(); // Should build the library the first time. - p.cargo("build --lib --target a/custom-target.json") + p.cargo("check --lib --target a/custom-target.json") .with_stderr( "\ -[..]Compiling foo v0.0.1 ([..]) +[..]Checking foo v0.0.1 ([..]) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", ) .run(); // But not the second time, even though the path to the custom target is dfferent. - p.cargo("build --lib --target b/custom-target.json") + p.cargo("check --lib --target b/custom-target.json") .with_stderr("[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]") .run(); } From ad6dc0f6add546ee0e0943b222eed342b3f5cdfd Mon Sep 17 00:00:00 2001 From: Scott Schafer Date: Wed, 15 Feb 2023 16:55:10 -0600 Subject: [PATCH 18/62] chore: update `death` tests to use check --- tests/testsuite/death.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/testsuite/death.rs b/tests/testsuite/death.rs index d140534d5b19..f0e182d01a86 100644 --- a/tests/testsuite/death.rs +++ b/tests/testsuite/death.rs @@ -43,7 +43,7 @@ fn ctrl_c_kills_everyone() { ) .build(); - let mut cargo = p.cargo("build").build_command(); + let mut cargo = p.cargo("check").build_command(); cargo .stdin(Stdio::piped()) .stdout(Stdio::piped()) From 9bc322f3ae74c39f4ceee9897eec2d8e0b8f0dba Mon Sep 17 00:00:00 2001 From: Scott Schafer Date: Wed, 15 Feb 2023 16:59:58 -0600 Subject: [PATCH 19/62] chore: update `dep_info` tests to use check --- tests/testsuite/dep_info.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/testsuite/dep_info.rs b/tests/testsuite/dep_info.rs index 3b36173f5abb..e9ea47792eca 100644 --- a/tests/testsuite/dep_info.rs +++ b/tests/testsuite/dep_info.rs @@ -505,7 +505,7 @@ fn reg_dep_source_not_tracked() { .file("src/lib.rs", "pub fn f() { regdep::f(); }") .build(); - p.cargo("build").run(); + p.cargo("check").run(); assert_deps( &p, @@ -551,7 +551,7 @@ fn canonical_path() { real.mkdir_p(); p.symlink(real, "target"); - p.cargo("build -Z binary-dep-depinfo") + p.cargo("check -Z binary-dep-depinfo") .masquerade_as_nightly_cargo(&["binary-dep-depinfo"]) .run(); From 963f08ff01ef39d86d01e373966a36200329481f Mon Sep 17 00:00:00 2001 From: Scott Schafer Date: Wed, 15 Feb 2023 17:02:54 -0600 Subject: [PATCH 20/62] chore: update `directory` tests to use check --- tests/testsuite/directory.rs | 52 ++++++++++++++++++------------------ 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/tests/testsuite/directory.rs b/tests/testsuite/directory.rs index aef2969e8dd0..0e28de03942b 100644 --- a/tests/testsuite/directory.rs +++ b/tests/testsuite/directory.rs @@ -103,11 +103,11 @@ fn simple() { ) .build(); - p.cargo("build") + p.cargo("check") .with_stderr( "\ -[COMPILING] bar v0.1.0 -[COMPILING] foo v0.1.0 ([CWD]) +[CHECKING] bar v0.1.0 +[CHECKING] foo v0.1.0 ([CWD]) [FINISHED] [..] ", ) @@ -272,7 +272,7 @@ fn not_there() { ) .build(); - p.cargo("build") + p.cargo("check") .with_status(101) .with_stderr( "\ @@ -319,11 +319,11 @@ fn multiple() { ) .build(); - p.cargo("build") + p.cargo("check") .with_stderr( "\ -[COMPILING] bar v0.1.0 -[COMPILING] foo v0.1.0 ([CWD]) +[CHECKING] bar v0.1.0 +[CHECKING] foo v0.1.0 ([CWD]) [FINISHED] [..] ", ) @@ -355,14 +355,14 @@ fn crates_io_then_directory() { .file("src/lib.rs", "pub fn bar() -> u32 { 0 }") .publish(); - p.cargo("build") + p.cargo("check") .with_stderr( "\ [UPDATING] `[..]` index [DOWNLOADING] crates ... [DOWNLOADED] bar v0.1.0 ([..]) -[COMPILING] bar v0.1.0 -[COMPILING] foo v0.1.0 ([CWD]) +[CHECKING] bar v0.1.0 +[CHECKING] foo v0.1.0 ([CWD]) [FINISHED] [..] ", ) @@ -376,11 +376,11 @@ fn crates_io_then_directory() { v.cksum.package = Some(cksum); v.build(); - p.cargo("build") + p.cargo("check") .with_stderr( "\ -[COMPILING] bar v0.1.0 -[COMPILING] foo v0.1.0 ([CWD]) +[CHECKING] bar v0.1.0 +[CHECKING] foo v0.1.0 ([CWD]) [FINISHED] [..] ", ) @@ -407,7 +407,7 @@ fn crates_io_then_bad_checksum() { Package::new("bar", "0.1.0").publish(); - p.cargo("build").run(); + p.cargo("check").run(); setup(); VendorPackage::new("bar") @@ -415,7 +415,7 @@ fn crates_io_then_bad_checksum() { .file("src/lib.rs", "") .build(); - p.cargo("build") + p.cargo("check") .with_status(101) .with_stderr( "\ @@ -464,7 +464,7 @@ fn bad_file_checksum() { .file("src/lib.rs", "") .build(); - p.cargo("build") + p.cargo("check") .with_status(101) .with_stderr( "\ @@ -509,7 +509,7 @@ fn only_dot_files_ok() { .file("src/lib.rs", "") .build(); - p.cargo("build").run(); + p.cargo("check").run(); } #[cargo_test] @@ -542,7 +542,7 @@ fn random_files_ok() { .file("src/lib.rs", "") .build(); - p.cargo("build").run(); + p.cargo("check").run(); } #[cargo_test] @@ -577,7 +577,7 @@ fn git_lock_file_doesnt_change() { .file("src/lib.rs", "") .build(); - p.cargo("build").run(); + p.cargo("check").run(); let lock1 = p.read_lockfile(); @@ -598,11 +598,11 @@ fn git_lock_file_doesnt_change() { ) )); - p.cargo("build") + p.cargo("check") .with_stderr( "\ -[COMPILING] [..] -[COMPILING] [..] +[CHECKING] [..] +[CHECKING] [..] [FINISHED] [..] ", ) @@ -650,7 +650,7 @@ fn git_override_requires_lockfile() { "# )); - p.cargo("build") + p.cargo("check") .with_status(101) .with_stderr( "\ @@ -719,12 +719,12 @@ fn workspace_different_locations() { ) .build(); - p.cargo("build").cwd("foo").run(); - p.cargo("build") + p.cargo("check").cwd("foo").run(); + p.cargo("check") .cwd("bar") .with_stderr( "\ -[COMPILING] bar [..] +[CHECKING] bar [..] [FINISHED] [..] ", ) From 9514a37fab15505b1793b100639b55dd872ec4d5 Mon Sep 17 00:00:00 2001 From: Scott Schafer Date: Wed, 15 Feb 2023 17:04:32 -0600 Subject: [PATCH 21/62] chore: update `doc` tests to use check --- tests/testsuite/doc.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/testsuite/doc.rs b/tests/testsuite/doc.rs index bf99a21a9a54..739bcf3765ca 100644 --- a/tests/testsuite/doc.rs +++ b/tests/testsuite/doc.rs @@ -910,7 +910,7 @@ fn no_document_build_deps() { fn doc_release() { let p = project().file("src/lib.rs", "").build(); - p.cargo("build --release").run(); + p.cargo("check --release").run(); p.cargo("doc --release -v") .with_stderr( "\ @@ -1550,7 +1550,7 @@ fn issue_5345() { Package::new("bar", "0.1.0").publish(); Package::new("bar", "0.2.0").publish(); - foo.cargo("build").run(); + foo.cargo("check").run(); foo.cargo("doc").run(); } From 93b41f41faa06e4ea0cd8432355e4ce30414392e Mon Sep 17 00:00:00 2001 From: Scott Schafer Date: Wed, 15 Feb 2023 17:05:24 -0600 Subject: [PATCH 22/62] chore: update `edition` tests to use check --- tests/testsuite/edition.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/testsuite/edition.rs b/tests/testsuite/edition.rs index cbe2f8831de5..377a86ec06f9 100644 --- a/tests/testsuite/edition.rs +++ b/tests/testsuite/edition.rs @@ -31,7 +31,7 @@ fn edition_works_for_build_script() { .file("a/src/lib.rs", "pub fn foo() {}") .build(); - p.cargo("build -v").run(); + p.cargo("check -v").run(); } #[cargo_test] From ac0961aab64d948859c559aab7fd3f6c1829ca5f Mon Sep 17 00:00:00 2001 From: Scott Schafer Date: Wed, 15 Feb 2023 17:11:18 -0600 Subject: [PATCH 23/62] chore: update `features` tests to use check --- tests/testsuite/features.rs | 130 ++++++++++++++++++------------------ 1 file changed, 65 insertions(+), 65 deletions(-) diff --git a/tests/testsuite/features.rs b/tests/testsuite/features.rs index 8553b53c709d..848e05677462 100644 --- a/tests/testsuite/features.rs +++ b/tests/testsuite/features.rs @@ -22,7 +22,7 @@ fn invalid1() { .file("src/main.rs", "") .build(); - p.cargo("build") + p.cargo("check") .with_status(101) .with_stderr( "\ @@ -104,7 +104,7 @@ fn invalid3() { .file("src/main.rs", "") .build(); - p.cargo("build") + p.cargo("check") .with_status(101) .with_stderr( "\ @@ -139,7 +139,7 @@ fn invalid4() { .file("bar/src/lib.rs", "") .build(); - p.cargo("build") + p.cargo("check") .with_status(101) .with_stderr( "\ @@ -156,7 +156,7 @@ failed to select a version for `bar` which could resolve this conflict", p.change_file("Cargo.toml", &basic_manifest("foo", "0.0.1")); - p.cargo("build --features test") + p.cargo("check --features test") .with_status(101) .with_stderr("error: Package `foo v0.0.1 ([..])` does not have the feature `test`") .run(); @@ -181,7 +181,7 @@ fn invalid5() { .file("src/main.rs", "") .build(); - p.cargo("build") + p.cargo("check") .with_status(101) .with_stderr( "\ @@ -212,7 +212,7 @@ fn invalid6() { .file("src/main.rs", "") .build(); - p.cargo("build --features foo") + p.cargo("check --features foo") .with_status(101) .with_stderr( "\ @@ -244,7 +244,7 @@ fn invalid7() { .file("src/main.rs", "") .build(); - p.cargo("build --features foo") + p.cargo("check --features foo") .with_status(101) .with_stderr( "\ @@ -278,7 +278,7 @@ fn invalid8() { .file("bar/src/lib.rs", "") .build(); - p.cargo("build --features foo") + p.cargo("check --features foo") .with_status(101) .with_stderr( "\ @@ -312,7 +312,7 @@ fn invalid9() { .file("bar/src/lib.rs", "") .build(); - p.cargo("build --features bar") + p.cargo("check --features bar") .with_stderr( "\ error: Package `foo v0.0.1 ([..])` does not have feature `bar`. It has a required dependency with that name, but only optional dependencies can be used as features. @@ -354,7 +354,7 @@ fn invalid10() { .file("bar/baz/src/lib.rs", "") .build(); - p.cargo("build").with_stderr("\ + p.cargo("check").with_stderr("\ error: failed to select a version for `bar`. ... required by package `foo v0.0.1 ([..])` versions that meet the requirements `*` are: 0.0.1 @@ -426,7 +426,7 @@ fn no_transitive_dep_feature_requirement() { "#, ) .build(); - p.cargo("build") + p.cargo("check") .with_status(101) .with_stderr( "\ @@ -571,7 +571,7 @@ fn cyclic_feature() { .file("src/main.rs", "") .build(); - p.cargo("build") + p.cargo("check") .with_status(101) .with_stderr("[ERROR] cyclic feature dependency: feature `default` depends on itself") .run(); @@ -596,7 +596,7 @@ fn cyclic_feature2() { .file("src/main.rs", "fn main() {}") .build(); - p.cargo("build").with_stdout("").run(); + p.cargo("check").with_stdout("").run(); } #[cargo_test] @@ -645,12 +645,12 @@ fn groups_on_groups_on_groups() { .file("baz/src/lib.rs", "pub fn baz() {}") .build(); - p.cargo("build") + p.cargo("check") .with_stderr( "\ -[COMPILING] ba[..] v0.0.1 ([CWD]/ba[..]) -[COMPILING] ba[..] v0.0.1 ([CWD]/ba[..]) -[COMPILING] foo v0.0.1 ([CWD]) +[CHECKING] ba[..] v0.0.1 ([CWD]/ba[..]) +[CHECKING] ba[..] v0.0.1 ([CWD]/ba[..]) +[CHECKING] foo v0.0.1 ([CWD]) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", ) @@ -693,13 +693,13 @@ fn many_cli_features() { .file("baz/src/lib.rs", "pub fn baz() {}") .build(); - p.cargo("build --features") + p.cargo("check --features") .arg("bar baz") .with_stderr( "\ -[COMPILING] ba[..] v0.0.1 ([CWD]/ba[..]) -[COMPILING] ba[..] v0.0.1 ([CWD]/ba[..]) -[COMPILING] foo v0.0.1 ([CWD]) +[CHECKING] ba[..] v0.0.1 ([CWD]/ba[..]) +[CHECKING] ba[..] v0.0.1 ([CWD]/ba[..]) +[CHECKING] foo v0.0.1 ([CWD]) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", ) @@ -777,12 +777,12 @@ fn union_features() { ) .build(); - p.cargo("build") + p.cargo("check") .with_stderr( "\ -[COMPILING] d2 v0.0.1 ([CWD]/d2) -[COMPILING] d1 v0.0.1 ([CWD]/d1) -[COMPILING] foo v0.0.1 ([CWD]) +[CHECKING] d2 v0.0.1 ([CWD]/d2) +[CHECKING] d1 v0.0.1 ([CWD]/d1) +[CHECKING] foo v0.0.1 ([CWD]) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", ) @@ -823,18 +823,18 @@ fn many_features_no_rebuilds() { .file("a/src/lib.rs", "") .build(); - p.cargo("build") + p.cargo("check") .with_stderr( "\ -[COMPILING] a v0.1.0 ([CWD]/a) -[COMPILING] b v0.1.0 ([CWD]) +[CHECKING] a v0.1.0 ([CWD]/a) +[CHECKING] b v0.1.0 ([CWD]) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", ) .run(); p.root().move_into_the_past(); - p.cargo("build -v") + p.cargo("check -v") .with_stderr( "\ [FRESH] a v0.1.0 ([..]/a) @@ -850,7 +850,7 @@ fn many_features_no_rebuilds() { fn empty_features() { let p = project().file("src/main.rs", "fn main() {}").build(); - p.cargo("build --features").arg("").run(); + p.cargo("check --features").arg("").run(); } // Tests that all cmd lines work with `--features ""` @@ -891,7 +891,7 @@ fn transitive_features() { ) .build(); - p.cargo("build --features foo").run(); + p.cargo("check --features foo").run(); } #[cargo_test] @@ -1015,9 +1015,9 @@ fn no_rebuild_when_frobbing_default_feature() { .file("a/src/lib.rs", "") .build(); - p.cargo("build").run(); - p.cargo("build").with_stdout("").run(); - p.cargo("build").with_stdout("").run(); + p.cargo("check").run(); + p.cargo("check").with_stdout("").run(); + p.cargo("check").with_stdout("").run(); } #[cargo_test] @@ -1066,9 +1066,9 @@ fn unions_work_with_no_default_features() { .file("a/src/lib.rs", r#"#[cfg(feature = "f1")] pub fn a() {}"#) .build(); - p.cargo("build").run(); - p.cargo("build").with_stdout("").run(); - p.cargo("build").with_stdout("").run(); + p.cargo("check").run(); + p.cargo("check").with_stdout("").run(); + p.cargo("check").with_stdout("").run(); } #[cargo_test] @@ -1093,10 +1093,10 @@ fn optional_and_dev_dep() { .file("foo/src/lib.rs", "") .build(); - p.cargo("build") + p.cargo("check") .with_stderr( "\ -[COMPILING] test v0.1.0 ([..]) +[CHECKING] test v0.1.0 ([..]) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", ) @@ -1140,7 +1140,7 @@ fn activating_feature_activates_dep() { .file("foo/src/lib.rs", r#"#[cfg(feature = "a")] pub fn bar() {}"#) .build(); - p.cargo("build --features a -v").run(); + p.cargo("check --features a -v").run(); } #[cargo_test] @@ -1205,23 +1205,23 @@ fn dep_feature_in_cmd_line() { // The foo project requires that feature "some-feat" in "bar" is enabled. // Building without any features enabled should fail: - p.cargo("build") + p.cargo("check") .with_status(101) .with_stderr_contains("[..]unresolved import `bar::test`") .run(); // We should be able to enable the feature "derived-feat", which enables "some-feat", // on the command line. The feature is enabled, thus building should be successful: - p.cargo("build --features derived/derived-feat").run(); + p.cargo("check --features derived/derived-feat").run(); // Trying to enable features of transitive dependencies is an error - p.cargo("build --features bar/some-feat") + p.cargo("check --features bar/some-feat") .with_status(101) .with_stderr("error: package `foo v0.0.1 ([..])` does not have a dependency named `bar`") .run(); // Hierarchical feature specification should still be disallowed - p.cargo("build --features derived/bar/some-feat") + p.cargo("check --features derived/bar/some-feat") .with_status(101) .with_stderr("[ERROR] multiple slashes in feature `derived/bar/some-feat` is not allowed") .run(); @@ -1269,7 +1269,7 @@ fn all_features_flag_enables_all_features() { .file("baz/src/lib.rs", "pub fn baz() {}") .build(); - p.cargo("build --all-features").run(); + p.cargo("check --all-features").run(); } #[cargo_test] @@ -1308,12 +1308,12 @@ fn many_cli_features_comma_delimited() { .file("baz/src/lib.rs", "pub fn baz() {}") .build(); - p.cargo("build --features bar,baz") + p.cargo("check --features bar,baz") .with_stderr( "\ -[COMPILING] ba[..] v0.0.1 ([CWD]/ba[..]) -[COMPILING] ba[..] v0.0.1 ([CWD]/ba[..]) -[COMPILING] foo v0.0.1 ([CWD]) +[CHECKING] ba[..] v0.0.1 ([CWD]/ba[..]) +[CHECKING] ba[..] v0.0.1 ([CWD]/ba[..]) +[CHECKING] foo v0.0.1 ([CWD]) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", ) @@ -1372,15 +1372,15 @@ fn many_cli_features_comma_and_space_delimited() { .file("bap/src/lib.rs", "pub fn bap() {}") .build(); - p.cargo("build --features") + p.cargo("check --features") .arg("bar,baz bam bap") .with_stderr( "\ -[COMPILING] ba[..] v0.0.1 ([CWD]/ba[..]) -[COMPILING] ba[..] v0.0.1 ([CWD]/ba[..]) -[COMPILING] ba[..] v0.0.1 ([CWD]/ba[..]) -[COMPILING] ba[..] v0.0.1 ([CWD]/ba[..]) -[COMPILING] foo v0.0.1 ([CWD]) +[CHECKING] ba[..] v0.0.1 ([CWD]/ba[..]) +[CHECKING] ba[..] v0.0.1 ([CWD]/ba[..]) +[CHECKING] ba[..] v0.0.1 ([CWD]/ba[..]) +[CHECKING] ba[..] v0.0.1 ([CWD]/ba[..]) +[CHECKING] foo v0.0.1 ([CWD]) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", ) @@ -1413,7 +1413,7 @@ fn only_dep_is_optional() { .file("src/main.rs", "fn main() {}") .build(); - p.cargo("build").run(); + p.cargo("check").run(); } #[cargo_test] @@ -1449,7 +1449,7 @@ fn all_features_all_crates() { .file("bar/src/main.rs", "#[cfg(feature = \"foo\")] fn main() {}") .build(); - p.cargo("build --all-features --workspace").run(); + p.cargo("check --all-features --workspace").run(); } #[cargo_test] @@ -1508,7 +1508,7 @@ fn feature_off_dylib() { .build(); // Build the dylib with `f1` feature. - p.cargo("build --features f1").run(); + p.cargo("check --features f1").run(); // Check that building without `f1` uses a dylib without `f1`. p.cargo("run -p bar").run(); } @@ -1537,11 +1537,11 @@ fn warn_if_default_features() { .file("bar/src/lib.rs", "pub fn bar() {}") .build(); - p.cargo("build") + p.cargo("check") .with_stderr( r#" [WARNING] `default-features = [".."]` was found in [features]. Did you mean to use `default = [".."]`? -[COMPILING] foo v0.0.1 ([CWD]) +[CHECKING] foo v0.0.1 ([CWD]) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] "#.trim(), ).run(); @@ -1585,7 +1585,7 @@ fn no_feature_for_non_optional_dep() { .file("bar/src/lib.rs", "pub fn bar() {}") .build(); - p.cargo("build --features bar/a").run(); + p.cargo("check --features bar/a").run(); } #[cargo_test] @@ -1613,7 +1613,7 @@ fn features_option_given_twice() { ) .build(); - p.cargo("build --features a --features b").run(); + p.cargo("check --features a --features b").run(); } #[cargo_test] @@ -1642,7 +1642,7 @@ fn multi_multi_features() { ) .build(); - p.cargo("build --features a --features").arg("b c").run(); + p.cargo("check --features a --features").arg("b c").run(); } #[cargo_test] @@ -1921,7 +1921,7 @@ fn nonexistent_required_features() { .file("examples/ololo.rs", "fn main() {}") .build(); - p.cargo("build --examples") + p.cargo("check --examples") .with_stderr_contains( "\ [WARNING] invalid feature `not_present` in required-features of target `ololo`: \ @@ -2075,7 +2075,7 @@ fn default_features_conflicting_warning() { .file("a/src/lib.rs", "") .build(); - p.cargo("build") + p.cargo("check") .with_stderr_contains( "[WARNING] conflicting between `default-features` and `default_features` in the `a` dependency.\n `default_features` is ignored and not recommended for use in the future" From b6a7f7a1423c7c84066088f57903eb0f1c71e2bd Mon Sep 17 00:00:00 2001 From: Scott Schafer Date: Wed, 15 Feb 2023 17:14:34 -0600 Subject: [PATCH 24/62] chore: update `features2` tests to use check --- tests/testsuite/features2.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/testsuite/features2.rs b/tests/testsuite/features2.rs index 1e0e62f23041..494c83f1e50d 100644 --- a/tests/testsuite/features2.rs +++ b/tests/testsuite/features2.rs @@ -1273,7 +1273,7 @@ fn resolver_bad_setting() { .file("src/lib.rs", "") .build(); - p.cargo("build") + p.cargo("check") .with_status(101) .with_stderr( "\ @@ -1357,7 +1357,7 @@ fn resolver_not_both() { .file("src/lib.rs", "") .build(); - p.cargo("build") + p.cargo("check") .with_status(101) .with_stderr( "\ From c6eb92159564cd6c2a24778107e0f4b796b5c805 Mon Sep 17 00:00:00 2001 From: Scott Schafer Date: Wed, 15 Feb 2023 17:15:38 -0600 Subject: [PATCH 25/62] chore: update `features_namespaced` tests to use check --- tests/testsuite/features_namespaced.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/testsuite/features_namespaced.rs b/tests/testsuite/features_namespaced.rs index 72ad6c5cb209..f7c29feef9bd 100644 --- a/tests/testsuite/features_namespaced.rs +++ b/tests/testsuite/features_namespaced.rs @@ -62,7 +62,7 @@ fn namespaced_invalid_feature() { .file("src/main.rs", "") .build(); - p.cargo("build") + p.cargo("check") .with_status(101) .with_stderr( "\ @@ -93,7 +93,7 @@ fn namespaced_invalid_dependency() { .file("src/main.rs", "") .build(); - p.cargo("build") + p.cargo("check") .with_status(101) .with_stderr( "\ @@ -127,7 +127,7 @@ fn namespaced_non_optional_dependency() { .file("src/main.rs", "") .build(); - p.cargo("build") + p.cargo("check") .with_status(101) .with_stderr( @@ -209,7 +209,7 @@ fn namespaced_shadowed_dep() { .file("src/main.rs", "fn main() {}") .build(); - p.cargo("build") + p.cargo("check") .with_status(101) .with_stderr( "\ @@ -269,7 +269,7 @@ fn namespaced_implicit_non_optional() { .file("src/main.rs", "fn main() {}") .build(); - p.cargo("build").with_status(101).with_stderr( + p.cargo("check").with_status(101).with_stderr( "\ [ERROR] failed to parse manifest at `[..]` @@ -701,7 +701,7 @@ fn optional_explicit_without_crate() { .file("src/lib.rs", "") .build(); - p.cargo("build") + p.cargo("check") .with_status(101) .with_stderr( "\ From 58a6b60ec80d073dbd924ad5b82831ae202abd9e Mon Sep 17 00:00:00 2001 From: Scott Schafer Date: Wed, 15 Feb 2023 17:16:57 -0600 Subject: [PATCH 26/62] chore: update `fix` tests to use check --- tests/testsuite/fix.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/testsuite/fix.rs b/tests/testsuite/fix.rs index 0b88519f5a0a..17bcd111ce76 100644 --- a/tests/testsuite/fix.rs +++ b/tests/testsuite/fix.rs @@ -658,7 +658,7 @@ fn fixes_missing_ampersand() { .with_stderr_contains("[FIXED] tests/a.rs (1 fix)") .with_stderr_contains("[FINISHED] [..]") .run(); - p.cargo("build").run(); + p.cargo("check").run(); p.cargo("test").run(); } @@ -688,9 +688,9 @@ fn fix_features() { .build(); p.cargo("fix --allow-no-vcs").run(); - p.cargo("build").run(); + p.cargo("check").run(); p.cargo("fix --features bar --allow-no-vcs").run(); - p.cargo("build --features bar").run(); + p.cargo("check --features bar").run(); } #[cargo_test] From 5e3fc161c743c5d969f523562bfa2c52a83266be Mon Sep 17 00:00:00 2001 From: Scott Schafer Date: Wed, 15 Feb 2023 17:35:58 -0600 Subject: [PATCH 27/62] chore: update `freshness` tests to use check --- tests/testsuite/freshness.rs | 244 +++++++++++++++++------------------ 1 file changed, 122 insertions(+), 122 deletions(-) diff --git a/tests/testsuite/freshness.rs b/tests/testsuite/freshness.rs index 86b186af8475..16c96994d65a 100644 --- a/tests/testsuite/freshness.rs +++ b/tests/testsuite/freshness.rs @@ -24,25 +24,25 @@ fn modifying_and_moving() { .file("src/a.rs", "") .build(); - p.cargo("build") + p.cargo("check") .with_stderr( "\ -[COMPILING] foo v0.0.1 ([CWD]) +[CHECKING] foo v0.0.1 ([CWD]) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", ) .run(); - p.cargo("build").with_stdout("").run(); + p.cargo("check").with_stdout("").run(); p.root().move_into_the_past(); p.root().join("target").move_into_the_past(); p.change_file("src/a.rs", "#[allow(unused)]fn main() {}"); - p.cargo("build -v") + p.cargo("check -v") .with_stderr( "\ [DIRTY] foo v0.0.1 ([CWD]): the file `src/a.rs` has changed ([..]) -[COMPILING] foo v0.0.1 ([CWD]) +[CHECKING] foo v0.0.1 ([CWD]) [RUNNING] `rustc --crate-name foo [..] [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", @@ -50,7 +50,7 @@ fn modifying_and_moving() { .run(); fs::rename(&p.root().join("src/a.rs"), &p.root().join("src/b.rs")).unwrap(); - p.cargo("build") + p.cargo("check") .with_status(101) .with_stderr_contains("[..]file not found[..]") .run(); @@ -66,10 +66,10 @@ fn modify_only_some_files() { .file("tests/test.rs", "") .build(); - p.cargo("build") + p.cargo("check") .with_stderr( "\ -[COMPILING] foo v0.0.1 ([CWD]) +[CHECKING] foo v0.0.1 ([CWD]) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", ) @@ -85,11 +85,11 @@ fn modify_only_some_files() { lib.move_into_the_past(); // Make sure the binary is rebuilt, not the lib - p.cargo("build -v") + p.cargo("check -v") .with_stderr( "\ [DIRTY] foo v0.0.1 ([CWD]): the file `src/b.rs` has changed ([..]) -[COMPILING] foo v0.0.1 ([CWD]) +[CHECKING] foo v0.0.1 ([CWD]) [RUNNING] `rustc --crate-name foo [..] [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", @@ -132,12 +132,12 @@ fn rebuild_sub_package_then_while_package() { .file("b/src/lib.rs", "") .build(); - p.cargo("build") + p.cargo("check") .with_stderr( "\ -[COMPILING] b [..] -[COMPILING] a [..] -[COMPILING] foo [..] +[CHECKING] b [..] +[CHECKING] a [..] +[CHECKING] foo [..] [FINISHED] dev [..] ", ) @@ -148,11 +148,11 @@ fn rebuild_sub_package_then_while_package() { } p.change_file("b/src/lib.rs", "pub fn b() {}"); - p.cargo("build -pb -v") + p.cargo("check -pb -v") .with_stderr( "\ [DIRTY] b v0.0.1 ([..]): the file `b/src/lib.rs` has changed ([..]) -[COMPILING] b [..] +[CHECKING] b [..] [RUNNING] `rustc --crate-name b [..] [FINISHED] dev [..] ", @@ -164,15 +164,15 @@ fn rebuild_sub_package_then_while_package() { "extern crate a; extern crate b; pub fn toplevel() {}", ); - p.cargo("build -v") + p.cargo("check -v") .with_stderr( "\ [FRESH] b [..] [DIRTY] a [..]: the dependency b was rebuilt ([..]) -[COMPILING] a [..] +[CHECKING] a [..] [RUNNING] `rustc --crate-name a [..] [DIRTY] foo [..]: the dependency b was rebuilt ([..]) -[COMPILING] foo [..] +[CHECKING] foo [..] [RUNNING] `rustc --crate-name foo [..] [FINISHED] dev [..] ", @@ -198,19 +198,19 @@ fn changing_lib_features_caches_targets() { .file("src/lib.rs", "") .build(); - p.cargo("build") + p.cargo("check") .with_stderr( "\ -[..]Compiling foo v0.0.1 ([..]) +[CHECKING] foo v0.0.1 ([..]) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", ) .run(); - p.cargo("build --features foo") + p.cargo("check --features foo") .with_stderr( "\ -[..]Compiling foo v0.0.1 ([..]) +[CHECKING] foo v0.0.1 ([..]) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", ) @@ -218,13 +218,13 @@ fn changing_lib_features_caches_targets() { /* Targets should be cached from the first build */ - p.cargo("build") + p.cargo("check") .with_stderr("[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]") .run(); - p.cargo("build").with_stdout("").run(); + p.cargo("check").with_stdout("").run(); - p.cargo("build --features foo") + p.cargo("check --features foo") .with_stderr("[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]") .run(); } @@ -247,10 +247,10 @@ fn changing_profiles_caches_targets() { .file("src/lib.rs", "") .build(); - p.cargo("build") + p.cargo("check") .with_stderr( "\ -[..]Compiling foo v0.0.1 ([..]) +[CHECKING] foo v0.0.1 ([..]) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", ) @@ -269,7 +269,7 @@ fn changing_profiles_caches_targets() { /* Targets should be cached from the first build */ - p.cargo("build") + p.cargo("check") .with_stderr("[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]") .run(); @@ -550,13 +550,13 @@ fn rebuild_tests_if_lib_changes() { ) .build(); - p.cargo("build").run(); + p.cargo("check").run(); p.cargo("test").run(); sleep_ms(1000); p.change_file("src/lib.rs", ""); - p.cargo("build -v").run(); + p.cargo("check -v").run(); p.cargo("test -v") .with_status(101) .with_stderr_contains("[..]cannot find function `foo`[..]") @@ -664,8 +664,8 @@ fn rerun_if_changed_in_dep() { .file("a/src/lib.rs", "") .build(); - p.cargo("build").run(); - p.cargo("build").with_stdout("").run(); + p.cargo("check").run(); + p.cargo("check").with_stdout("").run(); } #[cargo_test] @@ -731,24 +731,24 @@ fn same_build_dir_cached_packages() { ) .build(); - p.cargo("build") + p.cargo("check") .cwd("a1") .with_stderr(&format!( "\ -[COMPILING] d v0.0.1 ({dir}/d) -[COMPILING] c v0.0.1 ({dir}/c) -[COMPILING] b v0.0.1 ({dir}/b) -[COMPILING] a1 v0.0.1 ([CWD]) +[CHECKING] d v0.0.1 ({dir}/d) +[CHECKING] c v0.0.1 ({dir}/c) +[CHECKING] b v0.0.1 ({dir}/b) +[CHECKING] a1 v0.0.1 ([CWD]) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", dir = p.url().to_file_path().unwrap().to_str().unwrap() )) .run(); - p.cargo("build") + p.cargo("check") .cwd("a2") .with_stderr( "\ -[COMPILING] a2 v0.0.1 ([CWD]) +[CHECKING] a2 v0.0.1 ([CWD]) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", ) @@ -775,11 +775,11 @@ fn no_rebuild_if_build_artifacts_move_backwards_in_time() { .file("a/src/lib.rs", "") .build(); - p.cargo("build").run(); + p.cargo("check").run(); p.root().move_into_the_past(); - p.cargo("build") + p.cargo("check") .with_stdout("") .with_stderr("[FINISHED] [..]") .run(); @@ -805,17 +805,17 @@ fn rebuild_if_build_artifacts_move_forward_in_time() { .file("a/src/lib.rs", "") .build(); - p.cargo("build").run(); + p.cargo("check").run(); p.root().move_into_the_future(); - p.cargo("build") + p.cargo("check") .env("CARGO_LOG", "") .with_stdout("") .with_stderr( "\ -[COMPILING] a v0.0.1 ([..]) -[COMPILING] foo v0.0.1 ([..]) +[CHECKING] a v0.0.1 ([..]) +[CHECKING] foo v0.0.1 ([..]) [FINISHED] [..] ", ) @@ -911,13 +911,13 @@ fn no_rebuild_when_rename_dir() { cargo_test_support::sleep_ms(100); fs::write(p.root().join("src/lib.rs"), "").unwrap(); - p.cargo("build").run(); + p.cargo("check").run(); let mut new = p.root(); new.pop(); new.push("bar"); fs::rename(p.root(), &new).unwrap(); - p.cargo("build") + p.cargo("check") .cwd(&new) .with_stderr("[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]") .run(); @@ -973,8 +973,8 @@ fn unused_optional_dep() { .file("baz/src/lib.rs", "") .build(); - p.cargo("build").run(); - p.cargo("build").with_stderr("[FINISHED] [..]").run(); + p.cargo("check").run(); + p.cargo("check").with_stderr("[FINISHED] [..]").run(); } #[cargo_test] @@ -1027,8 +1027,8 @@ fn path_dev_dep_registry_updates() { .file("baz/src/lib.rs", "") .build(); - p.cargo("build").run(); - p.cargo("build").with_stderr("[FINISHED] [..]").run(); + p.cargo("check").run(); + p.cargo("check").with_stderr("[FINISHED] [..]").run(); } #[cargo_test] @@ -1064,8 +1064,8 @@ fn change_panic_mode() { .file("baz/src/lib.rs", "extern crate bar;") .build(); - p.cargo("build -p bar").run(); - p.cargo("build -p baz").run(); + p.cargo("check -p bar").run(); + p.cargo("check -p baz").run(); } #[cargo_test] @@ -1117,10 +1117,10 @@ fn dont_rebuild_based_on_plugins() { .file("qux/src/lib.rs", "") .build(); - p.cargo("build").run(); - p.cargo("build -p baz").run(); - p.cargo("build").with_stderr("[FINISHED] [..]\n").run(); - p.cargo("build -p bar") + p.cargo("check").run(); + p.cargo("check -p baz").run(); + p.cargo("check").with_stderr("[FINISHED] [..]\n").run(); + p.cargo("check -p bar") .with_stderr("[FINISHED] [..]\n") .run(); } @@ -1194,9 +1194,9 @@ fn reuse_shared_build_dep() { .file("bar/build.rs", "fn main() {}") .build(); - p.cargo("build --workspace").run(); + p.cargo("check --workspace").run(); // This should not recompile! - p.cargo("build -p foo -v") + p.cargo("check -p foo -v") .with_stderr( "\ [FRESH] shared [..] @@ -1212,39 +1212,39 @@ fn changing_rustflags_is_cached() { let p = project().file("src/lib.rs", "").build(); // This isn't ever cached, we always have to recompile - p.cargo("build") + p.cargo("check") .with_stderr( "\ -[COMPILING] foo v0.0.1 ([..]) +[CHECKING] foo v0.0.1 ([..]) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..]", ) .run(); - p.cargo("build -v") + p.cargo("check -v") .env("RUSTFLAGS", "-C linker=cc") .with_stderr( "\ [DIRTY] foo v0.0.1 ([..]): the rustflags changed -[COMPILING] foo v0.0.1 ([..]) +[CHECKING] foo v0.0.1 ([..]) [RUNNING] `rustc [..] [FINISHED] dev [unoptimized + debuginfo] target(s) in [..]", ) .run(); - p.cargo("build -v") + p.cargo("check -v") .with_stderr( "\ [DIRTY] foo v0.0.1 ([..]): the rustflags changed -[COMPILING] foo v0.0.1 ([..]) +[CHECKING] foo v0.0.1 ([..]) [RUNNING] `rustc [..] [FINISHED] dev [unoptimized + debuginfo] target(s) in [..]", ) .run(); - p.cargo("build -v") + p.cargo("check -v") .env("RUSTFLAGS", "-C linker=cc") .with_stderr( "\ [DIRTY] foo v0.0.1 ([..]): the rustflags changed -[COMPILING] foo v0.0.1 ([..]) +[CHECKING] foo v0.0.1 ([..]) [RUNNING] `rustc [..] [FINISHED] dev [unoptimized + debuginfo] target(s) in [..]", ) @@ -1270,24 +1270,24 @@ fn update_dependency_mtime_does_not_rebuild() { .file("bar/src/lib.rs", "") .build(); - p.cargo("build -Z mtime-on-use") + p.cargo("check -Z mtime-on-use") .masquerade_as_nightly_cargo(&["mtime-on-use"]) .env("RUSTFLAGS", "-C linker=cc") .with_stderr( "\ -[COMPILING] bar v0.0.1 ([..]) -[COMPILING] foo v0.0.1 ([..]) +[CHECKING] bar v0.0.1 ([..]) +[CHECKING] foo v0.0.1 ([..]) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..]", ) .run(); // This does not make new files, but it does update the mtime of the dependency. - p.cargo("build -p bar -Z mtime-on-use") + p.cargo("check -p bar -Z mtime-on-use") .masquerade_as_nightly_cargo(&["mtime-on-use"]) .env("RUSTFLAGS", "-C linker=cc") .with_stderr("[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]") .run(); // This should not recompile! - p.cargo("build -Z mtime-on-use") + p.cargo("check -Z mtime-on-use") .masquerade_as_nightly_cargo(&["mtime-on-use"]) .env("RUSTFLAGS", "-C linker=cc") .with_stderr("[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]") @@ -1348,14 +1348,14 @@ fn fingerprint_cleaner_does_not_rebuild() { .file("bar/src/lib.rs", "") .build(); - p.cargo("build -Z mtime-on-use") + p.cargo("check -Z mtime-on-use") .masquerade_as_nightly_cargo(&["mtime-on-use"]) .run(); - p.cargo("build -Z mtime-on-use --features a") + p.cargo("check -Z mtime-on-use --features a") .masquerade_as_nightly_cargo(&["mtime-on-use"]) .with_stderr( "\ -[COMPILING] foo v0.0.1 ([..]) +[CHECKING] foo v0.0.1 ([..]) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..]", ) .run(); @@ -1367,22 +1367,22 @@ fn fingerprint_cleaner_does_not_rebuild() { sleep_ms(1000); } // This does not make new files, but it does update the mtime. - p.cargo("build -Z mtime-on-use --features a") + p.cargo("check -Z mtime-on-use --features a") .masquerade_as_nightly_cargo(&["mtime-on-use"]) .with_stderr("[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]") .run(); fingerprint_cleaner(p.target_debug_dir(), timestamp); // This should not recompile! - p.cargo("build -Z mtime-on-use --features a") + p.cargo("check -Z mtime-on-use --features a") .masquerade_as_nightly_cargo(&["mtime-on-use"]) .with_stderr("[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]") .run(); // But this should be cleaned and so need a rebuild - p.cargo("build -Z mtime-on-use") + p.cargo("check -Z mtime-on-use") .masquerade_as_nightly_cargo(&["mtime-on-use"]) .with_stderr( "\ -[COMPILING] foo v0.0.1 ([..]) +[CHECKING] foo v0.0.1 ([..]) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..]", ) .run(); @@ -1516,7 +1516,7 @@ fn bust_patched_dep() { .file("reg1new/src/lib.rs", "") .build(); - p.cargo("build").run(); + p.cargo("check").run(); if is_coarse_mtime() { sleep_ms(1000); } @@ -1526,24 +1526,24 @@ fn bust_patched_dep() { sleep_ms(1000); } - p.cargo("build -v") + p.cargo("check -v") .with_stderr( "\ [DIRTY] registry1 v0.1.0 ([..]): the file `reg1new/src/lib.rs` has changed ([..]) -[COMPILING] registry1 v0.1.0 ([..]) +[CHECKING] registry1 v0.1.0 ([..]) [RUNNING] `rustc [..] [DIRTY] registry2 v0.1.0: the dependency registry1 was rebuilt -[COMPILING] registry2 v0.1.0 +[CHECKING] registry2 v0.1.0 [RUNNING] `rustc [..] [DIRTY] foo v0.0.1 ([..]): the dependency registry2 was rebuilt -[COMPILING] foo v0.0.1 ([..]) +[CHECKING] foo v0.0.1 ([..]) [RUNNING] `rustc [..] [FINISHED] [..] ", ) .run(); - p.cargo("build -v") + p.cargo("check -v") .with_stderr( "\ [FRESH] registry1 v0.1.0 ([..]) @@ -1737,7 +1737,7 @@ fn dirty_both_lib_and_test() { .file("slib.rs", &slib(2)) .build(); - p.cargo("build").run(); + p.cargo("check").run(); // 2 != 1 p.cargo("test --lib") @@ -1752,7 +1752,7 @@ fn dirty_both_lib_and_test() { // Fix the mistake. p.change_file("slib.rs", &slib(1)); - p.cargo("build").run(); + p.cargo("check").run(); // This should recompile with the new static lib, and the test should pass. p.cargo("test --lib").run(); } @@ -1780,17 +1780,17 @@ fn script_fails_stay_dirty() { .file("src/lib.rs", "") .build(); - p.cargo("build").run(); + p.cargo("check").run(); if is_coarse_mtime() { sleep_ms(1000); } p.change_file("helper.rs", r#"pub fn doit() {panic!("Crash!");}"#); - p.cargo("build") + p.cargo("check") .with_stderr_contains("[..]Crash![..]") .with_status(101) .run(); // There was a bug where this second call would be "fresh". - p.cargo("build") + p.cargo("check") .with_stderr_contains("[..]Crash![..]") .with_status(101) .run(); @@ -2057,7 +2057,7 @@ fn rename_with_path_deps() { .file("a/b/src/lib.rs", "pub fn foo() { }"); let p = p.build(); - p.cargo("build").run(); + p.cargo("check").run(); // Now rename the root directory and rerun `cargo run`. Not only should we // not build anything but we also shouldn't crash. @@ -2067,7 +2067,7 @@ fn rename_with_path_deps() { fs::rename(p.root(), &new).unwrap(); - p.cargo("build") + p.cargo("check") .cwd(&new) .with_stderr("[FINISHED] [..]") .run(); @@ -2129,12 +2129,12 @@ fn move_target_directory_with_path_deps() { let mut parent = p.root(); parent.pop(); - p.cargo("build").run(); + p.cargo("check").run(); let new_target = p.root().join("target2"); fs::rename(p.root().join("target"), &new_target).unwrap(); - p.cargo("build") + p.cargo("check") .env("CARGO_TARGET_DIR", &new_target) .with_stderr("[FINISHED] [..]") .run(); @@ -2157,10 +2157,10 @@ fn rerun_if_changes() { .file("src/lib.rs", "") .build(); - p.cargo("build").run(); - p.cargo("build").with_stderr("[FINISHED] [..]").run(); + p.cargo("check").run(); + p.cargo("check").with_stderr("[FINISHED] [..]").run(); - p.cargo("build -v") + p.cargo("check -v") .env("FOO", "1") .with_stderr( "\ @@ -2172,12 +2172,12 @@ fn rerun_if_changes() { ", ) .run(); - p.cargo("build") + p.cargo("check") .env("FOO", "1") .with_stderr("[FINISHED] [..]") .run(); - p.cargo("build -v") + p.cargo("check -v") .env("FOO", "1") .env("BAR", "1") .with_stderr( @@ -2190,13 +2190,13 @@ fn rerun_if_changes() { ", ) .run(); - p.cargo("build") + p.cargo("check") .env("FOO", "1") .env("BAR", "1") .with_stderr("[FINISHED] [..]") .run(); - p.cargo("build -v") + p.cargo("check -v") .env("BAR", "2") .with_stderr( "\ @@ -2208,7 +2208,7 @@ fn rerun_if_changes() { ", ) .run(); - p.cargo("build") + p.cargo("check") .env("BAR", "2") .with_stderr("[FINISHED] [..]") .run(); @@ -2542,8 +2542,8 @@ fn lld_is_fresh() { .file("src/lib.rs", "") .build(); - p.cargo("build").run(); - p.cargo("build -v") + p.cargo("check").run(); + p.cargo("check -v") .with_stderr("[FRESH] foo [..]\n[FINISHED] [..]") .run(); } @@ -2570,63 +2570,63 @@ fn env_in_code_causes_rebuild() { ) .build(); - p.cargo("build").env_remove("FOO").run(); - p.cargo("build") + p.cargo("check").env_remove("FOO").run(); + p.cargo("check") .env_remove("FOO") .with_stderr("[FINISHED] [..]") .run(); - p.cargo("build -v") + p.cargo("check -v") .env("FOO", "bar") .with_stderr( "\ [DIRTY] foo [..]: the environment variable FOO changed -[COMPILING][..] +[CHECKING][..] [RUNNING] `rustc [..] [FINISHED][..]", ) .run(); - p.cargo("build") + p.cargo("check") .env("FOO", "bar") .with_stderr("[FINISHED][..]") .run(); - p.cargo("build -v") + p.cargo("check -v") .env("FOO", "baz") .with_stderr( "\ [DIRTY] foo [..]: the environment variable FOO changed -[COMPILING][..] +[CHECKING][..] [RUNNING] `rustc [..] [FINISHED][..]", ) .run(); - p.cargo("build") + p.cargo("check") .env("FOO", "baz") .with_stderr("[FINISHED][..]") .run(); - p.cargo("build -v") + p.cargo("check -v") .env_remove("FOO") .with_stderr( "\ [DIRTY] foo [..]: the environment variable FOO changed -[COMPILING][..] +[CHECKING][..] [RUNNING] `rustc [..] [FINISHED][..]", ) .run(); - p.cargo("build") + p.cargo("check") .env_remove("FOO") .with_stderr("[FINISHED][..]") .run(); let interesting = " #!$\nabc\r\\\t\u{8}\r\n"; - p.cargo("build").env("FOO", interesting).run(); - p.cargo("build") + p.cargo("check").env("FOO", interesting).run(); + p.cargo("check") .env("FOO", interesting) .with_stderr("[FINISHED][..]") .run(); - p.cargo("build").env("FOO\nBAR", interesting).run(); - p.cargo("build") + p.cargo("check").env("FOO\nBAR", interesting).run(); + p.cargo("check") .env("FOO\nBAR", interesting) .with_stderr("[FINISHED][..]") .run(); @@ -2661,8 +2661,8 @@ fn env_build_script_no_rebuild() { ) .build(); - p.cargo("build").run(); - p.cargo("build").with_stderr("[FINISHED] [..]").run(); + p.cargo("check").run(); + p.cargo("check").with_stderr("[FINISHED] [..]").run(); } #[cargo_test] From be4f585a780cc082e92b2da985b8e01dccab06bc Mon Sep 17 00:00:00 2001 From: Scott Schafer Date: Wed, 15 Feb 2023 17:36:54 -0600 Subject: [PATCH 28/62] chore: update `future_incompat_report` tests to use check --- tests/testsuite/future_incompat_report.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/testsuite/future_incompat_report.rs b/tests/testsuite/future_incompat_report.rs index e59e14e61ccd..9f451a64c6b8 100644 --- a/tests/testsuite/future_incompat_report.rs +++ b/tests/testsuite/future_incompat_report.rs @@ -43,7 +43,7 @@ fn output_on_stable() { fn no_gate_future_incompat_report() { let p = simple_project(); - p.cargo("build --future-incompat-report") + p.cargo("check --future-incompat-report") .with_status(0) .run(); @@ -64,17 +64,17 @@ fn test_zero_future_incompat() { .build(); // No note if --future-incompat-report is not specified. - p.cargo("build") + p.cargo("check") .env("RUSTFLAGS", "-Zfuture-incompat-test") .with_stderr( "\ -[COMPILING] foo v0.0.0 [..] +[CHECKING] foo v0.0.0 [..] [FINISHED] [..] ", ) .run(); - p.cargo("build --future-incompat-report") + p.cargo("check --future-incompat-report") .env("RUSTFLAGS", "-Zfuture-incompat-test") .with_stderr( "\ @@ -201,7 +201,7 @@ fn test_multi_crate() { // Test that passing the correct id via '--id' doesn't generate a warning message let output = p - .cargo("build") + .cargo("check") .env("RUSTFLAGS", "-Zfuture-incompat-test") .exec_with_output() .unwrap(); From 834ccb3b49b09e006b7e3c04f7a61fd40eb5bdd8 Mon Sep 17 00:00:00 2001 From: Scott Schafer Date: Wed, 15 Feb 2023 17:51:46 -0600 Subject: [PATCH 29/62] chore: update `git` tests to use check --- tests/testsuite/git.rs | 200 ++++++++++++++++++++--------------------- 1 file changed, 100 insertions(+), 100 deletions(-) diff --git a/tests/testsuite/git.rs b/tests/testsuite/git.rs index 8abd7f1caee8..48e3eaaba206 100644 --- a/tests/testsuite/git.rs +++ b/tests/testsuite/git.rs @@ -531,7 +531,7 @@ fn cargo_compile_with_short_ssh_git() { ) .build(); - p.cargo("build") + p.cargo("check") .with_status(101) .with_stdout("") .with_stderr(&format!( @@ -661,11 +661,11 @@ fn recompilation() { .build(); // First time around we should compile both foo and bar - p.cargo("build") + p.cargo("check") .with_stderr(&format!( "[UPDATING] git repository `{}`\n\ - [COMPILING] bar v0.5.0 ({}#[..])\n\ - [COMPILING] foo v0.5.0 ([CWD])\n\ + [CHECKING] bar v0.5.0 ({}#[..])\n\ + [CHECKING] foo v0.5.0 ([CWD])\n\ [FINISHED] dev [unoptimized + debuginfo] target(s) \ in [..]\n", git_project.url(), @@ -674,12 +674,12 @@ fn recompilation() { .run(); // Don't recompile the second time - p.cargo("build").with_stdout("").run(); + p.cargo("check").with_stdout("").run(); // Modify a file manually, shouldn't trigger a recompile git_project.change_file("src/bar.rs", r#"pub fn bar() { println!("hello!"); }"#); - p.cargo("build").with_stdout("").run(); + p.cargo("check").with_stdout("").run(); p.cargo("update") .with_stderr(&format!( @@ -688,7 +688,7 @@ fn recompilation() { )) .run(); - p.cargo("build").with_stdout("").run(); + p.cargo("check").with_stdout("").run(); // Commit the changes and make sure we don't trigger a recompile because the // lock file says not to change @@ -697,7 +697,7 @@ fn recompilation() { git::commit(&repo); println!("compile after commit"); - p.cargo("build").with_stdout("").run(); + p.cargo("check").with_stdout("").run(); p.root().move_into_the_past(); // Update the dependency and carry on! @@ -710,10 +710,10 @@ fn recompilation() { )) .run(); println!("going for the last compile"); - p.cargo("build") + p.cargo("check") .with_stderr(&format!( - "[COMPILING] bar v0.5.0 ({}#[..])\n\ - [COMPILING] foo v0.5.0 ([CWD])\n\ + "[CHECKING] bar v0.5.0 ({}#[..])\n\ + [CHECKING] foo v0.5.0 ([CWD])\n\ [FINISHED] dev [unoptimized + debuginfo] target(s) \ in [..]\n", git_project.url(), @@ -722,9 +722,9 @@ fn recompilation() { // Make sure clean only cleans one dep p.cargo("clean -p foo").with_stdout("").run(); - p.cargo("build") + p.cargo("check") .with_stderr( - "[COMPILING] foo v0.5.0 ([CWD])\n\ + "[CHECKING] foo v0.5.0 ([CWD])\n\ [FINISHED] dev [unoptimized + debuginfo] target(s) \ in [..]", ) @@ -801,14 +801,14 @@ fn update_with_shared_deps() { .build(); // First time around we should compile both foo and bar - p.cargo("build") + p.cargo("check") .with_stderr(&format!( "\ [UPDATING] git repository `{git}` -[COMPILING] bar v0.5.0 ({git}#[..]) -[COMPILING] [..] v0.5.0 ([..]) -[COMPILING] [..] v0.5.0 ([..]) -[COMPILING] foo v0.5.0 ([CWD]) +[CHECKING] bar v0.5.0 ({git}#[..]) +[CHECKING] [..] v0.5.0 ([..]) +[CHECKING] [..] v0.5.0 ([..]) +[CHECKING] foo v0.5.0 ([CWD]) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..]\n", git = git_project.url(), )) @@ -865,13 +865,13 @@ Caused by: // Make sure we still only compile one version of the git repo println!("build"); - p.cargo("build") + p.cargo("check") .with_stderr(&format!( "\ -[COMPILING] bar v0.5.0 ({git}#[..]) -[COMPILING] [..] v0.5.0 ([CWD][..]dep[..]) -[COMPILING] [..] v0.5.0 ([CWD][..]dep[..]) -[COMPILING] foo v0.5.0 ([CWD]) +[CHECKING] bar v0.5.0 ({git}#[..]) +[CHECKING] [..] v0.5.0 ([CWD][..]dep[..]) +[CHECKING] [..] v0.5.0 ([CWD][..]dep[..]) +[CHECKING] foo v0.5.0 ([CWD]) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..]\n", git = git_project.url(), )) @@ -924,13 +924,13 @@ fn dep_with_submodule() { .build(); project - .cargo("build") + .cargo("check") .with_stderr( "\ [UPDATING] git repository [..] [UPDATING] git submodule `file://[..]/dep2` -[COMPILING] dep1 [..] -[COMPILING] foo [..] +[CHECKING] dep1 [..] +[CHECKING] foo [..] [FINISHED] dev [unoptimized + debuginfo] target(s) in [..]\n", ) .run(); @@ -990,14 +990,14 @@ fn dep_with_relative_submodule() { .build(); project - .cargo("build") + .cargo("check") .with_stderr( "\ [UPDATING] git repository [..] [UPDATING] git submodule `file://[..]/deployment` -[COMPILING] deployment [..] -[COMPILING] base [..] -[COMPILING] foo [..] +[CHECKING] deployment [..] +[CHECKING] base [..] +[CHECKING] foo [..] [FINISHED] dev [unoptimized + debuginfo] target(s) in [..]\n", ) .run(); @@ -1077,7 +1077,7 @@ Caused by: path2url(git_project.root()) ); - p.cargo("build") + p.cargo("check") .with_stderr(expected) .with_status(101) .run(); @@ -1125,13 +1125,13 @@ fn dep_with_skipped_submodule() { .file("src/main.rs", "fn main() {}") .build(); - foo.cargo("build") + foo.cargo("check") .with_stderr( "\ [UPDATING] git repository `file://[..]/bar` [SKIPPING] git submodule `file://[..]/qux` [..] -[COMPILING] bar [..] -[COMPILING] foo [..] +[CHECKING] bar [..] +[CHECKING] foo [..] [FINISHED] dev [unoptimized + debuginfo] target(s) in [..]\n", ) .run(); @@ -1249,13 +1249,13 @@ fn two_deps_only_update_one() { println!("dep1 head sha: {}", git_repo_head_sha(&git1)); println!("dep2 head sha: {}", git_repo_head_sha(&git2)); - p.cargo("build") + p.cargo("check") .with_stderr( "[UPDATING] git repository `[..]`\n\ [UPDATING] git repository `[..]`\n\ - [COMPILING] [..] v0.5.0 ([..])\n\ - [COMPILING] [..] v0.5.0 ([..])\n\ - [COMPILING] foo v0.5.0 ([CWD])\n\ + [CHECKING] [..] v0.5.0 ([..])\n\ + [CHECKING] [..] v0.5.0 ([..])\n\ + [CHECKING] foo v0.5.0 ([CWD])\n\ [FINISHED] dev [unoptimized + debuginfo] target(s) in [..]\n", ) .run(); @@ -1521,11 +1521,11 @@ fn dev_deps_with_testing() { // Generate a lock file which did not use `bar` to compile, but had to update // `bar` to generate the lock file - p.cargo("build") + p.cargo("check") .with_stderr(&format!( "\ [UPDATING] git repository `{bar}` -[COMPILING] foo v0.5.0 ([CWD]) +[CHECKING] foo v0.5.0 ([CWD]) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", bar = p2.url() @@ -1568,7 +1568,7 @@ fn git_build_cmd_freshness() { sleep_ms(1000); - foo.cargo("build") + foo.cargo("check") .with_stderr( "\ [COMPILING] foo v0.0.0 ([CWD]) @@ -1579,12 +1579,12 @@ fn git_build_cmd_freshness() { // Smoke test to make sure it doesn't compile again println!("first pass"); - foo.cargo("build").with_stdout("").run(); + foo.cargo("check").with_stdout("").run(); // Modify an ignored file and make sure we don't rebuild println!("second pass"); foo.change_file("src/bar.rs", ""); - foo.cargo("build").with_stdout("").run(); + foo.cargo("check").with_stdout("").run(); } #[cargo_test] @@ -1626,11 +1626,11 @@ fn git_name_not_always_needed() { // Generate a lock file which did not use `bar` to compile, but had to update // `bar` to generate the lock file - p.cargo("build") + p.cargo("check") .with_stderr(&format!( "\ [UPDATING] git repository `{bar}` -[COMPILING] foo v0.5.0 ([CWD]) +[CHECKING] foo v0.5.0 ([CWD]) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", bar = p2.url() @@ -1668,12 +1668,12 @@ fn git_repo_changing_no_rebuild() { .file("build.rs", "fn main() {}") .build(); p1.root().move_into_the_past(); - p1.cargo("build") + p1.cargo("check") .with_stderr(&format!( "\ [UPDATING] git repository `{bar}` [COMPILING] [..] -[COMPILING] [..] +[CHECKING] [..] [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", bar = bar.url() @@ -1705,12 +1705,12 @@ fn git_repo_changing_no_rebuild() { ) .file("src/main.rs", "fn main() {}") .build(); - p2.cargo("build") + p2.cargo("check") .with_stderr(&format!( "\ [UPDATING] git repository `{bar}` -[COMPILING] [..] -[COMPILING] [..] +[CHECKING] [..] +[CHECKING] [..] [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", bar = bar.url() @@ -1719,7 +1719,7 @@ fn git_repo_changing_no_rebuild() { // And now for the real test! Make sure that p1 doesn't get rebuilt // even though the git repo has changed. - p1.cargo("build").with_stdout("").run(); + p1.cargo("check").with_stdout("").run(); } #[cargo_test] @@ -1853,11 +1853,11 @@ fn warnings_in_git_dep() { .file("src/main.rs", "fn main() {}") .build(); - p.cargo("build") + p.cargo("check") .with_stderr(&format!( "[UPDATING] git repository `{}`\n\ - [COMPILING] bar v0.5.0 ({}#[..])\n\ - [COMPILING] foo v0.5.0 ([CWD])\n\ + [CHECKING] bar v0.5.0 ({}#[..])\n\ + [CHECKING] foo v0.5.0 ([CWD])\n\ [FINISHED] dev [unoptimized + debuginfo] target(s) in [..]\n", bar.url(), bar.url(), @@ -2035,14 +2035,14 @@ fn switch_deps_does_not_update_transitive() { .file("src/main.rs", "fn main() {}") .build(); - p.cargo("build") + p.cargo("check") .with_stderr(&format!( "\ [UPDATING] git repository `{}` [UPDATING] git repository `{}` -[COMPILING] transitive [..] -[COMPILING] dep [..] -[COMPILING] foo [..] +[CHECKING] transitive [..] +[CHECKING] dep [..] +[CHECKING] foo [..] [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", dep1.url(), @@ -2067,12 +2067,12 @@ fn switch_deps_does_not_update_transitive() { ), ); - p.cargo("build") + p.cargo("check") .with_stderr(&format!( "\ [UPDATING] git repository `{}` -[COMPILING] dep [..] -[COMPILING] foo [..] +[CHECKING] dep [..] +[CHECKING] foo [..] [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", dep2.url() @@ -2119,7 +2119,7 @@ fn update_one_source_updates_all_packages_in_that_git_source() { .file("src/main.rs", "fn main() {}") .build(); - p.cargo("build").run(); + p.cargo("check").run(); let repo = git2::Repository::open(&dep.root()).unwrap(); let rev1 = repo.revparse_single("HEAD").unwrap().id(); @@ -2182,13 +2182,13 @@ fn switch_sources() { .file("b/src/lib.rs", "pub fn main() {}") .build(); - p.cargo("build") + p.cargo("check") .with_stderr( "\ [UPDATING] git repository `file://[..]a1` -[COMPILING] a v0.5.0 ([..]a1#[..] -[COMPILING] b v0.5.0 ([..]) -[COMPILING] foo v0.5.0 ([..]) +[CHECKING] a v0.5.0 ([..]a1#[..] +[CHECKING] b v0.5.0 ([..]) +[CHECKING] foo v0.5.0 ([..]) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", ) @@ -2209,13 +2209,13 @@ fn switch_sources() { ), ); - p.cargo("build") + p.cargo("check") .with_stderr( "\ [UPDATING] git repository `file://[..]a2` -[COMPILING] a v0.5.1 ([..]a2#[..] -[COMPILING] b v0.5.0 ([..]) -[COMPILING] foo v0.5.0 ([..]) +[CHECKING] a v0.5.1 ([..]a2#[..] +[CHECKING] b v0.5.0 ([..]) +[CHECKING] foo v0.5.0 ([..]) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", ) @@ -2252,7 +2252,7 @@ fn dont_require_submodules_are_checked_out() { let dst = paths::home().join("foo"); git2::Repository::clone(&url, &dst).unwrap(); - git1.cargo("build -v").cwd(&dst).run(); + git1.cargo("check -v").cwd(&dst).run(); } #[cargo_test] @@ -2338,12 +2338,12 @@ fn lints_are_suppressed() { .file("src/lib.rs", "") .build(); - p.cargo("build") + p.cargo("check") .with_stderr( "\ [UPDATING] git repository `[..]` -[COMPILING] a v0.5.0 ([..]) -[COMPILING] foo v0.0.1 ([..]) +[CHECKING] a v0.5.0 ([..]) +[CHECKING] foo v0.0.1 ([..]) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", ) @@ -2381,12 +2381,12 @@ fn denied_lints_are_allowed() { .file("src/lib.rs", "") .build(); - p.cargo("build") + p.cargo("check") .with_stderr( "\ [UPDATING] git repository `[..]` -[COMPILING] a v0.5.0 ([..]) -[COMPILING] foo v0.0.1 ([..]) +[CHECKING] a v0.5.0 ([..]) +[CHECKING] foo v0.0.1 ([..]) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", ) @@ -2422,7 +2422,7 @@ fn add_a_git_dep() { .file("a/src/lib.rs", "") .build(); - p.cargo("build").run(); + p.cargo("check").run(); assert!(paths::home().join(".cargo/git/CACHEDIR.TAG").is_file()); @@ -2442,7 +2442,7 @@ fn add_a_git_dep() { ), ); - p.cargo("build").run(); + p.cargo("check").run(); } #[cargo_test] @@ -2487,7 +2487,7 @@ fn two_at_rev_instead_of_tag() { .build(); p.cargo("generate-lockfile").run(); - p.cargo("build -v").run(); + p.cargo("check -v").run(); } #[cargo_test] @@ -2516,9 +2516,9 @@ fn include_overrides_gitignore() { .file("build.rs", "fn main() {}") }); - p.cargo("build").run(); + p.cargo("check").run(); p.change_file("ignored.txt", "Trigger rebuild."); - p.cargo("build -v") + p.cargo("check -v") .with_stderr( "\ [DIRTY] foo v0.5.0 ([..]): the precalculated components changed @@ -2599,7 +2599,7 @@ fn invalid_git_dependency_manifest() { let git_root = git_project.root(); project - .cargo("build") + .cargo("check") .with_status(101) .with_stderr(&format!( "\ @@ -2693,13 +2693,13 @@ fn failed_submodule_checkout() { .build(); project - .cargo("build") + .cargo("check") .with_status(101) .with_stderr_contains(" failed to update submodule `src`") .with_stderr_contains(" failed to update submodule `bar`") .run(); project - .cargo("build") + .cargo("check") .with_status(101) .with_stderr_contains(" failed to update submodule `src`") .with_stderr_contains(" failed to update submodule `bar`") @@ -2750,14 +2750,14 @@ fn use_the_cli() { [RUNNING] `git fetch [..]` From [..] * [new ref] -> origin/HEAD -[COMPILING] dep1 [..] +[CHECKING] dep1 [..] [RUNNING] `rustc [..]` -[COMPILING] foo [..] +[CHECKING] foo [..] [RUNNING] `rustc [..]` [FINISHED] [..] "; - project.cargo("build -v").with_stderr(stderr).run(); + project.cargo("check -v").with_stderr(stderr).run(); assert!(paths::home().join(".cargo/git/CACHEDIR.TAG").is_file()); } @@ -2810,7 +2810,7 @@ fn templatedir_doesnt_cause_problems() { ) .unwrap(); - p.cargo("build").run(); + p.cargo("check").run(); } #[cargo_test(requires_git)] @@ -3068,12 +3068,12 @@ fn default_not_master() { .build(); project - .cargo("build") + .cargo("check") .with_stderr( "\ [UPDATING] git repository `[..]` -[COMPILING] dep1 v0.5.0 ([..]) -[COMPILING] foo v0.5.0 ([..]) +[CHECKING] dep1 v0.5.0 ([..]) +[CHECKING] foo v0.5.0 ([..]) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..]", ) .run(); @@ -3108,7 +3108,7 @@ fn historical_lockfile_works() { .file("src/lib.rs", "") .build(); - project.cargo("build").run(); + project.cargo("check").run(); project.change_file( "Cargo.lock", &format!( @@ -3131,7 +3131,7 @@ dependencies = [ ), ); project - .cargo("build") + .cargo("check") .with_stderr("[FINISHED] [..]\n") .run(); } @@ -3188,7 +3188,7 @@ dependencies = [ head_id ), ); - project.cargo("build").run(); + project.cargo("check").run(); } #[cargo_test] @@ -3237,15 +3237,15 @@ fn two_dep_forms() { // the master branch. Then it'll compile 4 crates, the 2 git deps, then // the two local deps. project - .cargo("build") + .cargo("check") .with_stderr( "\ [UPDATING] [..] [UPDATING] [..] -[COMPILING] [..] -[COMPILING] [..] -[COMPILING] [..] -[COMPILING] [..] +[CHECKING] [..] +[CHECKING] [..] +[CHECKING] [..] +[CHECKING] [..] [FINISHED] [..] ", ) From f6f8bfe155c549fb5fa9b3acb4a51b60e1e14bfd Mon Sep 17 00:00:00 2001 From: Scott Schafer Date: Wed, 15 Feb 2023 17:53:12 -0600 Subject: [PATCH 30/62] chore: update `git_auth` tests to use check --- tests/testsuite/git_auth.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/testsuite/git_auth.rs b/tests/testsuite/git_auth.rs index 69af128085a0..9f2bece8b8de 100644 --- a/tests/testsuite/git_auth.rs +++ b/tests/testsuite/git_auth.rs @@ -132,7 +132,7 @@ fn http_auth_offered() { // This is a "contains" check because the last error differs by platform, // may span multiple lines, and isn't relevant to this test. - p.cargo("build") + p.cargo("check") .with_status(101) .with_stderr_contains(&format!( "\ @@ -203,7 +203,7 @@ fn https_something_happens() { ) .build(); - p.cargo("build -v") + p.cargo("check -v") .with_status(101) .with_stderr_contains(&format!( "[UPDATING] git repository `https://{addr}/foo/bar`", @@ -258,7 +258,7 @@ fn ssh_something_happens() { .file("src/main.rs", "") .build(); - p.cargo("build -v") + p.cargo("check -v") .with_status(101) .with_stderr_contains(&format!( "[UPDATING] git repository `ssh://{addr}/foo/bar`", @@ -292,7 +292,7 @@ fn net_err_suggests_fetch_with_cli() { .file("src/lib.rs", "") .build(); - p.cargo("build -v") + p.cargo("check -v") .with_status(101) .with_stderr( "\ @@ -329,7 +329,7 @@ Caused by: ", ); - p.cargo("build -v") + p.cargo("check -v") .with_status(101) .with_stderr_contains("[..]Unable to update[..]") .with_stderr_does_not_contain("[..]try enabling `git-fetch-with-cli`[..]") @@ -363,7 +363,7 @@ fn instead_of_url_printed() { .file("src/lib.rs", "") .build(); - p.cargo("build") + p.cargo("check") .with_status(101) .with_stderr(&format!( "\ From 8de9a25d46c06f2aff2619b8ab6b6b70d753e827 Mon Sep 17 00:00:00 2001 From: Scott Schafer Date: Wed, 15 Feb 2023 17:54:30 -0600 Subject: [PATCH 31/62] chore: update `git_gc` tests to use check --- tests/testsuite/git_gc.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/testsuite/git_gc.rs b/tests/testsuite/git_gc.rs index 045bc78ad5e0..4a8228f87c96 100644 --- a/tests/testsuite/git_gc.rs +++ b/tests/testsuite/git_gc.rs @@ -36,7 +36,7 @@ fn run_test(path_env: Option<&OsStr>) { .build(); Package::new("bar", "0.1.0").publish(); - foo.cargo("build").run(); + foo.cargo("check").run(); let index = find_index(); let path = paths::home().join("tmp"); From e87b1b33e7c504c6dfcf93ef278125d36ed623ca Mon Sep 17 00:00:00 2001 From: Scott Schafer Date: Wed, 15 Feb 2023 17:57:30 -0600 Subject: [PATCH 32/62] chore: update `inheritable_workspace_fields` tests to use check --- .../testsuite/inheritable_workspace_fields.rs | 76 +++++++++---------- 1 file changed, 38 insertions(+), 38 deletions(-) diff --git a/tests/testsuite/inheritable_workspace_fields.rs b/tests/testsuite/inheritable_workspace_fields.rs index d371c9f6de1d..72de2e4ad216 100644 --- a/tests/testsuite/inheritable_workspace_fields.rs +++ b/tests/testsuite/inheritable_workspace_fields.rs @@ -50,11 +50,11 @@ fn permit_additional_workspace_fields() { .file("bar/src/main.rs", "fn main() {}") .build(); - p.cargo("build") + p.cargo("check") // Should not warn about unused fields. .with_stderr( "\ -[COMPILING] bar v0.1.0 ([CWD]/bar) +[CHECKING] bar v0.1.0 ([CWD]/bar) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", ) @@ -92,7 +92,7 @@ fn deny_optional_dependencies() { .file("bar/src/main.rs", "fn main() {}") .build(); - p.cargo("build") + p.cargo("check") .with_status(101) .with_stderr( "\ @@ -277,15 +277,15 @@ fn inherit_own_dependencies() { Package::new("dep-build", "0.8.2").publish(); Package::new("dep-dev", "0.5.2").publish(); - p.cargo("build") + p.cargo("check") .with_stderr( "\ [UPDATING] `[..]` index [DOWNLOADING] crates ... [DOWNLOADED] dep-build v0.8.2 ([..]) [DOWNLOADED] dep v0.1.2 ([..]) -[COMPILING] dep v0.1.2 -[COMPILING] bar v0.2.0 ([CWD]) +[CHECKING] dep v0.1.2 +[CHECKING] bar v0.2.0 ([CWD]) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", ) @@ -414,14 +414,14 @@ fn inherit_own_detailed_dependencies() { .feature("testing", &vec![]) .publish(); - p.cargo("build") + p.cargo("check") .with_stderr( "\ [UPDATING] `[..]` index [DOWNLOADING] crates ... [DOWNLOADED] dep v0.1.2 ([..]) -[COMPILING] dep v0.1.2 -[COMPILING] bar v0.2.0 ([CWD]) +[CHECKING] dep v0.1.2 +[CHECKING] bar v0.2.0 ([CWD]) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", ) @@ -519,7 +519,7 @@ fn inherit_from_own_undefined_field() { .file("src/main.rs", "fn main() {}") .build(); - p.cargo("build") + p.cargo("check") .with_status(101) .with_stderr( "\ @@ -568,7 +568,7 @@ fn inherited_dependencies_union_features() { .file("src/main.rs", "fn main() {}") .build(); - p.cargo("build") + p.cargo("check") .with_stderr( "\ [UPDATING] `[..]` index @@ -576,10 +576,10 @@ fn inherited_dependencies_union_features() { [DOWNLOADED] fancy_dep v0.2.4 ([..]) [DOWNLOADED] dep v0.1.0 ([..]) [DOWNLOADED] dancy_dep v0.6.8 ([..]) -[COMPILING] [..] -[COMPILING] [..] -[COMPILING] dep v0.1.0 -[COMPILING] bar v0.2.0 ([CWD]) +[CHECKING] [..] +[CHECKING] [..] +[CHECKING] dep v0.1.0 +[CHECKING] bar v0.2.0 ([CWD]) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", ) @@ -782,15 +782,15 @@ fn inherit_dependencies() { Package::new("dep-build", "0.8.2").publish(); Package::new("dep-dev", "0.5.2").publish(); - p.cargo("build") + p.cargo("check") .with_stderr( "\ [UPDATING] `[..]` index [DOWNLOADING] crates ... [DOWNLOADED] dep-build v0.8.2 ([..]) [DOWNLOADED] dep v0.1.2 ([..]) -[COMPILING] dep v0.1.2 -[COMPILING] bar v0.2.0 ([CWD]/bar) +[CHECKING] dep v0.1.2 +[CHECKING] bar v0.2.0 ([CWD]/bar) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", ) @@ -922,14 +922,14 @@ fn inherit_target_dependencies() { Package::new("dep", "0.1.2").publish(); - p.cargo("build") + p.cargo("check") .with_stderr( "\ [UPDATING] `[..]` index [DOWNLOADING] crates ... [DOWNLOADED] dep v0.1.2 ([..]) -[COMPILING] dep v0.1.2 -[COMPILING] bar v0.2.0 ([CWD]/bar) +[CHECKING] dep v0.1.2 +[CHECKING] bar v0.2.0 ([CWD]/bar) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", ) @@ -968,11 +968,11 @@ fn inherit_dependency_override_optional() { .file("bar/src/main.rs", "fn main() {}") .build(); - p.cargo("build") + p.cargo("check") .with_stderr( "\ [UPDATING] `[..]` index -[COMPILING] bar v0.2.0 ([CWD]/bar) +[CHECKING] bar v0.2.0 ([CWD]/bar) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", ) @@ -1010,16 +1010,16 @@ fn inherit_dependency_features() { .file("src/main.rs", "fn main() {}") .build(); - p.cargo("build") + p.cargo("check") .with_stderr( "\ [UPDATING] `[..]` index [DOWNLOADING] crates ... [DOWNLOADED] fancy_dep v0.2.4 ([..]) [DOWNLOADED] dep v0.1.0 ([..]) -[COMPILING] fancy_dep v0.2.4 -[COMPILING] dep v0.1.0 -[COMPILING] bar v0.2.0 ([CWD]) +[CHECKING] fancy_dep v0.2.4 +[CHECKING] dep v0.1.0 +[CHECKING] bar v0.2.0 ([CWD]) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", ) @@ -1081,12 +1081,12 @@ fn inherit_detailed_dependencies() { let git_root = git_project.root(); - p.cargo("build") + p.cargo("check") .with_stderr(&format!( "\ [UPDATING] git repository `{}`\n\ -[COMPILING] detailed v0.5.0 ({}?branch=branchy#[..])\n\ -[COMPILING] bar v0.2.0 ([CWD]/bar)\n\ +[CHECKING] detailed v0.5.0 ({}?branch=branchy#[..])\n\ +[CHECKING] bar v0.2.0 ([CWD]/bar)\n\ [FINISHED] dev [unoptimized + debuginfo] target(s) in [..]\n", path2url(&git_root), path2url(&git_root), @@ -1123,11 +1123,11 @@ fn inherit_path_dependencies() { .file("dep/src/lib.rs", "") .build(); - p.cargo("build") + p.cargo("check") .with_stderr( "\ -[COMPILING] dep v0.9.0 ([CWD]/dep) -[COMPILING] bar v0.2.0 ([CWD]/bar) +[CHECKING] dep v0.9.0 ([CWD]/dep) +[CHECKING] bar v0.2.0 ([CWD]/bar) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", ) @@ -1166,7 +1166,7 @@ fn error_workspace_false() { .file("bar/src/main.rs", "fn main() {}") .build(); - p.cargo("build") + p.cargo("check") .cwd("bar") .with_status(101) .with_stderr( @@ -1209,7 +1209,7 @@ fn error_workspace_dependency_looked_for_workspace_itself() { .file("src/main.rs", "fn main() {}") .build(); - p.cargo("build") + p.cargo("check") .with_status(101) .with_stderr( "\ @@ -1252,7 +1252,7 @@ fn error_malformed_workspace_root() { .file("bar/src/main.rs", "fn main() {}") .build(); - p.cargo("build") + p.cargo("check") .cwd("bar") .with_status(101) .with_stderr( @@ -1296,7 +1296,7 @@ fn error_no_root_workspace() { .file("bar/src/main.rs", "fn main() {}") .build(); - p.cargo("build") + p.cargo("check") .cwd("bar") .with_status(101) .with_stderr( @@ -1341,7 +1341,7 @@ fn error_inherit_unspecified_dependency() { .file("bar/src/main.rs", "fn main() {}") .build(); - p.cargo("build") + p.cargo("check") .cwd("bar") .with_status(101) .with_stderr( From e9a032196a2662168ebac8c7a5458b0bf415a94d Mon Sep 17 00:00:00 2001 From: Scott Schafer Date: Wed, 15 Feb 2023 18:00:50 -0600 Subject: [PATCH 33/62] chore: update `jobserver` tests to use check --- tests/testsuite/jobserver.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/testsuite/jobserver.rs b/tests/testsuite/jobserver.rs index bcac3fbb35d9..c645e0d72268 100644 --- a/tests/testsuite/jobserver.rs +++ b/tests/testsuite/jobserver.rs @@ -55,7 +55,7 @@ fn jobserver_exists() { // Explicitly use `-j2` to ensure that there's eventually going to be a // token to read from `validate` above, since running the build script // itself consumes a token. - p.cargo("build -j2").run(); + p.cargo("check -j2").run(); } #[cargo_test] From 46b1ae35d90372b33040f5bc3a4b33c11d283520 Mon Sep 17 00:00:00 2001 From: Scott Schafer Date: Wed, 15 Feb 2023 18:02:48 -0600 Subject: [PATCH 34/62] chore: update `local_registry` tests to use check --- tests/testsuite/local_registry.rs | 38 +++++++++++++++---------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/tests/testsuite/local_registry.rs b/tests/testsuite/local_registry.rs index 1e2424546014..374ea9370d00 100644 --- a/tests/testsuite/local_registry.rs +++ b/tests/testsuite/local_registry.rs @@ -88,7 +88,7 @@ fn not_found() { ) .build(); - p.cargo("build") + p.cargo("check") .with_status(101) .with_stderr( "\ @@ -167,12 +167,12 @@ fn multiple_versions() { ) .build(); - p.cargo("build") + p.cargo("check") .with_stderr( "\ [UNPACKING] bar v0.1.0 ([..]) -[COMPILING] bar v0.1.0 -[COMPILING] foo v0.0.1 ([CWD]) +[CHECKING] bar v0.1.0 +[CHECKING] foo v0.0.1 ([CWD]) [FINISHED] [..] ", ) @@ -227,14 +227,14 @@ fn multiple_names() { ) .build(); - p.cargo("build") + p.cargo("check") .with_stderr( "\ [UNPACKING] [..] [UNPACKING] [..] -[COMPILING] [..] -[COMPILING] [..] -[COMPILING] foo v0.0.1 ([CWD]) +[CHECKING] [..] +[CHECKING] [..] +[CHECKING] foo v0.0.1 ([CWD]) [FINISHED] [..] ", ) @@ -281,14 +281,14 @@ fn interdependent() { ) .build(); - p.cargo("build") + p.cargo("check") .with_stderr( "\ [UNPACKING] [..] [UNPACKING] [..] -[COMPILING] bar v0.0.1 -[COMPILING] baz v0.1.0 -[COMPILING] foo v0.0.1 ([CWD]) +[CHECKING] bar v0.0.1 +[CHECKING] baz v0.1.0 +[CHECKING] foo v0.0.1 ([CWD]) [FINISHED] [..] ", ) @@ -349,14 +349,14 @@ fn path_dep_rewritten() { ) .build(); - p.cargo("build") + p.cargo("check") .with_stderr( "\ [UNPACKING] [..] [UNPACKING] [..] -[COMPILING] bar v0.0.1 -[COMPILING] baz v0.1.0 -[COMPILING] foo v0.0.1 ([CWD]) +[CHECKING] bar v0.0.1 +[CHECKING] baz v0.1.0 +[CHECKING] foo v0.0.1 ([CWD]) [FINISHED] [..] ", ) @@ -393,7 +393,7 @@ fn invalid_dir_bad() { ) .build(); - p.cargo("build") + p.cargo("check") .with_status(101) .with_stderr( "\ @@ -443,7 +443,7 @@ fn different_directory_replacing_the_registry_is_bad() { // Generate a lock file against the crates.io registry Package::new("bar", "0.0.1").publish(); - p.cargo("build").run(); + p.cargo("check").run(); // Switch back to our directory source, and now that we're replacing // crates.io make sure that this fails because we're replacing with a @@ -455,7 +455,7 @@ fn different_directory_replacing_the_registry_is_bad() { .local(true) .publish(); - p.cargo("build") + p.cargo("check") .with_status(101) .with_stderr( "\ From ae2692324b5bf59f29097232404ffff768e93a73 Mon Sep 17 00:00:00 2001 From: Scott Schafer Date: Wed, 15 Feb 2023 18:04:09 -0600 Subject: [PATCH 35/62] chore: update `lockfile_compat` tests to use check --- tests/testsuite/lockfile_compat.rs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/tests/testsuite/lockfile_compat.rs b/tests/testsuite/lockfile_compat.rs index d14ac6f8da2f..aad8723c3b63 100644 --- a/tests/testsuite/lockfile_compat.rs +++ b/tests/testsuite/lockfile_compat.rs @@ -111,7 +111,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" .file("Cargo.lock", &old_lockfile) .build(); - p.cargo("build --locked").run(); + p.cargo("check --locked").run(); let lock = p.read_lockfile(); assert_match_exact(&old_lockfile, &lock); @@ -158,7 +158,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" let p = p.build(); - p.cargo("build").run(); + p.cargo("check").run(); let lock = p.read_lockfile(); assert_match_exact( @@ -223,7 +223,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" let p = p.build(); - p.cargo("build") + p.cargo("check") .with_status(101) .with_stderr( "\ @@ -398,7 +398,7 @@ fn current_lockfile_format() { .file("src/lib.rs", ""); let p = p.build(); - p.cargo("build").run(); + p.cargo("check").run(); let actual = p.read_lockfile(); @@ -460,7 +460,7 @@ dependencies = [ let p = p.build(); - p.cargo("build").run(); + p.cargo("check").run(); let lock = p.read_lockfile(); assert_match_exact( @@ -505,7 +505,7 @@ fn locked_correct_error() { .file("src/lib.rs", ""); let p = p.build(); - p.cargo("build --locked") + p.cargo("check --locked") .with_status(101) .with_stderr( "\ @@ -762,7 +762,7 @@ dependencies = [ .file("Cargo.lock", &lockfile) .build(); - p.cargo("build --locked").run(); + p.cargo("check --locked").run(); } #[cargo_test] @@ -832,7 +832,7 @@ source = "git+{url}#{sha}" .file("Cargo.lock", &lockfile) .build(); - p.cargo("build").run(); + p.cargo("check").run(); assert_eq!(p.read_file("Cargo.lock"), lockfile); } @@ -874,7 +874,7 @@ dependencies = [ ]"#, ) .build(); - p.cargo("build") + p.cargo("check") .with_status(101) .with_stderr( "\ From 76b5786a3a83408b5afce477d4acee0faba0e177 Mon Sep 17 00:00:00 2001 From: Scott Schafer Date: Wed, 15 Feb 2023 18:07:42 -0600 Subject: [PATCH 36/62] chore: update `message_format` tests to use check --- tests/testsuite/message_format.rs | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/tests/testsuite/message_format.rs b/tests/testsuite/message_format.rs index 5a79056cf1b8..e9310b2616ad 100644 --- a/tests/testsuite/message_format.rs +++ b/tests/testsuite/message_format.rs @@ -29,17 +29,17 @@ fn double_json_works() { .file("src/main.rs", "fn main() {}") .build(); - p.cargo("build --message-format json,json-render-diagnostics") + p.cargo("check --message-format json,json-render-diagnostics") .run(); - p.cargo("build --message-format json,json-diagnostic-short") + p.cargo("check --message-format json,json-diagnostic-short") .run(); - p.cargo("build --message-format json,json-diagnostic-rendered-ansi") + p.cargo("check --message-format json,json-diagnostic-rendered-ansi") .run(); - p.cargo("build --message-format json --message-format json-diagnostic-rendered-ansi") + p.cargo("check --message-format json --message-format json-diagnostic-rendered-ansi") .run(); - p.cargo("build --message-format json-diagnostic-rendered-ansi") + p.cargo("check --message-format json-diagnostic-rendered-ansi") .run(); - p.cargo("build --message-format json-diagnostic-short,json-diagnostic-rendered-ansi") + p.cargo("check --message-format json-diagnostic-short,json-diagnostic-rendered-ansi") .run(); } @@ -62,7 +62,7 @@ fn cargo_renders() { .file("bar/src/lib.rs", "") .build(); - p.cargo("build --message-format json-render-diagnostics") + p.cargo("check --message-format json-render-diagnostics") .with_status(101) .with_stdout( "{\"reason\":\"compiler-artifact\",[..]\n\ @@ -70,8 +70,8 @@ fn cargo_renders() { ) .with_stderr_contains( "\ -[COMPILING] bar [..] -[COMPILING] foo [..] +[CHECKING] bar [..] +[CHECKING] foo [..] error[..]`main`[..] ", ) @@ -85,11 +85,11 @@ fn cargo_renders_short() { .file("src/main.rs", "") .build(); - p.cargo("build --message-format json-render-diagnostics,json-diagnostic-short") + p.cargo("check --message-format json-render-diagnostics,json-diagnostic-short") .with_status(101) .with_stderr_contains( "\ -[COMPILING] foo [..] +[CHECKING] foo [..] error[..]`main`[..] ", ) @@ -104,7 +104,7 @@ fn cargo_renders_ansi() { .file("src/main.rs", "") .build(); - p.cargo("build --message-format json-diagnostic-rendered-ansi") + p.cargo("check --message-format json-diagnostic-rendered-ansi") .with_status(101) .with_stdout_contains("[..]\\u001b[38;5;9merror[..]") .run(); From 48ef78bc004c6a5ba26d370b14ad0a3edacfb7a0 Mon Sep 17 00:00:00 2001 From: Scott Schafer Date: Wed, 15 Feb 2023 18:10:40 -0600 Subject: [PATCH 37/62] chore: update `metabuild` tests to use check --- tests/testsuite/metabuild.rs | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/tests/testsuite/metabuild.rs b/tests/testsuite/metabuild.rs index 0b6d7304bdc6..022d0bff0466 100644 --- a/tests/testsuite/metabuild.rs +++ b/tests/testsuite/metabuild.rs @@ -22,7 +22,7 @@ fn metabuild_gated() { .file("src/lib.rs", "") .build(); - p.cargo("build") + p.cargo("check") .masquerade_as_nightly_cargo(&["metabuild"]) .with_status(101) .with_stderr( @@ -83,7 +83,7 @@ fn basic_project() -> Project { #[cargo_test] fn metabuild_basic() { let p = basic_project(); - p.cargo("build -vv") + p.cargo("check -vv") .masquerade_as_nightly_cargo(&["metabuild"]) .with_stdout_contains("[foo 0.0.1] Hello mb") .with_stdout_contains("[foo 0.0.1] Hello mb-other") @@ -115,7 +115,7 @@ fn metabuild_error_both() { ) .build(); - p.cargo("build -vv") + p.cargo("check -vv") .masquerade_as_nightly_cargo(&["metabuild"]) .with_status(101) .with_stderr_contains( @@ -145,7 +145,7 @@ fn metabuild_missing_dep() { .file("src/lib.rs", "") .build(); - p.cargo("build -vv") + p.cargo("check -vv") .masquerade_as_nightly_cargo(&["metabuild"]) .with_status(101) .with_stderr_contains( @@ -182,12 +182,12 @@ fn metabuild_optional_dep() { ) .build(); - p.cargo("build -vv") + p.cargo("check -vv") .masquerade_as_nightly_cargo(&["metabuild"]) .with_stdout_does_not_contain("[foo 0.0.1] Hello mb") .run(); - p.cargo("build -vv --features mb") + p.cargo("check -vv --features mb") .masquerade_as_nightly_cargo(&["metabuild"]) .with_stdout_contains("[foo 0.0.1] Hello mb") .run(); @@ -227,7 +227,7 @@ fn metabuild_lib_name() { ) .build(); - p.cargo("build -vv") + p.cargo("check -vv") .masquerade_as_nightly_cargo(&["metabuild"]) .with_stdout_contains("[foo 0.0.1] Hello mb") .run(); @@ -266,12 +266,12 @@ fn metabuild_fresh() { ) .build(); - p.cargo("build -vv") + p.cargo("check -vv") .masquerade_as_nightly_cargo(&["metabuild"]) .with_stdout_contains("[foo 0.0.1] Hello mb") .run(); - p.cargo("build -vv") + p.cargo("check -vv") .masquerade_as_nightly_cargo(&["metabuild"]) .with_stdout_does_not_contain("[foo 0.0.1] Hello mb") .with_stderr( @@ -315,7 +315,7 @@ fn metabuild_links() { ) .build(); - p.cargo("build -vv") + p.cargo("check -vv") .masquerade_as_nightly_cargo(&["metabuild"]) .with_stdout_contains("[foo 0.0.1] Hello mb") .run(); @@ -356,7 +356,7 @@ fn metabuild_override() { ) .build(); - p.cargo("build -vv") + p.cargo("check -vv") .masquerade_as_nightly_cargo(&["metabuild"]) .run(); } @@ -420,7 +420,7 @@ fn metabuild_workspace() { ) .build(); - p.cargo("build -vv --workspace") + p.cargo("check -vv --workspace") .masquerade_as_nightly_cargo(&["metabuild"]) .with_stdout_contains("[member1 0.0.1] Hello mb1 [..]member1") .with_stdout_contains("[member1 0.0.1] Hello mb2 [..]member1") @@ -621,7 +621,7 @@ fn metabuild_two_versions() { ) .build(); - p.cargo("build -vv --workspace") + p.cargo("check -vv --workspace") .masquerade_as_nightly_cargo(&["metabuild"]) .with_stdout_contains("[member1 0.0.1] Hello mb1 [..]member1") .with_stdout_contains("[member2 0.0.1] Hello mb2 [..]member2") @@ -674,7 +674,7 @@ fn metabuild_external_dependency() { .file("src/lib.rs", "extern crate dep;") .build(); - p.cargo("build -vv") + p.cargo("check -vv") .masquerade_as_nightly_cargo(&["metabuild"]) .with_stdout_contains("[dep 1.0.0] Hello mb") .run(); @@ -685,7 +685,7 @@ fn metabuild_external_dependency() { #[cargo_test] fn metabuild_json_artifact() { let p = basic_project(); - p.cargo("build --message-format=json") + p.cargo("check --message-format=json") .masquerade_as_nightly_cargo(&["metabuild"]) .with_json_contains_unordered( r#" @@ -733,7 +733,7 @@ fn metabuild_failed_build_json() { let p = basic_project(); // Modify the metabuild dep so that it fails to compile. p.change_file("mb/src/lib.rs", ""); - p.cargo("build --message-format=json") + p.cargo("check --message-format=json") .masquerade_as_nightly_cargo(&["metabuild"]) .with_status(101) .with_json_contains_unordered( From cb8dd01a386452ea46ccf39036af0393dc3cd6da Mon Sep 17 00:00:00 2001 From: Scott Schafer Date: Wed, 15 Feb 2023 18:11:55 -0600 Subject: [PATCH 38/62] chore: update `net_config` tests to use check --- tests/testsuite/net_config.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/testsuite/net_config.rs b/tests/testsuite/net_config.rs index 44eb695a727e..569ec552ca74 100644 --- a/tests/testsuite/net_config.rs +++ b/tests/testsuite/net_config.rs @@ -29,7 +29,7 @@ fn net_retry_loads_from_config() { ) .build(); - p.cargo("build -v") + p.cargo("check -v") .with_status(101) .with_stderr_contains( "[WARNING] spurious network error \ @@ -63,7 +63,7 @@ fn net_retry_git_outputs_warning() { .file("src/main.rs", "") .build(); - p.cargo("build -v -j 1") + p.cargo("check -v -j 1") .with_status(101) .with_stderr_contains( "[WARNING] spurious network error \ From 04a32b44ab8e9214b0e24a77c8c68c16d040c871 Mon Sep 17 00:00:00 2001 From: Scott Schafer Date: Wed, 15 Feb 2023 18:14:53 -0600 Subject: [PATCH 39/62] chore: update `offline` tests to use check --- tests/testsuite/offline.rs | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/tests/testsuite/offline.rs b/tests/testsuite/offline.rs index 430a6f5ab05b..cd4bc10d2b5e 100644 --- a/tests/testsuite/offline.rs +++ b/tests/testsuite/offline.rs @@ -24,13 +24,13 @@ fn offline_unused_target_dep() { .file("src/lib.rs", "") .build(); // Do a build that downloads only what is necessary. - p.cargo("build") + p.cargo("check") .with_stderr_contains("[DOWNLOADED] used_dep [..]") .with_stderr_does_not_contain("[DOWNLOADED] unused_dep [..]") .run(); p.cargo("clean").run(); // Build offline, make sure it works. - p.cargo("build --offline").run(); + p.cargo("check --offline").run(); } #[cargo_test] @@ -50,13 +50,13 @@ fn offline_missing_optional() { .file("src/lib.rs", "") .build(); // Do a build that downloads only what is necessary. - p.cargo("build") + p.cargo("check") .with_stderr_does_not_contain("[DOWNLOADED] opt_dep [..]") .run(); p.cargo("clean").run(); // Build offline, make sure it works. - p.cargo("build --offline").run(); - p.cargo("build --offline --features=opt_dep") + p.cargo("check --offline").run(); + p.cargo("check --offline --features=opt_dep") .with_stderr( "\ [ERROR] failed to download `opt_dep v1.0.0` @@ -89,7 +89,7 @@ fn cargo_compile_path_with_offline() { .file("bar/src/lib.rs", "") .build(); - p.cargo("build --offline").run(); + p.cargo("check --offline").run(); } #[cargo_test] @@ -114,7 +114,7 @@ fn cargo_compile_with_downloaded_dependency_with_offline() { ) .file("src/lib.rs", "") .build(); - p.cargo("build").run(); + p.cargo("check").run(); let p2 = project() .at("bar") @@ -132,11 +132,11 @@ fn cargo_compile_with_downloaded_dependency_with_offline() { .file("src/lib.rs", "") .build(); - p2.cargo("build --offline") + p2.cargo("check --offline") .with_stderr( "\ -[COMPILING] present_dep v1.2.3 -[COMPILING] bar v0.1.0 ([..]) +[CHECKING] present_dep v1.2.3 +[CHECKING] bar v0.1.0 ([..]) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..]", ) .run(); @@ -171,14 +171,14 @@ surprising resolution failures, if this error is too confusing you may wish to \ retry without the offline flag. "; - p.cargo("build --offline") + p.cargo("check --offline") .with_status(101) .with_stderr(msg) .run(); // While we're here, also check the config works. p.change_file(".cargo/config", "net.offline = true"); - p.cargo("build").with_status(101).with_stderr(msg).run(); + p.cargo("check").with_status(101).with_stderr(msg).run(); } #[cargo_test] @@ -269,7 +269,7 @@ fn cargo_compile_forbird_git_httpsrepo_offline() { .file("src/main.rs", "") .build(); - p.cargo("build --offline").with_status(101).with_stderr("\ + p.cargo("check --offline").with_status(101).with_stderr("\ [ERROR] failed to get `dep1` as a dependency of package `foo v0.5.0 [..]` Caused by: @@ -310,7 +310,7 @@ fn compile_offline_while_transitive_dep_not_cached() { .build(); // simulate download bar, but fail to download baz - p.cargo("build") + p.cargo("check") .with_status(101) .with_stderr_contains("[..]failed to verify the checksum of `baz[..]") .run(); @@ -318,7 +318,7 @@ fn compile_offline_while_transitive_dep_not_cached() { // Restore the file contents. fs::write(&baz_path, &baz_content).unwrap(); - p.cargo("build --offline") + p.cargo("check --offline") .with_status(101) .with_stderr( "\ @@ -530,7 +530,7 @@ fn offline_resolve_optional_fail() { "#, ); - p.cargo("build --offline") + p.cargo("check --offline") .with_status(101) .with_stderr( "\ @@ -691,7 +691,7 @@ retry without the offline flag. #[cargo_test] fn offline_and_frozen_and_no_lock() { let p = project().file("src/lib.rs", "").build(); - p.cargo("build --frozen --offline") + p.cargo("check --frozen --offline") .with_status(101) .with_stderr("\ error: the lock file [ROOT]/foo/Cargo.lock needs to be updated but --frozen was passed to prevent this @@ -704,7 +704,7 @@ remove the --frozen flag and use --offline instead. #[cargo_test] fn offline_and_locked_and_no_frozen() { let p = project().file("src/lib.rs", "").build(); - p.cargo("build --locked --offline") + p.cargo("check --locked --offline") .with_status(101) .with_stderr("\ error: the lock file [ROOT]/foo/Cargo.lock needs to be updated but --locked was passed to prevent this From d8b97f0f8419c69876f8b2f8058d24cc9cffcfec Mon Sep 17 00:00:00 2001 From: Scott Schafer Date: Wed, 15 Feb 2023 18:18:17 -0600 Subject: [PATCH 40/62] chore: update `package` tests to use check --- tests/testsuite/package.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/testsuite/package.rs b/tests/testsuite/package.rs index d2e4c9ab72e2..14bac6618bdd 100644 --- a/tests/testsuite/package.rs +++ b/tests/testsuite/package.rs @@ -1301,10 +1301,10 @@ fn test_edition() { .file("src/lib.rs", r#" "#) .build(); - p.cargo("build -v") + p.cargo("check -v") .with_stderr_contains( "\ -[COMPILING] foo v0.0.1 ([..]) +[CHECKING] foo v0.0.1 ([..]) [RUNNING] `rustc [..]--edition=2018 [..] ", ) @@ -1349,7 +1349,7 @@ fn test_edition_malformed() { .file("src/lib.rs", r#" "#) .build(); - p.cargo("build -v") + p.cargo("check -v") .with_status(101) .with_stderr( "\ @@ -1381,7 +1381,7 @@ fn test_edition_from_the_future() { .file("src/main.rs", r#""#) .build(); - p.cargo("build") + p.cargo("check") .with_status(101) .with_stderr( "\ From d0d589780d7d9fa9de2ac90c081fefa5e6b69961 Mon Sep 17 00:00:00 2001 From: Scott Schafer Date: Wed, 15 Feb 2023 18:19:11 -0600 Subject: [PATCH 41/62] chore: update `package_features` tests to use check --- tests/testsuite/package_features.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/testsuite/package_features.rs b/tests/testsuite/package_features.rs index 6cba65248049..15f726be5bc2 100644 --- a/tests/testsuite/package_features.rs +++ b/tests/testsuite/package_features.rs @@ -466,28 +466,28 @@ fn non_member() { .file("src/lib.rs", "") .build(); - p.cargo("build -p dep --features f1") + p.cargo("check -p dep --features f1") .with_status(101) .with_stderr("[ERROR] cannot specify features for packages outside of workspace") .run(); - p.cargo("build -p dep --all-features") + p.cargo("check -p dep --all-features") .with_status(101) .with_stderr("[ERROR] cannot specify features for packages outside of workspace") .run(); - p.cargo("build -p dep --no-default-features") + p.cargo("check -p dep --no-default-features") .with_status(101) .with_stderr("[ERROR] cannot specify features for packages outside of workspace") .run(); - p.cargo("build -p dep") + p.cargo("check -p dep") .with_stderr( "\ [UPDATING] [..] [DOWNLOADING] [..] [DOWNLOADED] [..] -[COMPILING] dep [..] +[CHECKING] dep [..] [FINISHED] [..] ", ) From 49add5c6afffa105e695ee790f9c4ccdf80832ea Mon Sep 17 00:00:00 2001 From: Scott Schafer Date: Wed, 15 Feb 2023 18:25:37 -0600 Subject: [PATCH 42/62] chore: update `patch` tests to use check --- tests/testsuite/patch.rs | 260 +++++++++++++++++++-------------------- 1 file changed, 130 insertions(+), 130 deletions(-) diff --git a/tests/testsuite/patch.rs b/tests/testsuite/patch.rs index e3a9d2e39337..dd8b84a9b130 100644 --- a/tests/testsuite/patch.rs +++ b/tests/testsuite/patch.rs @@ -49,21 +49,21 @@ fn replace() { .file("bar/src/lib.rs", "pub fn bar() {}") .build(); - p.cargo("build") + p.cargo("check") .with_stderr( "\ [UPDATING] `dummy-registry` index [DOWNLOADING] crates ... [DOWNLOADED] baz v0.1.0 ([..]) -[COMPILING] bar v0.1.0 ([CWD]/bar) -[COMPILING] baz v0.1.0 -[COMPILING] foo v0.0.1 ([CWD]) +[CHECKING] bar v0.1.0 ([CWD]/bar) +[CHECKING] baz v0.1.0 +[CHECKING] foo v0.0.1 ([CWD]) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", ) .run(); - p.cargo("build").with_stderr("[FINISHED] [..]").run(); + p.cargo("check").with_stderr("[FINISHED] [..]").run(); } #[cargo_test] @@ -95,12 +95,12 @@ fn from_config() { .file("bar/src/lib.rs", r#""#) .build(); - p.cargo("build") + p.cargo("check") .with_stderr( "\ [UPDATING] `dummy-registry` index -[COMPILING] bar v0.1.1 ([..]) -[COMPILING] foo v0.0.1 ([CWD]) +[CHECKING] bar v0.1.1 ([..]) +[CHECKING] foo v0.0.1 ([CWD]) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", ) @@ -136,12 +136,12 @@ fn from_config_relative() { .file("bar/src/lib.rs", r#""#) .build(); - p.cargo("build") + p.cargo("check") .with_stderr( "\ [UPDATING] `dummy-registry` index -[COMPILING] bar v0.1.1 ([..]) -[COMPILING] foo v0.0.1 ([CWD]) +[CHECKING] bar v0.1.1 ([..]) +[CHECKING] foo v0.0.1 ([CWD]) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", ) @@ -180,12 +180,12 @@ fn from_config_precedence() { .file("bar/src/lib.rs", r#""#) .build(); - p.cargo("build") + p.cargo("check") .with_stderr( "\ [UPDATING] `dummy-registry` index -[COMPILING] bar v0.1.1 ([..]) -[COMPILING] foo v0.0.1 ([CWD]) +[CHECKING] bar v0.1.1 ([..]) +[CHECKING] foo v0.0.1 ([CWD]) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", ) @@ -220,17 +220,17 @@ fn nonexistent() { .file("bar/src/lib.rs", "pub fn bar() {}") .build(); - p.cargo("build") + p.cargo("check") .with_stderr( "\ [UPDATING] `dummy-registry` index -[COMPILING] bar v0.1.0 ([CWD]/bar) -[COMPILING] foo v0.0.1 ([CWD]) +[CHECKING] bar v0.1.0 ([CWD]/bar) +[CHECKING] foo v0.0.1 ([CWD]) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", ) .run(); - p.cargo("build").with_stderr("[FINISHED] [..]").run(); + p.cargo("check").with_stderr("[FINISHED] [..]").run(); } #[cargo_test] @@ -267,17 +267,17 @@ fn patch_git() { .file("bar/src/lib.rs", "pub fn bar() {}") .build(); - p.cargo("build") + p.cargo("check") .with_stderr( "\ [UPDATING] git repository `file://[..]` -[COMPILING] bar v0.1.0 ([CWD]/bar) -[COMPILING] foo v0.0.1 ([CWD]) +[CHECKING] bar v0.1.0 ([CWD]/bar) +[CHECKING] foo v0.0.1 ([CWD]) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", ) .run(); - p.cargo("build").with_stderr("[FINISHED] [..]").run(); + p.cargo("check").with_stderr("[FINISHED] [..]").run(); } #[cargo_test] @@ -314,18 +314,18 @@ fn patch_to_git() { ) .build(); - p.cargo("build") + p.cargo("check") .with_stderr( "\ [UPDATING] git repository `file://[..]` [UPDATING] `dummy-registry` index -[COMPILING] bar v0.1.0 (file://[..]) -[COMPILING] foo v0.0.1 ([CWD]) +[CHECKING] bar v0.1.0 (file://[..]) +[CHECKING] foo v0.0.1 ([CWD]) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", ) .run(); - p.cargo("build").with_stderr("[FINISHED] [..]").run(); + p.cargo("check").with_stderr("[FINISHED] [..]").run(); } #[cargo_test] @@ -353,7 +353,7 @@ fn unused() { .file("bar/src/lib.rs", "not rust code") .build(); - p.cargo("build") + p.cargo("check") .with_stderr( "\ [UPDATING] `dummy-registry` index @@ -364,13 +364,13 @@ what is [..] version. [..] [DOWNLOADING] crates ... [DOWNLOADED] bar v0.1.0 [..] -[COMPILING] bar v0.1.0 -[COMPILING] foo v0.0.1 ([CWD]) +[CHECKING] bar v0.1.0 +[CHECKING] foo v0.0.1 ([CWD]) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", ) .run(); - p.cargo("build") + p.cargo("check") .with_stderr( "\ [WARNING] Patch `bar v0.2.0 ([CWD]/bar)` was not used in the crate graph. @@ -425,7 +425,7 @@ fn unused_with_mismatch_source_being_patched() { .file("baz/src/lib.rs", "not rust code") .build(); - p.cargo("build") + p.cargo("check") .with_stderr( "\ [UPDATING] `dummy-registry` index @@ -440,8 +440,8 @@ what is [..] version. [..] [DOWNLOADING] crates ... [DOWNLOADED] bar v0.1.0 [..] -[COMPILING] bar v0.1.0 -[COMPILING] foo v0.0.1 ([CWD]) +[CHECKING] bar v0.1.0 +[CHECKING] foo v0.0.1 ([CWD]) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", ) @@ -473,17 +473,17 @@ fn prefer_patch_version() { .file("bar/src/lib.rs", "") .build(); - p.cargo("build") + p.cargo("check") .with_stderr( "\ [UPDATING] `dummy-registry` index -[COMPILING] bar v0.1.1 ([CWD]/bar) -[COMPILING] foo v0.0.1 ([CWD]) +[CHECKING] bar v0.1.1 ([CWD]/bar) +[CHECKING] foo v0.0.1 ([CWD]) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", ) .run(); - p.cargo("build") + p.cargo("check") .with_stderr( "\ [FINISHED] [..] @@ -526,7 +526,7 @@ fn unused_from_config() { .file("bar/src/lib.rs", "not rust code") .build(); - p.cargo("build") + p.cargo("check") .with_stderr( "\ [UPDATING] `dummy-registry` index @@ -537,13 +537,13 @@ what is [..] version. [..] [DOWNLOADING] crates ... [DOWNLOADED] bar v0.1.0 [..] -[COMPILING] bar v0.1.0 -[COMPILING] foo v0.0.1 ([CWD]) +[CHECKING] bar v0.1.0 +[CHECKING] foo v0.0.1 ([CWD]) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", ) .run(); - p.cargo("build") + p.cargo("check") .with_stderr( "\ [WARNING] Patch `bar v0.2.0 ([CWD]/bar)` was not used in the crate graph. @@ -598,7 +598,7 @@ fn unused_git() { .file("src/lib.rs", "") .build(); - p.cargo("build") + p.cargo("check") .with_stderr( "\ [UPDATING] git repository `file://[..]` @@ -610,13 +610,13 @@ what is [..] version. [..] [DOWNLOADING] crates ... [DOWNLOADED] bar v0.1.0 [..] -[COMPILING] bar v0.1.0 -[COMPILING] foo v0.0.1 ([CWD]) +[CHECKING] bar v0.1.0 +[CHECKING] foo v0.0.1 ([CWD]) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", ) .run(); - p.cargo("build") + p.cargo("check") .with_stderr( "\ [WARNING] Patch `bar v0.2.0 ([..])` was not used in the crate graph. @@ -652,19 +652,19 @@ fn add_patch() { .file("bar/src/lib.rs", r#""#) .build(); - p.cargo("build") + p.cargo("check") .with_stderr( "\ [UPDATING] `dummy-registry` index [DOWNLOADING] crates ... [DOWNLOADED] bar v0.1.0 [..] -[COMPILING] bar v0.1.0 -[COMPILING] foo v0.0.1 ([CWD]) +[CHECKING] bar v0.1.0 +[CHECKING] foo v0.0.1 ([CWD]) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", ) .run(); - p.cargo("build").with_stderr("[FINISHED] [..]").run(); + p.cargo("check").with_stderr("[FINISHED] [..]").run(); p.change_file( "Cargo.toml", @@ -682,16 +682,16 @@ fn add_patch() { "#, ); - p.cargo("build") + p.cargo("check") .with_stderr( "\ -[COMPILING] bar v0.1.0 ([CWD]/bar) -[COMPILING] foo v0.0.1 ([CWD]) +[CHECKING] bar v0.1.0 ([CWD]/bar) +[CHECKING] foo v0.0.1 ([CWD]) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", ) .run(); - p.cargo("build").with_stderr("[FINISHED] [..]").run(); + p.cargo("check").with_stderr("[FINISHED] [..]").run(); } #[cargo_test] @@ -716,19 +716,19 @@ fn add_patch_from_config() { .file("bar/src/lib.rs", r#""#) .build(); - p.cargo("build") + p.cargo("check") .with_stderr( "\ [UPDATING] `dummy-registry` index [DOWNLOADING] crates ... [DOWNLOADED] bar v0.1.0 [..] -[COMPILING] bar v0.1.0 -[COMPILING] foo v0.0.1 ([CWD]) +[CHECKING] bar v0.1.0 +[CHECKING] foo v0.0.1 ([CWD]) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", ) .run(); - p.cargo("build").with_stderr("[FINISHED] [..]").run(); + p.cargo("check").with_stderr("[FINISHED] [..]").run(); p.change_file( ".cargo/config.toml", @@ -738,16 +738,16 @@ fn add_patch_from_config() { "#, ); - p.cargo("build") + p.cargo("check") .with_stderr( "\ -[COMPILING] bar v0.1.0 ([CWD]/bar) -[COMPILING] foo v0.0.1 ([CWD]) +[CHECKING] bar v0.1.0 ([CWD]/bar) +[CHECKING] foo v0.0.1 ([CWD]) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", ) .run(); - p.cargo("build").with_stderr("[FINISHED] [..]").run(); + p.cargo("check").with_stderr("[FINISHED] [..]").run(); } #[cargo_test] @@ -772,19 +772,19 @@ fn add_ignored_patch() { .file("bar/src/lib.rs", r#""#) .build(); - p.cargo("build") + p.cargo("check") .with_stderr( "\ [UPDATING] `dummy-registry` index [DOWNLOADING] crates ... [DOWNLOADED] bar v0.1.0 [..] -[COMPILING] bar v0.1.0 -[COMPILING] foo v0.0.1 ([CWD]) +[CHECKING] bar v0.1.0 +[CHECKING] foo v0.0.1 ([CWD]) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", ) .run(); - p.cargo("build").with_stderr("[FINISHED] [..]").run(); + p.cargo("check").with_stderr("[FINISHED] [..]").run(); p.change_file( "Cargo.toml", @@ -802,7 +802,7 @@ fn add_ignored_patch() { "#, ); - p.cargo("build") + p.cargo("check") .with_stderr( "\ [WARNING] Patch `bar v0.1.1 ([CWD]/bar)` was not used in the crate graph. @@ -813,7 +813,7 @@ version. [..] [FINISHED] dev [unoptimized + debuginfo] target(s) in [..]", ) .run(); - p.cargo("build") + p.cargo("check") .with_stderr( "\ [WARNING] Patch `bar v0.1.1 ([CWD]/bar)` was not used in the crate graph. @@ -826,11 +826,11 @@ version. [..] .run(); p.cargo("update").run(); - p.cargo("build") + p.cargo("check") .with_stderr( "\ -[COMPILING] bar v0.1.1 ([CWD]/bar) -[COMPILING] foo v0.0.1 ([CWD]) +[CHECKING] bar v0.1.1 ([CWD]/bar) +[CHECKING] foo v0.0.1 ([CWD]) [FINISHED] dev [..] ", ) @@ -862,19 +862,19 @@ fn add_patch_with_features() { .file("bar/src/lib.rs", r#""#) .build(); - p.cargo("build") + p.cargo("check") .with_stderr( "\ [WARNING] patch for `bar` uses the features mechanism. \ default-features and features will not take effect because the patch dependency does not support this mechanism [UPDATING] `dummy-registry` index -[COMPILING] bar v0.1.0 ([CWD]/bar) -[COMPILING] foo v0.0.1 ([CWD]) +[CHECKING] bar v0.1.0 ([CWD]/bar) +[CHECKING] foo v0.0.1 ([CWD]) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", ) .run(); - p.cargo("build") + p.cargo("check") .with_stderr( "\ [WARNING] patch for `bar` uses the features mechanism. \ @@ -910,19 +910,19 @@ fn add_patch_with_setting_default_features() { .file("bar/src/lib.rs", r#""#) .build(); - p.cargo("build") + p.cargo("check") .with_stderr( "\ [WARNING] patch for `bar` uses the features mechanism. \ default-features and features will not take effect because the patch dependency does not support this mechanism [UPDATING] `dummy-registry` index -[COMPILING] bar v0.1.0 ([CWD]/bar) -[COMPILING] foo v0.0.1 ([CWD]) +[CHECKING] bar v0.1.0 ([CWD]/bar) +[CHECKING] foo v0.0.1 ([CWD]) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", ) .run(); - p.cargo("build") + p.cargo("check") .with_stderr( "\ [WARNING] patch for `bar` uses the features mechanism. \ @@ -967,11 +967,11 @@ fn no_warn_ws_patch() { .file("c/src/lib.rs", "") .build(); - p.cargo("build -p a") + p.cargo("check -p a") .with_stderr( "\ [UPDATING] [..] -[COMPILING] a [..] +[CHECKING] a [..] [FINISHED] [..]", ) .run(); @@ -1002,12 +1002,12 @@ fn new_minor() { .file("bar/src/lib.rs", r#""#) .build(); - p.cargo("build") + p.cargo("check") .with_stderr( "\ [UPDATING] `dummy-registry` index -[COMPILING] bar v0.1.1 [..] -[COMPILING] foo v0.0.1 ([CWD]) +[CHECKING] bar v0.1.1 [..] +[CHECKING] foo v0.0.1 ([CWD]) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", ) @@ -1052,13 +1052,13 @@ fn transitive_new_minor() { .file("baz/src/lib.rs", r#""#) .build(); - p.cargo("build") + p.cargo("check") .with_stderr( "\ [UPDATING] `dummy-registry` index -[COMPILING] baz v0.1.1 [..] -[COMPILING] bar v0.1.0 [..] -[COMPILING] foo v0.0.1 ([CWD]) +[CHECKING] baz v0.1.1 [..] +[CHECKING] bar v0.1.0 [..] +[CHECKING] foo v0.0.1 ([CWD]) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", ) @@ -1090,12 +1090,12 @@ fn new_major() { .file("bar/src/lib.rs", r#""#) .build(); - p.cargo("build") + p.cargo("check") .with_stderr( "\ [UPDATING] `dummy-registry` index -[COMPILING] bar v0.2.0 [..] -[COMPILING] foo v0.0.1 ([CWD]) +[CHECKING] bar v0.2.0 [..] +[CHECKING] foo v0.0.1 ([CWD]) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", ) @@ -1103,7 +1103,7 @@ fn new_major() { Package::new("bar", "0.2.0").publish(); p.cargo("update").run(); - p.cargo("build") + p.cargo("check") .with_stderr("[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]") .run(); @@ -1119,14 +1119,14 @@ fn new_major() { bar = "0.2.0" "#, ); - p.cargo("build") + p.cargo("check") .with_stderr( "\ [UPDATING] `dummy-registry` index [DOWNLOADING] crates ... [DOWNLOADED] bar v0.2.0 [..] -[COMPILING] bar v0.2.0 -[COMPILING] foo v0.0.1 ([CWD]) +[CHECKING] bar v0.2.0 +[CHECKING] foo v0.0.1 ([CWD]) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", ) @@ -1171,13 +1171,13 @@ fn transitive_new_major() { .file("baz/src/lib.rs", r#""#) .build(); - p.cargo("build") + p.cargo("check") .with_stderr( "\ [UPDATING] `dummy-registry` index -[COMPILING] baz v0.2.0 [..] -[COMPILING] bar v0.1.0 [..] -[COMPILING] foo v0.0.1 ([CWD]) +[CHECKING] baz v0.2.0 [..] +[CHECKING] bar v0.1.0 [..] +[CHECKING] foo v0.0.1 ([CWD]) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", ) @@ -1227,14 +1227,14 @@ fn shared_by_transitive() { .file("bar/src/lib.rs", "") .build(); - p.cargo("build") + p.cargo("check") .with_stderr( "\ [UPDATING] git repository `file://[..]` [UPDATING] `dummy-registry` index -[COMPILING] baz v0.1.2 [..] -[COMPILING] bar v0.1.0 [..] -[COMPILING] foo v0.1.0 ([CWD]) +[CHECKING] baz v0.1.2 [..] +[CHECKING] bar v0.1.0 [..] +[CHECKING] foo v0.1.0 ([CWD]) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", ) @@ -1271,7 +1271,7 @@ fn remove_patch() { .build(); // Generate a lock file where `foo` is unused - p.cargo("build").run(); + p.cargo("check").run(); let lock_file1 = p.read_lockfile(); // Remove `foo` and generate a new lock file form the old one @@ -1290,12 +1290,12 @@ fn remove_patch() { bar = { path = 'bar' } "#, ); - p.cargo("build").run(); + p.cargo("check").run(); let lock_file2 = p.read_lockfile(); // Remove the lock file and build from scratch fs::remove_file(p.root().join("Cargo.lock")).unwrap(); - p.cargo("build").run(); + p.cargo("check").run(); let lock_file3 = p.read_lockfile(); assert!(lock_file1.contains("foo")); @@ -1325,7 +1325,7 @@ fn non_crates_io() { .file("bar/src/lib.rs", r#""#) .build(); - p.cargo("build") + p.cargo("check") .with_status(101) .with_stderr( "\ @@ -1363,7 +1363,7 @@ fn replace_with_crates_io() { .file("bar/src/lib.rs", r#""#) .build(); - p.cargo("build") + p.cargo("check") .with_status(101) .with_stderr( "\ @@ -1410,8 +1410,8 @@ fn patch_in_virtual() { .file("foo/src/lib.rs", r#""#) .build(); - p.cargo("build").run(); - p.cargo("build").with_stderr("[FINISHED] [..]").run(); + p.cargo("check").run(); + p.cargo("check").with_stderr("[FINISHED] [..]").run(); } #[cargo_test] @@ -1461,10 +1461,10 @@ fn patch_depends_on_another_patch() { .file("baz/src/lib.rs", r#""#) .build(); - p.cargo("build").run(); + p.cargo("check").run(); // Nothing should be rebuilt, no registry should be updated. - p.cargo("build").with_stderr("[FINISHED] [..]").run(); + p.cargo("check").with_stderr("[FINISHED] [..]").run(); } #[cargo_test] @@ -1510,7 +1510,7 @@ fn replace_prerelease() { .file("baz/src/lib.rs", "pub fn baz() {}") .build(); - p.cargo("build").run(); + p.cargo("check").run(); } #[cargo_test] @@ -1559,13 +1559,13 @@ fn patch_older() { .file("baz/src/lib.rs", "") .build(); - p.cargo("build") + p.cargo("check") .with_stderr( "\ [UPDATING] [..] -[COMPILING] baz v1.0.1 [..] -[COMPILING] bar v0.5.0 [..] -[COMPILING] foo v0.1.0 [..] +[CHECKING] baz v1.0.1 [..] +[CHECKING] bar v0.5.0 [..] +[CHECKING] foo v0.1.0 [..] [FINISHED] [..] ", ) @@ -1670,7 +1670,7 @@ fn multipatch() { .file("a2/src/lib.rs", "pub fn f2() {}") .build(); - p.cargo("build").run(); + p.cargo("check").run(); } #[cargo_test] @@ -1711,7 +1711,7 @@ fn patch_same_version() { .file("bar/src/lib.rs", "") .build(); - p.cargo("build") + p.cargo("check") .with_status(101) .with_stderr( "\ @@ -1763,8 +1763,8 @@ fn two_semver_compatible() { // assert the build succeeds and doesn't panic anywhere, and then afterwards // assert that the build succeeds again without updating anything or // building anything else. - p.cargo("build").run(); - p.cargo("build") + p.cargo("check").run(); + p.cargo("check") .with_stderr( "\ warning: Patch `bar v0.1.1 [..]` was not used in the crate graph. @@ -1817,8 +1817,8 @@ fn multipatch_select_big() { // assert the build succeeds, which is only possible if 0.2.0 is selected // since 0.1.0 is missing the function we need. Afterwards assert that the // build succeeds again without updating anything or building anything else. - p.cargo("build").run(); - p.cargo("build") + p.cargo("check").run(); + p.cargo("check") .with_stderr( "\ warning: Patch `bar v0.1.0 [..]` was not used in the crate graph. @@ -1887,12 +1887,12 @@ fn canonicalize_a_bunch() { .build(); // Once to make sure it actually works - p.cargo("build").run(); + p.cargo("check").run(); // Then a few more times for good measure to ensure no weird warnings about // `[patch]` are printed. - p.cargo("build").with_stderr("[FINISHED] [..]").run(); - p.cargo("build").with_stderr("[FINISHED] [..]").run(); + p.cargo("check").with_stderr("[FINISHED] [..]").run(); + p.cargo("check").with_stderr("[FINISHED] [..]").run(); } #[cargo_test] @@ -1928,7 +1928,7 @@ fn update_unused_new_version() { .file("src/lib.rs", "") .build(); - p.cargo("build") + p.cargo("check") .with_stderr_contains("[WARNING] Patch `bar v0.1.4 [..] was not used in the crate graph.") .run(); // unused patch should be in the lock file @@ -1948,18 +1948,18 @@ fn update_unused_new_version() { fs::copy(p.root().join("Cargo.lock"), p.root().join("Cargo.lock.bak")).unwrap(); // Try to build again, this should automatically update Cargo.lock. - p.cargo("build") + p.cargo("check") .with_stderr( "\ [UPDATING] `dummy-registry` index -[COMPILING] bar v0.1.6 ([..]/bar) -[COMPILING] foo v0.0.1 ([..]/foo) +[CHECKING] bar v0.1.6 ([..]/bar) +[CHECKING] foo v0.0.1 ([..]/foo) [FINISHED] [..] ", ) .run(); // This should not update any registry. - p.cargo("build").with_stderr("[FINISHED] [..]").run(); + p.cargo("check").with_stderr("[FINISHED] [..]").run(); assert!(!p.read_lockfile().contains("unused")); // Restore the lock file, and see if `update` will work, too. From fddf335be4e24d3843be06c20b58c7c26d2b3fac Mon Sep 17 00:00:00 2001 From: Scott Schafer Date: Wed, 15 Feb 2023 18:31:25 -0600 Subject: [PATCH 43/62] chore: update `path` tests to use check --- tests/testsuite/path.rs | 78 ++++++++++++++++++++--------------------- 1 file changed, 39 insertions(+), 39 deletions(-) diff --git a/tests/testsuite/path.rs b/tests/testsuite/path.rs index 4eb61c661331..ebbb72f9a4a9 100644 --- a/tests/testsuite/path.rs +++ b/tests/testsuite/path.rs @@ -139,7 +139,7 @@ fn cargo_compile_with_root_dev_deps() { ) .build(); - p.cargo("build") + p.cargo("check") .with_status(101) .with_stderr_contains("[..]can't find crate for `bar`") .run(); @@ -275,10 +275,10 @@ fn no_rebuild_dependency() { .file("bar/src/bar.rs", "pub fn bar() {}") .build(); // First time around we should compile both foo and bar - p.cargo("build") + p.cargo("check") .with_stderr( - "[COMPILING] bar v0.5.0 ([CWD]/bar)\n\ - [COMPILING] foo v0.5.0 ([CWD])\n\ + "[CHECKING] bar v0.5.0 ([CWD]/bar)\n\ + [CHECKING] foo v0.5.0 ([CWD])\n\ [FINISHED] dev [unoptimized + debuginfo] target(s) \ in [..]\n", ) @@ -293,9 +293,9 @@ fn no_rebuild_dependency() { "#, ); // Don't compile bar, but do recompile foo. - p.cargo("build") + p.cargo("check") .with_stderr( - "[COMPILING] foo v0.5.0 ([..])\n\ + "[CHECKING] foo v0.5.0 ([..])\n\ [FINISHED] dev [unoptimized + debuginfo] target(s) \ in [..]\n", ) @@ -341,16 +341,16 @@ fn deep_dependencies_trigger_rebuild() { .file("baz/Cargo.toml", &basic_lib_manifest("baz")) .file("baz/src/baz.rs", "pub fn baz() {}") .build(); - p.cargo("build") + p.cargo("check") .with_stderr( - "[COMPILING] baz v0.5.0 ([CWD]/baz)\n\ - [COMPILING] bar v0.5.0 ([CWD]/bar)\n\ - [COMPILING] foo v0.5.0 ([CWD])\n\ + "[CHECKING] baz v0.5.0 ([CWD]/baz)\n\ + [CHECKING] bar v0.5.0 ([CWD]/bar)\n\ + [CHECKING] foo v0.5.0 ([CWD])\n\ [FINISHED] dev [unoptimized + debuginfo] target(s) \ in [..]\n", ) .run(); - p.cargo("build").with_stdout("").run(); + p.cargo("check").with_stdout("").run(); // Make sure an update to baz triggers a rebuild of bar // @@ -359,11 +359,11 @@ fn deep_dependencies_trigger_rebuild() { sleep_ms(1000); p.change_file("baz/src/baz.rs", r#"pub fn baz() { println!("hello!"); }"#); sleep_ms(1000); - p.cargo("build") + p.cargo("check") .with_stderr( - "[COMPILING] baz v0.5.0 ([CWD]/baz)\n\ - [COMPILING] bar v0.5.0 ([CWD]/bar)\n\ - [COMPILING] foo v0.5.0 ([CWD])\n\ + "[CHECKING] baz v0.5.0 ([CWD]/baz)\n\ + [CHECKING] bar v0.5.0 ([CWD]/bar)\n\ + [CHECKING] foo v0.5.0 ([CWD])\n\ [FINISHED] dev [unoptimized + debuginfo] target(s) \ in [..]\n", ) @@ -379,10 +379,10 @@ fn deep_dependencies_trigger_rebuild() { "#, ); sleep_ms(1000); - p.cargo("build") + p.cargo("check") .with_stderr( - "[COMPILING] bar v0.5.0 ([CWD]/bar)\n\ - [COMPILING] foo v0.5.0 ([CWD])\n\ + "[CHECKING] bar v0.5.0 ([CWD]/bar)\n\ + [CHECKING] foo v0.5.0 ([CWD])\n\ [FINISHED] dev [unoptimized + debuginfo] target(s) \ in [..]\n", ) @@ -464,10 +464,10 @@ fn nested_deps_recompile() { .file("src/bar/src/bar.rs", "pub fn gimme() -> i32 { 92 }") .build(); - p.cargo("build") + p.cargo("check") .with_stderr( - "[COMPILING] bar v0.5.0 ([CWD]/src/bar)\n\ - [COMPILING] foo v0.5.0 ([CWD])\n\ + "[CHECKING] bar v0.5.0 ([CWD]/src/bar)\n\ + [CHECKING] foo v0.5.0 ([CWD])\n\ [FINISHED] dev [unoptimized + debuginfo] target(s) \ in [..]\n", ) @@ -477,9 +477,9 @@ fn nested_deps_recompile() { p.change_file("src/main.rs", r#"fn main() {}"#); // This shouldn't recompile `bar` - p.cargo("build") + p.cargo("check") .with_stderr( - "[COMPILING] foo v0.5.0 ([CWD])\n\ + "[CHECKING] foo v0.5.0 ([CWD])\n\ [FINISHED] dev [unoptimized + debuginfo] target(s) \ in [..]\n", ) @@ -507,7 +507,7 @@ fn error_message_for_missing_manifest() { .file("src/bar/not-a-manifest", "") .build(); - p.cargo("build") + p.cargo("check") .with_status(101) .with_stderr( "\ @@ -559,7 +559,7 @@ fn override_relative() { ) .file("src/lib.rs", "") .build(); - p.cargo("build -v").run(); + p.cargo("check -v").run(); } #[cargo_test] @@ -595,7 +595,7 @@ fn override_self() { .file("src/main.rs", "fn main() {}") .build(); - p.cargo("build").run(); + p.cargo("check").run(); } #[cargo_test] @@ -648,7 +648,7 @@ fn override_path_dep() { .file("src/lib.rs", "") .build(); - p.cargo("build -v").run(); + p.cargo("check -v").run(); } #[cargo_test] @@ -808,11 +808,11 @@ fn custom_target_no_rebuild() { ) .file("b/src/lib.rs", "") .build(); - p.cargo("build") + p.cargo("check") .with_stderr( "\ -[COMPILING] a v0.5.0 ([..]) -[COMPILING] foo v0.5.0 ([..]) +[CHECKING] a v0.5.0 ([..]) +[CHECKING] foo v0.5.0 ([..]) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", ) @@ -822,11 +822,11 @@ fn custom_target_no_rebuild() { p.root().join("target"), p.root().join("target_moved") )); - p.cargo("build --manifest-path=b/Cargo.toml") + p.cargo("check --manifest-path=b/Cargo.toml") .env("CARGO_TARGET_DIR", "target_moved") .with_stderr( "\ -[COMPILING] b v0.5.0 ([..]) +[CHECKING] b v0.5.0 ([..]) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", ) @@ -866,14 +866,14 @@ fn override_and_depend() { .file("b/src/lib.rs", "") .file("b/.cargo/config", r#"paths = ["../a"]"#) .build(); - p.cargo("build") + p.cargo("check") .cwd("b") .with_stderr( "\ [WARNING] skipping duplicate package `a2` found at `[..]` -[COMPILING] a2 v0.5.0 ([..]) -[COMPILING] a1 v0.5.0 ([..]) -[COMPILING] b v0.5.0 ([..]) +[CHECKING] a2 v0.5.0 ([..]) +[CHECKING] a1 v0.5.0 ([..]) +[CHECKING] b v0.5.0 ([..]) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", ) @@ -890,7 +890,7 @@ fn missing_path_dependency() { r#"paths = ["../whoa-this-does-not-exist"]"#, ) .build(); - p.cargo("build") + p.cargo("check") .with_status(101) .with_stderr( "\ @@ -943,7 +943,7 @@ fn invalid_path_dep_in_workspace_with_lockfile() { .build(); // Generate a lock file - p.cargo("build").run(); + p.cargo("check").run(); // Change the dependency on `bar` to an invalid path p.change_file( @@ -961,7 +961,7 @@ fn invalid_path_dep_in_workspace_with_lockfile() { // Make sure we get a nice error. In the past this actually stack // overflowed! - p.cargo("build") + p.cargo("check") .with_status(101) .with_stderr( "\ From 5f118c9e7ff405be28ceaa6072fbb0433b43cba3 Mon Sep 17 00:00:00 2001 From: Scott Schafer Date: Wed, 15 Feb 2023 20:25:01 -0600 Subject: [PATCH 44/62] chore: update `paths` tests to use check --- tests/testsuite/paths.rs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/tests/testsuite/paths.rs b/tests/testsuite/paths.rs index c5b775865458..31e00ae11f0d 100644 --- a/tests/testsuite/paths.rs +++ b/tests/testsuite/paths.rs @@ -51,7 +51,7 @@ fn broken_path_override_warns() { .file(".cargo/config", r#"paths = ["a2"]"#) .build(); - p.cargo("build") + p.cargo("check") .with_stderr( "\ [UPDATING] [..] @@ -72,9 +72,9 @@ https://doc.rust-lang.org/cargo/reference/overriding-dependencies.html [DOWNLOADING] crates ... [DOWNLOADED] [..] -[COMPILING] [..] -[COMPILING] [..] -[COMPILING] [..] +[CHECKING] [..] +[CHECKING] [..] +[CHECKING] [..] [FINISHED] [..] ", ) @@ -118,7 +118,7 @@ fn override_to_path_dep() { .file(".cargo/config", r#"paths = ["bar"]"#) .build(); - p.cargo("build").run(); + p.cargo("check").run(); } #[cargo_test] @@ -168,11 +168,11 @@ fn paths_ok_with_optional() { .file(".cargo/config", r#"paths = ["bar2"]"#) .build(); - p.cargo("build") + p.cargo("check") .with_stderr( "\ -[COMPILING] bar v0.1.0 ([..]bar2) -[COMPILING] foo v0.0.1 ([..]) +[CHECKING] bar v0.1.0 ([..]bar2) +[CHECKING] foo v0.0.1 ([..]) [FINISHED] [..] ", ) @@ -215,7 +215,7 @@ fn paths_add_optional_bad() { .file(".cargo/config", r#"paths = ["bar2"]"#) .build(); - p.cargo("build") + p.cargo("check") .with_stderr_contains( "\ warning: path override for crate `bar` has altered the original list of From 22f2155d2e1f1285a657e7747db8a9d2653923d5 Mon Sep 17 00:00:00 2001 From: Scott Schafer Date: Wed, 15 Feb 2023 20:26:29 -0600 Subject: [PATCH 45/62] chore: update `plugins` tests to use check --- tests/testsuite/plugins.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/testsuite/plugins.rs b/tests/testsuite/plugins.rs index 331ba32e00dd..1998d17af431 100644 --- a/tests/testsuite/plugins.rs +++ b/tests/testsuite/plugins.rs @@ -94,7 +94,7 @@ fn plugin_to_the_max() { .file("src/lib.rs", "pub fn baz() -> i32 { 1 }") .build(); - foo.cargo("build").run(); + foo.cargo("check").run(); foo.cargo("doc").run(); } @@ -313,7 +313,7 @@ fn native_plugin_dependency_with_custom_linker() { ) .build(); - bar.cargo("build --verbose") + bar.cargo("check --verbose") .with_status(101) .with_stderr_contains( "\ @@ -366,7 +366,7 @@ fn panic_abort_plugins() { ) .build(); - p.cargo("build").run(); + p.cargo("check").run(); } #[cargo_test(nightly, reason = "requires rustc_private")] @@ -417,5 +417,5 @@ fn shared_panic_abort_plugins() { .file("baz/src/lib.rs", "") .build(); - p.cargo("build -v").run(); + p.cargo("check -v").run(); } From 8fc43062414a986de9871bd5fedb566e00267e85 Mon Sep 17 00:00:00 2001 From: Scott Schafer Date: Wed, 15 Feb 2023 20:27:53 -0600 Subject: [PATCH 46/62] chore: update `proc_macro` tests to use check --- tests/testsuite/proc_macro.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/testsuite/proc_macro.rs b/tests/testsuite/proc_macro.rs index 985e9be02cf9..7d6f6ba86f38 100644 --- a/tests/testsuite/proc_macro.rs +++ b/tests/testsuite/proc_macro.rs @@ -58,7 +58,7 @@ fn probe_cfg_before_crate_type_discovery() { ) .build(); - p.cargo("build").run(); + p.cargo("check").run(); } #[cargo_test] @@ -117,8 +117,8 @@ fn noop() { ) .build(); - p.cargo("build").run(); - p.cargo("build").run(); + p.cargo("check").run(); + p.cargo("check").run(); } #[cargo_test] @@ -242,7 +242,7 @@ fn plugin_and_proc_macro() { .build(); let msg = " `lib.plugin` and `lib.proc-macro` cannot both be `true`"; - p.cargo("build") + p.cargo("check") .with_status(101) .with_stderr_contains(msg) .run(); @@ -375,7 +375,7 @@ fn proc_macro_crate_type_warning() { .file("src/lib.rs", "") .build(); - foo.cargo("build") + foo.cargo("check") .with_stderr_contains( "[WARNING] library `foo` should only specify `proc-macro = true` instead of setting `crate-type`") .run(); @@ -398,7 +398,7 @@ fn proc_macro_conflicting_warning() { .file("src/lib.rs", "") .build(); - foo.cargo("build") + foo.cargo("check") .with_stderr_contains( "[WARNING] conflicting between `proc-macro` and `proc_macro` in the `foo` library target.\n `proc_macro` is ignored and not recommended for use in the future", @@ -423,7 +423,7 @@ fn proc_macro_crate_type_warning_plugin() { .file("src/lib.rs", "") .build(); - foo.cargo("build") + foo.cargo("check") .with_stderr_contains( "[WARNING] proc-macro library `foo` should not specify `plugin = true`") .with_stderr_contains( @@ -447,7 +447,7 @@ fn proc_macro_crate_type_multiple() { .file("src/lib.rs", "") .build(); - foo.cargo("build") + foo.cargo("check") .with_stderr( "\ [ERROR] failed to parse manifest at `[..]/foo/Cargo.toml` From a2feb7af698095ebab4ee7133a05498f377b8ba6 Mon Sep 17 00:00:00 2001 From: Scott Schafer Date: Wed, 15 Feb 2023 20:29:47 -0600 Subject: [PATCH 47/62] chore: update `profile_config` tests to use check --- tests/testsuite/profile_config.rs | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/tests/testsuite/profile_config.rs b/tests/testsuite/profile_config.rs index c59ed7a97f59..4ac6f1dd8287 100644 --- a/tests/testsuite/profile_config.rs +++ b/tests/testsuite/profile_config.rs @@ -91,14 +91,14 @@ fn profile_config_validate_warnings() { ) .build(); - p.cargo("build") + p.cargo("check") .with_stderr_unordered( "\ [WARNING] unused config key `profile.dev.bad-key` in `[..].cargo/config` [WARNING] unused config key `profile.dev.package.bar.bad-key-bar` in `[..].cargo/config` [WARNING] unused config key `profile.dev.build-override.bad-key-bo` in `[..].cargo/config` -[COMPILING] foo [..] [FINISHED] [..] +[CHECKING] foo [..] ", ) .run(); @@ -126,7 +126,7 @@ fn profile_config_error_paths() { ) .build(); - p.cargo("build") + p.cargo("check") .with_status(101) .with_stderr( "\ @@ -153,7 +153,7 @@ fn profile_config_validate_errors() { ) .build(); - p.cargo("build") + p.cargo("check") .with_status(101) .with_stderr( "\ @@ -180,7 +180,7 @@ fn profile_config_syntax_errors() { ) .build(); - p.cargo("build") + p.cargo("check") .with_status(101) .with_stderr( "\ @@ -224,7 +224,7 @@ fn profile_config_override_spec_multiple() { // Unfortunately this doesn't tell you which file, hopefully it's not too // much of a problem. - p.cargo("build -v") + p.cargo("check -v") .with_status(101) .with_stderr( "\ @@ -256,11 +256,11 @@ fn profile_config_all_options() { ) .build(); - p.cargo("build --release -v") + p.cargo("check --release -v") .env_remove("CARGO_INCREMENTAL") .with_stderr( "\ -[COMPILING] foo [..] +[CHECKING] foo [..] [RUNNING] `rustc --crate-name foo [..] \ -C opt-level=1 \ -C panic=abort \ @@ -310,12 +310,12 @@ fn profile_config_override_precedence() { ) .build(); - p.cargo("build -v") + p.cargo("check -v") .with_stderr( "\ -[COMPILING] bar [..] +[CHECKING] bar [..] [RUNNING] `rustc --crate-name bar [..] -C opt-level=2[..]-C codegen-units=2 [..] -[COMPILING] foo [..] +[CHECKING] foo [..] [RUNNING] `rustc --crate-name foo [..]-C codegen-units=2 [..] [FINISHED] dev [unoptimized + debuginfo] target(s) in [..]", ) @@ -336,7 +336,7 @@ fn profile_config_no_warn_unknown_override() { ) .build(); - p.cargo("build") + p.cargo("check") .with_stderr_does_not_contain("[..]warning[..]") .run(); } @@ -362,7 +362,7 @@ fn profile_config_mixed_types() { ) .build(); - p.cargo("build -v") + p.cargo("check -v") .with_stderr_contains("[..]-C opt-level=3 [..]") .run(); } @@ -474,7 +474,7 @@ fn named_env_profile() { .file("src/lib.rs", "") .build(); - p.cargo("build -v --profile=other") + p.cargo("check -v --profile=other") .env("CARGO_PROFILE_OTHER_CODEGEN_UNITS", "1") .env("CARGO_PROFILE_OTHER_INHERITS", "dev") .with_stderr_contains("[..]-C codegen-units=1 [..]") From 768ca22c3e607686bcae88e5f216d3bca77a2108 Mon Sep 17 00:00:00 2001 From: Scott Schafer Date: Wed, 15 Feb 2023 20:32:43 -0600 Subject: [PATCH 48/62] chore: update `profile_custom` tests to use check --- tests/testsuite/profile_custom.rs | 44 +++++++++++++++---------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/tests/testsuite/profile_custom.rs b/tests/testsuite/profile_custom.rs index ea6b54c9514f..f8058aebfffe 100644 --- a/tests/testsuite/profile_custom.rs +++ b/tests/testsuite/profile_custom.rs @@ -21,7 +21,7 @@ fn inherits_on_release() { .file("src/lib.rs", "") .build(); - p.cargo("build") + p.cargo("check") .with_status(101) .with_stderr( "\ @@ -49,7 +49,7 @@ fn missing_inherits() { .file("src/lib.rs", "") .build(); - p.cargo("build") + p.cargo("check") .with_status(101) .with_stderr( "\ @@ -79,7 +79,7 @@ fn invalid_profile_name() { .file("src/lib.rs", "") .build(); - p.cargo("build") + p.cargo("check") .with_status(101) .with_stderr( "\ @@ -117,7 +117,7 @@ fn invalid_dir_name() { .file("src/lib.rs", "") .build(); - p.cargo("build") + p.cargo("check") .with_status(101) .with_stderr( "\ @@ -148,7 +148,7 @@ fn dir_name_disabled() { .file("src/lib.rs", "") .build(); - p.cargo("build") + p.cargo("check") .with_status(101) .with_stderr( "\ @@ -181,7 +181,7 @@ fn invalid_inherits() { .file("src/lib.rs", "") .build(); - p.cargo("build") + p.cargo("check") .with_status(101) .with_stderr( "error: profile `release-lto` inherits from `.release`, \ @@ -209,7 +209,7 @@ fn non_existent_inherits() { .file("src/lib.rs", "") .build(); - p.cargo("build") + p.cargo("check") .with_status(101) .with_stderr( "\ @@ -238,7 +238,7 @@ fn self_inherits() { .file("src/lib.rs", "") .build(); - p.cargo("build") + p.cargo("check") .with_status(101) .with_stderr( "\ @@ -271,7 +271,7 @@ fn inherits_loop() { .file("src/lib.rs", "") .build(); - p.cargo("build") + p.cargo("check") .with_status(101) .with_stderr( "\ @@ -483,11 +483,11 @@ fn clean_custom_dirname() { .file("src/main.rs", "fn main() {}") .build(); - p.cargo("build --release") + p.cargo("check --release") .with_stdout("") .with_stderr( "\ -[COMPILING] foo v0.0.1 ([..]) +[CHECKING] foo v0.0.1 ([..]) [FINISHED] release [optimized] target(s) in [..] ", ) @@ -495,7 +495,7 @@ fn clean_custom_dirname() { p.cargo("clean -p foo").run(); - p.cargo("build --release") + p.cargo("check --release") .with_stdout("") .with_stderr( "\ @@ -506,29 +506,29 @@ fn clean_custom_dirname() { p.cargo("clean -p foo --release").run(); - p.cargo("build --release") + p.cargo("check --release") .with_stderr( "\ -[COMPILING] foo v0.0.1 ([..]) +[CHECKING] foo v0.0.1 ([..]) [FINISHED] release [optimized] target(s) in [..] ", ) .run(); - p.cargo("build") + p.cargo("check") .with_stdout("") .with_stderr( "\ -[COMPILING] foo v0.0.1 ([..]) +[CHECKING] foo v0.0.1 ([..]) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", ) .run(); - p.cargo("build --profile=other") + p.cargo("check --profile=other") .with_stderr( "\ -[COMPILING] foo v0.0.1 ([..]) +[CHECKING] foo v0.0.1 ([..]) [FINISHED] other [optimized] target(s) in [..] ", ) @@ -562,7 +562,7 @@ fn unknown_profile() { .file("src/lib.rs", "") .build(); - p.cargo("build --profile alpha") + p.cargo("check --profile alpha") .with_stderr("[ERROR] profile `alpha` is not defined") .with_status(101) .run(); @@ -590,7 +590,7 @@ fn reserved_profile_names() { .file("src/lib.rs", "") .build(); - p.cargo("build --profile=doc") + p.cargo("check --profile=doc") .with_status(101) .with_stderr("error: profile `doc` is reserved and not allowed to be explicitly specified") .run(); @@ -624,7 +624,7 @@ See https://doc.rust-lang.org/cargo/reference/profiles.html for more on configur ), ); - p.cargo("build") + p.cargo("check") .with_status(101) .with_stderr(&format!( "\ @@ -654,7 +654,7 @@ Caused by: "#, ); - p.cargo("build") + p.cargo("check") .with_status(101) .with_stderr( "\ From 0fce9cde6904ad61fe88e28664018e6308eef085 Mon Sep 17 00:00:00 2001 From: Scott Schafer Date: Wed, 15 Feb 2023 20:35:08 -0600 Subject: [PATCH 49/62] chore: update `profile_overrides` tests to use check --- tests/testsuite/profile_overrides.rs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/tests/testsuite/profile_overrides.rs b/tests/testsuite/profile_overrides.rs index 882a7fabd02c..dc9bafba184c 100644 --- a/tests/testsuite/profile_overrides.rs +++ b/tests/testsuite/profile_overrides.rs @@ -29,11 +29,11 @@ fn profile_override_basic() { .file("bar/src/lib.rs", "") .build(); - p.cargo("build -v") + p.cargo("check -v") .with_stderr( - "[COMPILING] bar [..] + "[CHECKING] bar [..] [RUNNING] `rustc --crate-name bar [..] -C opt-level=3 [..]` -[COMPILING] foo [..] +[CHECKING] foo [..] [RUNNING] `rustc --crate-name foo [..] -C opt-level=1 [..]` [FINISHED] dev [optimized + debuginfo] target(s) in [..]", ) @@ -125,7 +125,7 @@ fn profile_override_bad_settings() { .file("bar/src/lib.rs", "") .build(); - p.cargo("build") + p.cargo("check") .with_status(101) .with_stderr_contains(format!("Caused by:\n {}", expected)) .run(); @@ -257,7 +257,7 @@ fn profile_override_spec_multiple() { .file("bar/src/lib.rs", "") .build(); - p.cargo("build -v") + p.cargo("check -v") .with_status(101) .with_stderr_contains( "\ @@ -323,7 +323,7 @@ fn profile_override_spec() { .file("src/lib.rs", "") .build(); - p.cargo("build -v") + p.cargo("check -v") .with_stderr_contains("[RUNNING] `rustc [..]dep1/src/lib.rs [..] -C codegen-units=1 [..]") .with_stderr_contains("[RUNNING] `rustc [..]dep2/src/lib.rs [..] -C codegen-units=2 [..]") .run(); @@ -378,7 +378,7 @@ fn override_proc_macro() { ) .build(); - p.cargo("build -v") + p.cargo("check -v") // Shared built for the proc-macro. .with_stderr_contains("[RUNNING] `rustc [..]--crate-name shared [..]-C codegen-units=4[..]") // Shared built for the library. @@ -414,10 +414,10 @@ fn no_warning_ws() { .file("b/src/lib.rs", "") .build(); - p.cargo("build -p b") + p.cargo("check -p b") .with_stderr( "\ -[COMPILING] b [..] +[CHECKING] b [..] [FINISHED] [..] ", ) From 7dbaee5320d889f29d933e2f471682ca0c4eb176 Mon Sep 17 00:00:00 2001 From: Scott Schafer Date: Wed, 15 Feb 2023 20:40:35 -0600 Subject: [PATCH 50/62] chore: update `profiles` tests to use check --- tests/testsuite/profiles.rs | 46 ++++++++++++++++++------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/tests/testsuite/profiles.rs b/tests/testsuite/profiles.rs index 2d2646fe3f2f..519a12743231 100644 --- a/tests/testsuite/profiles.rs +++ b/tests/testsuite/profiles.rs @@ -269,14 +269,14 @@ fn profile_in_non_root_manifest_triggers_a_warning() { .file("bar/src/main.rs", "fn main() {}") .build(); - p.cargo("build -v") + p.cargo("check -v") .cwd("bar") .with_stderr( "\ [WARNING] profiles for the non root package will be ignored, specify profiles at the workspace root: package: [..] workspace: [..] -[COMPILING] bar v0.1.0 ([..]) +[CHECKING] bar v0.1.0 ([..]) [RUNNING] `rustc [..]` [FINISHED] dev [unoptimized] target(s) in [..]", ) @@ -311,11 +311,11 @@ fn profile_in_virtual_manifest_works() { .file("bar/src/main.rs", "fn main() {}") .build(); - p.cargo("build -v") + p.cargo("check -v") .cwd("bar") .with_stderr( "\ -[COMPILING] bar v0.1.0 ([..]) +[CHECKING] bar v0.1.0 ([..]) [RUNNING] `rustc [..]` [FINISHED] dev [optimized] target(s) in [..]", ) @@ -339,7 +339,7 @@ fn profile_lto_string_bool_dev() { .file("src/lib.rs", "") .build(); - p.cargo("build") + p.cargo("check") .with_status(101) .with_stderr( "\ @@ -373,7 +373,7 @@ fn profile_panic_test_bench() { .file("src/lib.rs", "") .build(); - p.cargo("build") + p.cargo("check") .with_stderr_contains( "\ [WARNING] `panic` setting is ignored for `bench` profile @@ -400,7 +400,7 @@ fn profile_doc_deprecated() { .file("src/lib.rs", "") .build(); - p.cargo("build") + p.cargo("check") .with_stderr_contains("[WARNING] profile `doc` is deprecated and has no effect") .run(); } @@ -463,10 +463,10 @@ fn debug_0_report() { .file("src/lib.rs", "") .build(); - p.cargo("build -v") + p.cargo("check -v") .with_stderr( "\ -[COMPILING] foo v0.1.0 [..] +[CHECKING] foo v0.1.0 [..] [RUNNING] `rustc --crate-name foo src/lib.rs [..]-C debuginfo=0 [..] [FINISHED] dev [unoptimized] target(s) in [..] ", @@ -492,10 +492,10 @@ fn thin_lto_works() { .file("src/main.rs", "fn main() {}") .build(); - p.cargo("build --release -v") + p.cargo("check --release -v") .with_stderr( "\ -[COMPILING] top [..] +[CHECKING] top [..] [RUNNING] `rustc [..] -C lto=thin [..]` [FINISHED] [..] ", @@ -520,10 +520,10 @@ fn strip_works() { .file("src/main.rs", "fn main() {}") .build(); - p.cargo("build --release -v") + p.cargo("check --release -v") .with_stderr( "\ -[COMPILING] foo [..] +[CHECKING] foo [..] [RUNNING] `rustc [..] -C strip=symbols [..]` [FINISHED] [..] ", @@ -548,11 +548,11 @@ fn strip_passes_unknown_option_to_rustc() { .file("src/main.rs", "fn main() {}") .build(); - p.cargo("build --release -v") + p.cargo("check --release -v") .with_status(101) .with_stderr_contains( "\ -[COMPILING] foo [..] +[CHECKING] foo [..] [RUNNING] `rustc [..] -C strip=unknown [..]` error: incorrect value `unknown` for [..] `strip` [..] was expected ", @@ -577,10 +577,10 @@ fn strip_accepts_true_to_strip_symbols() { .file("src/main.rs", "fn main() {}") .build(); - p.cargo("build --release -v") + p.cargo("check --release -v") .with_stderr( "\ -[COMPILING] foo [..] +[CHECKING] foo [..] [RUNNING] `rustc [..] -C strip=symbols [..]` [FINISHED] [..] ", @@ -605,7 +605,7 @@ fn strip_accepts_false_to_disable_strip() { .file("src/main.rs", "fn main() {}") .build(); - p.cargo("build --release -v") + p.cargo("check --release -v") .with_stderr_does_not_contain("-C strip") .run(); } @@ -629,11 +629,11 @@ fn rustflags_works() { .file("src/main.rs", "fn main() {}") .build(); - p.cargo("build -v") + p.cargo("check -v") .masquerade_as_nightly_cargo(&["profile-rustflags"]) .with_stderr( "\ -[COMPILING] foo [..] +[CHECKING] foo [..] [RUNNING] `rustc --crate-name foo [..] -C link-dead-code=yes [..] [FINISHED] [..] ", @@ -657,12 +657,12 @@ fn rustflags_works_with_env() { .file("src/main.rs", "fn main() {}") .build(); - p.cargo("build -v") + p.cargo("check -v") .env("CARGO_PROFILE_DEV_RUSTFLAGS", "-C link-dead-code=yes") .masquerade_as_nightly_cargo(&["profile-rustflags"]) .with_stderr( "\ -[COMPILING] foo [..] +[CHECKING] foo [..] [RUNNING] `rustc --crate-name foo [..] -C link-dead-code=yes [..] [FINISHED] [..] ", @@ -687,7 +687,7 @@ fn rustflags_requires_cargo_feature() { .file("src/main.rs", "fn main() {}") .build(); - p.cargo("build -v") + p.cargo("check -v") .masquerade_as_nightly_cargo(&["profile-rustflags"]) .with_status(101) .with_stderr( From 093f2bb9dd82874ca78afa83c2897ccc0f2bb41c Mon Sep 17 00:00:00 2001 From: Scott Schafer Date: Wed, 15 Feb 2023 20:41:12 -0600 Subject: [PATCH 51/62] chore: update `progress` tests to use check --- tests/testsuite/progress.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/testsuite/progress.rs b/tests/testsuite/progress.rs index f5845d2e0397..20870a39418b 100644 --- a/tests/testsuite/progress.rs +++ b/tests/testsuite/progress.rs @@ -16,7 +16,7 @@ fn bad_progress_config_unknown_when() { .file("src/lib.rs", "") .build(); - p.cargo("build") + p.cargo("check") .with_status(101) .with_stderr( "\ @@ -43,7 +43,7 @@ fn bad_progress_config_missing_width() { .file("src/lib.rs", "") .build(); - p.cargo("build") + p.cargo("check") .with_status(101) .with_stderr( "\ @@ -66,7 +66,7 @@ fn bad_progress_config_missing_when() { .file("src/lib.rs", "") .build(); - p.cargo("build") + p.cargo("check") .with_status(101) .with_stderr( "\ @@ -110,7 +110,7 @@ fn always_shows_progress() { .file("src/lib.rs", "") .build(); - p.cargo("build") + p.cargo("check") .with_stderr_contains("[DOWNLOADING] [..] crates [..]") .with_stderr_contains("[..][DOWNLOADED] 3 crates ([..]) in [..]") .with_stderr_contains("[BUILDING] [..] [..]/4: [..]") @@ -151,7 +151,7 @@ fn never_progress() { .file("src/lib.rs", "") .build(); - p.cargo("build") + p.cargo("check") .with_stderr_does_not_contain("[DOWNLOADING] [..] crates [..]") .with_stderr_does_not_contain("[..][DOWNLOADED] 3 crates ([..]) in [..]") .with_stderr_does_not_contain("[BUILDING] [..] [..]/4: [..]") From 8aaaac4343968fdb4d75aadf7ba5af3dce903af6 Mon Sep 17 00:00:00 2001 From: Scott Schafer Date: Wed, 15 Feb 2023 20:41:59 -0600 Subject: [PATCH 52/62] chore: update `pub_priv` tests to use check --- tests/testsuite/pub_priv.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/testsuite/pub_priv.rs b/tests/testsuite/pub_priv.rs index dfd260b06a3f..83c6a49f89a9 100644 --- a/tests/testsuite/pub_priv.rs +++ b/tests/testsuite/pub_priv.rs @@ -32,7 +32,7 @@ fn exported_priv_warning() { ) .build(); - p.cargo("build --message-format=short") + p.cargo("check --message-format=short") .masquerade_as_nightly_cargo(&["public-dependency"]) .with_stderr_contains( "\ @@ -71,15 +71,15 @@ fn exported_pub_dep() { ) .build(); - p.cargo("build --message-format=short") + p.cargo("check --message-format=short") .masquerade_as_nightly_cargo(&["public-dependency"]) .with_stderr( "\ [UPDATING] `[..]` index [DOWNLOADING] crates ... [DOWNLOADED] pub_dep v0.1.0 ([..]) -[COMPILING] pub_dep v0.1.0 -[COMPILING] foo v0.0.1 ([CWD]) +[CHECKING] pub_dep v0.1.0 +[CHECKING] foo v0.0.1 ([CWD]) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", ) @@ -98,7 +98,7 @@ pub fn requires_nightly_cargo() { .file("src/lib.rs", "") .build(); - p.cargo("build --message-format=short") + p.cargo("check --message-format=short") .with_status(101) .with_stderr( "\ @@ -134,7 +134,7 @@ fn requires_feature() { .file("src/lib.rs", "") .build(); - p.cargo("build --message-format=short") + p.cargo("check --message-format=short") .masquerade_as_nightly_cargo(&["public-dependency"]) .with_status(101) .with_stderr( @@ -184,7 +184,7 @@ fn pub_dev_dependency() { ) .build(); - p.cargo("build --message-format=short") + p.cargo("check --message-format=short") .masquerade_as_nightly_cargo(&["public-dependency"]) .with_status(101) .with_stderr( From 8ee0280351f0dd1819c23d08005ba7bf05bc0433 Mon Sep 17 00:00:00 2001 From: Scott Schafer Date: Wed, 15 Feb 2023 20:49:46 -0600 Subject: [PATCH 53/62] chore: update `registry` tests to use check --- tests/testsuite/registry.rs | 218 ++++++++++++++++++------------------ 1 file changed, 109 insertions(+), 109 deletions(-) diff --git a/tests/testsuite/registry.rs b/tests/testsuite/registry.rs index 7fa94845893d..626436ae73f0 100644 --- a/tests/testsuite/registry.rs +++ b/tests/testsuite/registry.rs @@ -53,14 +53,14 @@ fn simple() { Package::new("bar", "0.0.1").publish(); - p.cargo("build") + p.cargo("check") .with_stderr( "\ [UPDATING] `dummy-registry` index [DOWNLOADING] crates ... [DOWNLOADED] bar v0.0.1 (registry `dummy-registry`) -[COMPILING] bar v0.0.1 -[COMPILING] foo v0.0.1 ([CWD]) +[CHECKING] bar v0.0.1 +[CHECKING] foo v0.0.1 ([CWD]) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..]s ", ) @@ -71,11 +71,11 @@ fn simple() { assert!(paths::home().join(".cargo/registry/CACHEDIR.TAG").is_file()); // Don't download a second time - p.cargo("build") + p.cargo("check") .with_stderr( "\ -[COMPILING] bar v0.0.1 -[COMPILING] foo v0.0.1 ([CWD]) +[CHECKING] bar v0.0.1 +[CHECKING] foo v0.0.1 ([CWD]) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..]s ", ) @@ -113,16 +113,16 @@ fn deps() { Package::new("baz", "0.0.1").publish(); Package::new("bar", "0.0.1").dep("baz", "*").publish(); - p.cargo("build") + p.cargo("check") .with_stderr( "\ [UPDATING] `dummy-registry` index [DOWNLOADING] crates ... [DOWNLOADED] [..] v0.0.1 (registry `dummy-registry`) [DOWNLOADED] [..] v0.0.1 (registry `dummy-registry`) -[COMPILING] baz v0.0.1 -[COMPILING] bar v0.0.1 -[COMPILING] foo v0.0.1 ([CWD]) +[CHECKING] baz v0.0.1 +[CHECKING] bar v0.0.1 +[CHECKING] foo v0.0.1 ([CWD]) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..]s ", ) @@ -161,7 +161,7 @@ fn nonexistent() { .file("src/main.rs", "fn main() {}") .build(); - p.cargo("build") + p.cargo("check") .with_status(101) .with_stderr( "\ @@ -205,7 +205,7 @@ fn wrong_case() { .build(); // #5678 to make this work - p.cargo("build") + p.cargo("check") .with_status(101) .with_stderr( "\ @@ -251,7 +251,7 @@ fn mis_hyphenated() { .build(); // #2775 to make this work - p.cargo("build") + p.cargo("check") .with_status(101) .with_stderr( "\ @@ -297,7 +297,7 @@ fn wrong_version() { Package::new("foo", "0.0.1").publish(); Package::new("foo", "0.0.2").publish(); - p.cargo("build") + p.cargo("check") .with_status(101) .with_stderr_contains( "\ @@ -312,7 +312,7 @@ required by package `foo v0.0.1 ([..])` Package::new("foo", "0.0.3").publish(); Package::new("foo", "0.0.4").publish(); - p.cargo("build") + p.cargo("check") .with_status(101) .with_stderr_contains( "\ @@ -357,7 +357,7 @@ fn bad_cksum() { pkg.publish(); t!(File::create(&pkg.archive_dst())); - p.cargo("build -v") + p.cargo("check -v") .with_status(101) .with_stderr( "\ @@ -403,7 +403,7 @@ fn update_registry() { .file("src/main.rs", "fn main() {}") .build(); - p.cargo("build") + p.cargo("check") .with_status(101) .with_stderr_contains( "\ @@ -416,14 +416,14 @@ required by package `foo v0.0.1 ([..])` Package::new("notyet", "0.0.1").publish(); - p.cargo("build") + p.cargo("check") .with_stderr( "\ [UPDATING] `dummy-registry` index [DOWNLOADING] crates ... [DOWNLOADED] notyet v0.0.1 (registry `dummy-registry`) -[COMPILING] notyet v0.0.1 -[COMPILING] foo v0.0.1 ([CWD]) +[CHECKING] notyet v0.0.1 +[CHECKING] foo v0.0.1 ([CWD]) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..]s ", ) @@ -531,14 +531,14 @@ fn lockfile_locks() { Package::new("bar", "0.0.1").publish(); - p.cargo("build") + p.cargo("check") .with_stderr( "\ [UPDATING] `[..]` index [DOWNLOADING] crates ... [DOWNLOADED] bar v0.0.1 (registry `dummy-registry`) -[COMPILING] bar v0.0.1 -[COMPILING] foo v0.0.1 ([CWD]) +[CHECKING] bar v0.0.1 +[CHECKING] foo v0.0.1 ([CWD]) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..]s ", ) @@ -547,7 +547,7 @@ fn lockfile_locks() { p.root().move_into_the_past(); Package::new("bar", "0.0.2").publish(); - p.cargo("build").with_stdout("").run(); + p.cargo("check").with_stdout("").run(); } #[cargo_test] @@ -581,16 +581,16 @@ fn lockfile_locks_transitively() { Package::new("baz", "0.0.1").publish(); Package::new("bar", "0.0.1").dep("baz", "*").publish(); - p.cargo("build") + p.cargo("check") .with_stderr( "\ [UPDATING] `[..]` index [DOWNLOADING] crates ... [DOWNLOADED] [..] v0.0.1 (registry `dummy-registry`) [DOWNLOADED] [..] v0.0.1 (registry `dummy-registry`) -[COMPILING] baz v0.0.1 -[COMPILING] bar v0.0.1 -[COMPILING] foo v0.0.1 ([CWD]) +[CHECKING] baz v0.0.1 +[CHECKING] bar v0.0.1 +[CHECKING] foo v0.0.1 ([CWD]) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..]s ", ) @@ -600,7 +600,7 @@ fn lockfile_locks_transitively() { Package::new("baz", "0.0.2").publish(); Package::new("bar", "0.0.2").dep("baz", "*").publish(); - p.cargo("build").with_stdout("").run(); + p.cargo("check").with_stdout("").run(); } #[cargo_test] @@ -639,16 +639,16 @@ fn yanks_are_not_used() { .yanked(true) .publish(); - p.cargo("build") + p.cargo("check") .with_stderr( "\ [UPDATING] `[..]` index [DOWNLOADING] crates ... [DOWNLOADED] [..] v0.0.1 (registry `dummy-registry`) [DOWNLOADED] [..] v0.0.1 (registry `dummy-registry`) -[COMPILING] baz v0.0.1 -[COMPILING] bar v0.0.1 -[COMPILING] foo v0.0.1 ([CWD]) +[CHECKING] baz v0.0.1 +[CHECKING] bar v0.0.1 +[CHECKING] foo v0.0.1 ([CWD]) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..]s ", ) @@ -687,7 +687,7 @@ fn relying_on_a_yank_is_bad() { Package::new("baz", "0.0.2").yanked(true).publish(); Package::new("bar", "0.0.1").dep("baz", "=0.0.2").publish(); - p.cargo("build") + p.cargo("check") .with_status(101) .with_stderr_contains( "\ @@ -731,13 +731,13 @@ fn yanks_in_lockfiles_are_ok() { Package::new("bar", "0.0.1").publish(); - p.cargo("build").run(); + p.cargo("check").run(); registry_path().join("3").rm_rf(); Package::new("bar", "0.0.1").yanked(true).publish(); - p.cargo("build").with_stdout("").run(); + p.cargo("check").with_stdout("").run(); p.cargo("update") .with_status(101) @@ -783,14 +783,14 @@ fn yanks_in_lockfiles_are_ok_for_other_update() { Package::new("bar", "0.0.1").publish(); Package::new("baz", "0.0.1").publish(); - p.cargo("build").run(); + p.cargo("check").run(); registry_path().join("3").rm_rf(); Package::new("bar", "0.0.1").yanked(true).publish(); Package::new("baz", "0.0.1").publish(); - p.cargo("build").with_stdout("").run(); + p.cargo("check").with_stdout("").run(); Package::new("baz", "0.0.2").publish(); @@ -845,7 +845,7 @@ fn yanks_in_lockfiles_are_ok_with_new_dep() { Package::new("bar", "0.0.1").publish(); - p.cargo("build").run(); + p.cargo("check").run(); registry_path().join("3").rm_rf(); @@ -866,7 +866,7 @@ fn yanks_in_lockfiles_are_ok_with_new_dep() { "#, ); - p.cargo("build").with_stdout("").run(); + p.cargo("check").with_stdout("").run(); } #[cargo_test] @@ -898,11 +898,11 @@ fn update_with_lockfile_if_packages_missing() { .build(); Package::new("bar", "0.0.1").publish(); - p.cargo("build").run(); + p.cargo("check").run(); p.root().move_into_the_past(); paths::home().join(".cargo/registry").rm_rf(); - p.cargo("build") + p.cargo("check") .with_stderr( "\ [UPDATING] `[..]` index @@ -944,7 +944,7 @@ fn update_lockfile() { println!("0.0.1"); Package::new("bar", "0.0.1").publish(); - p.cargo("build").run(); + p.cargo("check").run(); Package::new("bar", "0.0.2").publish(); Package::new("bar", "0.0.3").publish(); @@ -960,13 +960,13 @@ fn update_lockfile() { .run(); println!("0.0.2 build"); - p.cargo("build") + p.cargo("check") .with_stderr( "\ [DOWNLOADING] crates ... [DOWNLOADED] [..] v0.0.2 (registry `dummy-registry`) -[COMPILING] bar v0.0.2 -[COMPILING] foo v0.0.1 ([CWD]) +[CHECKING] bar v0.0.2 +[CHECKING] foo v0.0.1 ([CWD]) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..]s ", ) @@ -983,13 +983,13 @@ fn update_lockfile() { .run(); println!("0.0.3 build"); - p.cargo("build") + p.cargo("check") .with_stderr( "\ [DOWNLOADING] crates ... [DOWNLOADED] [..] v0.0.3 (registry `dummy-registry`) -[COMPILING] bar v0.0.3 -[COMPILING] foo v0.0.1 ([CWD]) +[CHECKING] bar v0.0.3 +[CHECKING] foo v0.0.1 ([CWD]) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..]s ", ) @@ -1052,14 +1052,14 @@ fn dev_dependency_not_used() { Package::new("baz", "0.0.1").publish(); Package::new("bar", "0.0.1").dev_dep("baz", "*").publish(); - p.cargo("build") + p.cargo("check") .with_stderr( "\ [UPDATING] `[..]` index [DOWNLOADING] crates ... [DOWNLOADED] [..] v0.0.1 (registry `dummy-registry`) -[COMPILING] bar v0.0.1 -[COMPILING] foo v0.0.1 ([CWD]) +[CHECKING] bar v0.0.1 +[CHECKING] foo v0.0.1 ([CWD]) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..]s ", ) @@ -1145,15 +1145,15 @@ fn updating_a_dep() { Package::new("bar", "0.0.1").publish(); - p.cargo("build") + p.cargo("check") .with_stderr( "\ [UPDATING] `[..]` index [DOWNLOADING] crates ... [DOWNLOADED] bar v0.0.1 (registry `dummy-registry`) -[COMPILING] bar v0.0.1 -[COMPILING] a v0.0.1 ([CWD]/a) -[COMPILING] foo v0.0.1 ([CWD]) +[CHECKING] bar v0.0.1 +[CHECKING] a v0.0.1 ([CWD]/a) +[CHECKING] foo v0.0.1 ([CWD]) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..]s ", ) @@ -1181,15 +1181,15 @@ fn updating_a_dep() { Package::new("bar", "0.1.0").publish(); println!("second"); - p.cargo("build") + p.cargo("check") .with_stderr( "\ [UPDATING] `[..]` index [DOWNLOADING] crates ... [DOWNLOADED] bar v0.1.0 (registry `dummy-registry`) -[COMPILING] bar v0.1.0 -[COMPILING] a v0.0.1 ([CWD]/a) -[COMPILING] foo v0.0.1 ([CWD]) +[CHECKING] bar v0.1.0 +[CHECKING] a v0.0.1 ([CWD]/a) +[CHECKING] foo v0.0.1 ([CWD]) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..]s ", ) @@ -1253,16 +1253,16 @@ fn git_and_registry_dep() { Package::new("a", "0.0.1").publish(); p.root().move_into_the_past(); - p.cargo("build") + p.cargo("check") .with_stderr( "\ [UPDATING] [..] [UPDATING] [..] [DOWNLOADING] crates ... [DOWNLOADED] a v0.0.1 (registry `dummy-registry`) -[COMPILING] a v0.0.1 -[COMPILING] b v0.0.1 ([..]) -[COMPILING] foo v0.0.1 ([CWD]) +[CHECKING] a v0.0.1 +[CHECKING] b v0.0.1 ([..]) +[CHECKING] foo v0.0.1 ([CWD]) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..]s ", ) @@ -1270,7 +1270,7 @@ fn git_and_registry_dep() { p.root().move_into_the_past(); println!("second"); - p.cargo("build").with_stdout("").run(); + p.cargo("check").with_stdout("").run(); } #[cargo_test] @@ -1440,14 +1440,14 @@ fn update_transitive_dependency() { ) .run(); - p.cargo("build") + p.cargo("check") .with_stderr( "\ [DOWNLOADING] crates ... [DOWNLOADED] b v0.1.1 (registry `dummy-registry`) -[COMPILING] b v0.1.1 -[COMPILING] a v0.1.0 -[COMPILING] foo v0.5.0 ([..]) +[CHECKING] b v0.1.1 +[CHECKING] a v0.1.0 +[CHECKING] foo v0.5.0 ([..]) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..]s ", ) @@ -1572,14 +1572,14 @@ fn update_multiple_packages() { ) .run(); - p.cargo("build") + p.cargo("check") .with_stderr_contains("[DOWNLOADED] a v0.1.1 (registry `dummy-registry`)") .with_stderr_contains("[DOWNLOADED] b v0.1.1 (registry `dummy-registry`)") .with_stderr_contains("[DOWNLOADED] c v0.1.1 (registry `dummy-registry`)") - .with_stderr_contains("[COMPILING] a v0.1.1") - .with_stderr_contains("[COMPILING] b v0.1.1") - .with_stderr_contains("[COMPILING] c v0.1.1") - .with_stderr_contains("[COMPILING] foo v0.5.0 ([..])") + .with_stderr_contains("[CHECKING] a v0.1.1") + .with_stderr_contains("[CHECKING] b v0.1.1") + .with_stderr_contains("[CHECKING] c v0.1.1") + .with_stderr_contains("[CHECKING] foo v0.5.0 ([..])") .run(); } @@ -1702,7 +1702,7 @@ fn use_semver() { Package::new("foo", "1.2.3-alpha.0").publish(); - p.cargo("build").run(); + p.cargo("check").run(); } #[cargo_test] @@ -1750,7 +1750,7 @@ fn use_semver_package_incorrectly() { .file("b/src/main.rs", "fn main() {}") .build(); - p.cargo("build") + p.cargo("check") .with_status(101) .with_stderr( "\ @@ -1801,14 +1801,14 @@ fn only_download_relevant() { Package::new("bar", "0.1.0").publish(); Package::new("baz", "0.1.0").publish(); - p.cargo("build") + p.cargo("check") .with_stderr( "\ [UPDATING] `[..]` index [DOWNLOADING] crates ... [DOWNLOADED] baz v0.1.0 ([..]) -[COMPILING] baz v0.1.0 -[COMPILING] bar v0.5.0 ([..]) +[CHECKING] baz v0.1.0 +[CHECKING] bar v0.5.0 ([..]) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..]s ", ) @@ -1848,7 +1848,7 @@ fn resolve_and_backtracking() { .publish(); Package::new("foo", "0.1.0").publish(); - p.cargo("build").run(); + p.cargo("check").run(); } #[cargo_test] @@ -1883,7 +1883,7 @@ fn upstream_warnings_on_extra_verbose() { .file("src/lib.rs", "fn unused() {}") .publish(); - p.cargo("build -vv") + p.cargo("check -vv") .with_stderr_contains("[WARNING] [..]unused[..]") .run(); } @@ -1907,7 +1907,7 @@ fn disallow_network_http() { .file("src/main.rs", "fn main() {}") .build(); - p.cargo("build --frozen") + p.cargo("check --frozen") .with_status(101) .with_stderr( "\ @@ -1942,7 +1942,7 @@ fn disallow_network_git() { .file("src/main.rs", "fn main() {}") .build(); - p.cargo("build --frozen") + p.cargo("check --frozen") .with_status(101) .with_stderr( "\ @@ -2004,7 +2004,7 @@ fn add_dep_dont_update_registry() { Package::new("remote", "0.3.4").publish(); - p.cargo("build").run(); + p.cargo("check").run(); p.change_file( "Cargo.toml", @@ -2020,10 +2020,10 @@ fn add_dep_dont_update_registry() { "#, ); - p.cargo("build") + p.cargo("check") .with_stderr( "\ -[COMPILING] bar v0.5.0 ([..]) +[CHECKING] bar v0.5.0 ([..]) [FINISHED] [..] ", ) @@ -2073,7 +2073,7 @@ fn bump_version_dont_update_registry() { Package::new("remote", "0.3.4").publish(); - p.cargo("build").run(); + p.cargo("check").run(); p.change_file( "Cargo.toml", @@ -2088,10 +2088,10 @@ fn bump_version_dont_update_registry() { "#, ); - p.cargo("build") + p.cargo("check") .with_stderr( "\ -[COMPILING] bar v0.6.0 ([..]) +[CHECKING] bar v0.6.0 ([..]) [FINISHED] [..] ", ) @@ -2144,7 +2144,7 @@ fn toml_lies_but_index_is_truth() { .file("src/main.rs", "fn main() {}") .build(); - p.cargo("build -v").run(); + p.cargo("check -v").run(); } #[cargo_test] @@ -2182,7 +2182,7 @@ fn vv_prints_warnings() { .file("src/main.rs", "fn main() {}") .build(); - p.cargo("build -vv").run(); + p.cargo("check -vv").run(); } #[cargo_test] @@ -2217,7 +2217,7 @@ fn bad_and_or_malicious_packages_rejected() { .file("src/main.rs", "fn main() {}") .build(); - p.cargo("build -vv") + p.cargo("check -vv") .with_status(101) .with_stderr( "\ @@ -2267,7 +2267,7 @@ fn git_init_templatedir_missing() { .file("src/main.rs", "fn main() {}") .build(); - p.cargo("build").run(); + p.cargo("check").run(); remove_dir_all(paths::home().join(".cargo/registry")).unwrap(); fs::write( @@ -2279,8 +2279,8 @@ fn git_init_templatedir_missing() { ) .unwrap(); - p.cargo("build").run(); - p.cargo("build").run(); + p.cargo("check").run(); + p.cargo("check").run(); } #[cargo_test] @@ -2347,9 +2347,9 @@ fn rename_deps_and_features() { ) .build(); - p.cargo("build").run(); - p.cargo("build --features bar/foo01").run(); - p.cargo("build --features bar/another").run(); + p.cargo("check").run(); + p.cargo("check --features bar/foo01").run(); + p.cargo("check --features bar/another").run(); } #[cargo_test] @@ -2385,7 +2385,7 @@ fn ignore_invalid_json_lines() { .file("src/lib.rs", "") .build(); - p.cargo("build").run(); + p.cargo("check").run(); } #[cargo_test] @@ -2421,7 +2421,7 @@ fn readonly_registry_still_works() { p.cargo("generate-lockfile").run(); p.cargo("fetch --locked").run(); chmod_readonly(&paths::home(), true); - p.cargo("build").run(); + p.cargo("check").run(); // make sure we un-readonly the files afterwards so "cargo clean" can remove them (#6934) chmod_readonly(&paths::home(), false); @@ -2529,7 +2529,7 @@ fn package_lock_inside_package_is_overwritten() { .file(".cargo-ok", "") .publish(); - p.cargo("build").run(); + p.cargo("check").run(); let id = SourceId::for_registry(registry.index_url()).unwrap(); let hash = cargo::util::hex::short_hash(&id); @@ -2567,7 +2567,7 @@ fn package_lock_as_a_symlink_inside_package_is_overwritten() { .symlink(".cargo-ok", "src/lib.rs") .publish(); - p.cargo("build").run(); + p.cargo("check").run(); let id = SourceId::for_registry(registry.index_url()).unwrap(); let hash = cargo::util::hex::short_hash(&id); @@ -2663,7 +2663,7 @@ fn reach_max_unpack_size() { // Size of bar.crate is around 180 bytes. Package::new("bar", "0.0.1").publish(); - p.cargo("build") + p.cargo("check") .env("__CARGO_TEST_MAX_UNPACK_SIZE", "8") // hit 8 bytes limit and boom! .env("__CARGO_TEST_MAX_UNPACK_RATIO", "0") .with_status(101) @@ -2687,12 +2687,12 @@ Caused by: .run(); // Restore to the default ratio and it should compile. - p.cargo("build") + p.cargo("check") .env("__CARGO_TEST_MAX_UNPACK_SIZE", "8") .with_stderr( "\ -[COMPILING] bar v0.0.1 -[COMPILING] foo v0.0.1 ([..]) +[CHECKING] bar v0.0.1 +[CHECKING] foo v0.0.1 ([..]) [FINISHED] dev [..] ", ) @@ -2733,7 +2733,7 @@ fn sparse_retry() { Package::new("bar", "0.0.1").publish(); - p.cargo("build") + p.cargo("check") .with_stderr( "\ [UPDATING] `dummy-registry` index @@ -2745,8 +2745,8 @@ body: internal server error [DOWNLOADING] crates ... [DOWNLOADED] bar v0.0.1 (registry `dummy-registry`) -[COMPILING] bar v0.0.1 -[COMPILING] foo v0.0.1 ([CWD]) +[CHECKING] bar v0.0.1 +[CHECKING] foo v0.0.1 ([CWD]) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..]s ", ) From f348f7d4d92438aafb4482893f3ef1e0eb9c36c8 Mon Sep 17 00:00:00 2001 From: Scott Schafer Date: Wed, 15 Feb 2023 20:50:16 -0600 Subject: [PATCH 54/62] chore: update `registry_auth` tests to use check --- tests/testsuite/registry_auth.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/testsuite/registry_auth.rs b/tests/testsuite/registry_auth.rs index 03665e6ee659..3989dc9ec2f5 100644 --- a/tests/testsuite/registry_auth.rs +++ b/tests/testsuite/registry_auth.rs @@ -49,7 +49,7 @@ fn requires_nightly() { .build(); let p = make_project(); - p.cargo("build") + p.cargo("check") .with_status(101) .with_stderr( r#"[UPDATING] `alternative` index From 58b7a47a9ae998eded40fb21d4cccb651a298476 Mon Sep 17 00:00:00 2001 From: Scott Schafer Date: Wed, 15 Feb 2023 20:51:12 -0600 Subject: [PATCH 55/62] chore: update `rename_deps` tests to use check --- tests/testsuite/rename_deps.rs | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/tests/testsuite/rename_deps.rs b/tests/testsuite/rename_deps.rs index f2744049b3ea..5c9748d97a12 100644 --- a/tests/testsuite/rename_deps.rs +++ b/tests/testsuite/rename_deps.rs @@ -27,7 +27,7 @@ fn rename_dependency() { .file("src/lib.rs", "extern crate bar; extern crate baz;") .build(); - p.cargo("build").run(); + p.cargo("check").run(); } #[cargo_test] @@ -61,7 +61,7 @@ fn rename_with_different_names() { .file("bar/src/lib.rs", "") .build(); - p.cargo("build").run(); + p.cargo("check").run(); } #[cargo_test] @@ -125,7 +125,7 @@ fn lots_of_names() { .file("foo/src/lib.rs", "pub fn foo4() {}") .build(); - p.cargo("build -v").run(); + p.cargo("check -v").run(); } #[cargo_test] @@ -156,7 +156,7 @@ fn rename_and_patch() { .file("foo/src/lib.rs", "pub fn foo() {}") .build(); - p.cargo("build -v").run(); + p.cargo("check -v").run(); } #[cargo_test] @@ -181,7 +181,7 @@ fn rename_twice() { .file("src/lib.rs", "") .build(); - p.cargo("build -v") + p.cargo("check -v") .with_status(101) .with_stderr( "\ @@ -214,7 +214,7 @@ fn rename_affects_fingerprint() { .file("src/lib.rs", "extern crate foo;") .build(); - p.cargo("build -v").run(); + p.cargo("check -v").run(); p.change_file( "Cargo.toml", @@ -229,7 +229,7 @@ fn rename_affects_fingerprint() { "#, ); - p.cargo("build -v") + p.cargo("check -v") .with_status(101) .with_stderr_contains("[..]can't find crate for `foo`") .run(); @@ -327,7 +327,7 @@ fn features_still_work() { .file("b/src/lib.rs", "extern crate b;") .build(); - p.cargo("build -v").run(); + p.cargo("check -v").run(); } #[cargo_test] @@ -355,7 +355,7 @@ fn features_not_working() { .file("a/Cargo.toml", &basic_manifest("p1", "0.1.0")) .build(); - p.cargo("build -v") + p.cargo("check -v") .with_status(101) .with_stderr( "\ @@ -387,5 +387,5 @@ fn rename_with_dash() { .file("a/src/lib.rs", "") .build(); - p.cargo("build").run(); + p.cargo("check").run(); } From b11bb640b61e2286c40d32db37cb18a1bc8fabe5 Mon Sep 17 00:00:00 2001 From: Scott Schafer Date: Wed, 15 Feb 2023 20:54:00 -0600 Subject: [PATCH 56/62] chore: update `replace` tests to use check --- tests/testsuite/replace.rs | 106 ++++++++++++++++++------------------- 1 file changed, 53 insertions(+), 53 deletions(-) diff --git a/tests/testsuite/replace.rs b/tests/testsuite/replace.rs index f71c8047d09f..c11c49330d96 100644 --- a/tests/testsuite/replace.rs +++ b/tests/testsuite/replace.rs @@ -39,13 +39,13 @@ fn override_simple() { ) .build(); - p.cargo("build") + p.cargo("check") .with_stderr( "\ [UPDATING] `dummy-registry` index [UPDATING] git repository `[..]` -[COMPILING] bar v0.1.0 (file://[..]) -[COMPILING] foo v0.0.1 ([CWD]) +[CHECKING] bar v0.1.0 (file://[..]) +[CHECKING] foo v0.0.1 ([CWD]) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", ) @@ -86,15 +86,15 @@ fn override_with_features() { ) .build(); - p.cargo("build") + p.cargo("check") .with_stderr( "\ [UPDATING] [..] index [UPDATING] git repository `[..]` [WARNING] replacement for `bar` uses the features mechanism. default-features and features \ will not take effect because the replacement dependency does not support this mechanism -[COMPILING] bar v0.1.0 (file://[..]) -[COMPILING] foo v0.0.1 ([CWD]) +[CHECKING] bar v0.1.0 (file://[..]) +[CHECKING] foo v0.0.1 ([CWD]) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", ) @@ -135,15 +135,15 @@ fn override_with_setting_default_features() { ) .build(); - p.cargo("build") + p.cargo("check") .with_stderr( "\ [UPDATING] [..] index [UPDATING] git repository `[..]` [WARNING] replacement for `bar` uses the features mechanism. default-features and features \ will not take effect because the replacement dependency does not support this mechanism -[COMPILING] bar v0.1.0 (file://[..]) -[COMPILING] foo v0.0.1 ([CWD]) +[CHECKING] bar v0.1.0 (file://[..]) +[CHECKING] foo v0.0.1 ([CWD]) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", ) @@ -171,7 +171,7 @@ fn missing_version() { .file("src/lib.rs", "") .build(); - p.cargo("build") + p.cargo("check") .with_status(101) .with_stderr( "\ @@ -205,7 +205,7 @@ fn invalid_semver_version() { .file("src/lib.rs", "") .build(); - p.cargo("build") + p.cargo("check") .with_status(101) .with_stderr_contains( "\ @@ -242,7 +242,7 @@ fn different_version() { .file("src/lib.rs", "") .build(); - p.cargo("build") + p.cargo("check") .with_status(101) .with_stderr( "\ @@ -290,22 +290,22 @@ fn transitive() { .file("src/lib.rs", "") .build(); - p.cargo("build") + p.cargo("check") .with_stderr( "\ [UPDATING] `dummy-registry` index [UPDATING] git repository `[..]` [DOWNLOADING] crates ... [DOWNLOADED] baz v0.2.0 (registry [..]) -[COMPILING] bar v0.1.0 (file://[..]) -[COMPILING] baz v0.2.0 -[COMPILING] foo v0.0.1 ([CWD]) +[CHECKING] bar v0.1.0 (file://[..]) +[CHECKING] baz v0.2.0 +[CHECKING] foo v0.0.1 ([CWD]) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", ) .run(); - p.cargo("build").with_stdout("").run(); + p.cargo("check").with_stdout("").run(); } #[cargo_test] @@ -342,19 +342,19 @@ fn persists_across_rebuilds() { ) .build(); - p.cargo("build") + p.cargo("check") .with_stderr( "\ [UPDATING] `dummy-registry` index [UPDATING] git repository `file://[..]` -[COMPILING] bar v0.1.0 (file://[..]) -[COMPILING] foo v0.0.1 ([CWD]) +[CHECKING] bar v0.1.0 (file://[..]) +[CHECKING] foo v0.0.1 ([CWD]) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", ) .run(); - p.cargo("build").with_stdout("").run(); + p.cargo("check").with_stdout("").run(); } #[cargo_test] @@ -389,12 +389,12 @@ fn replace_registry_with_path() { ) .build(); - p.cargo("build") + p.cargo("check") .with_stderr( "\ [UPDATING] `dummy-registry` index -[COMPILING] bar v0.1.0 ([ROOT][..]/bar) -[COMPILING] foo v0.0.1 ([CWD]) +[CHECKING] bar v0.1.0 ([ROOT][..]/bar) +[CHECKING] foo v0.0.1 ([CWD]) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", ) @@ -454,7 +454,7 @@ fn use_a_spec_to_select() { ) .build(); - p.cargo("build") + p.cargo("check") .with_stderr( "\ [UPDATING] `dummy-registry` index @@ -462,10 +462,10 @@ fn use_a_spec_to_select() { [DOWNLOADING] crates ... [DOWNLOADED] [..] [DOWNLOADED] [..] -[COMPILING] [..] -[COMPILING] [..] -[COMPILING] [..] -[COMPILING] foo v0.0.1 ([CWD]) +[CHECKING] [..] +[CHECKING] [..] +[CHECKING] [..] +[CHECKING] foo v0.0.1 ([CWD]) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", ) @@ -515,22 +515,22 @@ fn override_adds_some_deps() { .file("src/lib.rs", "") .build(); - p.cargo("build") + p.cargo("check") .with_stderr( "\ [UPDATING] `dummy-registry` index [UPDATING] git repository `[..]` [DOWNLOADING] crates ... [DOWNLOADED] baz v0.1.1 (registry [..]) -[COMPILING] baz v0.1.1 -[COMPILING] bar v0.1.0 ([..]) -[COMPILING] foo v0.0.1 ([CWD]) +[CHECKING] baz v0.1.1 +[CHECKING] bar v0.1.0 ([..]) +[CHECKING] foo v0.0.1 ([CWD]) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", ) .run(); - p.cargo("build").with_stdout("").run(); + p.cargo("check").with_stdout("").run(); Package::new("baz", "0.1.2").publish(); p.cargo("update -p") @@ -550,7 +550,7 @@ fn override_adds_some_deps() { ) .run(); - p.cargo("build").with_stdout("").run(); + p.cargo("check").with_stdout("").run(); } #[cargo_test] @@ -599,10 +599,10 @@ fn locked_means_locked_yes_no_seriously_i_mean_locked() { .file("src/lib.rs", "") .build(); - p.cargo("build").run(); + p.cargo("check").run(); - p.cargo("build").with_stdout("").run(); - p.cargo("build").with_stdout("").run(); + p.cargo("check").with_stdout("").run(); + p.cargo("check").with_stdout("").run(); } #[cargo_test] @@ -636,7 +636,7 @@ fn override_wrong_name() { .file("src/lib.rs", "") .build(); - p.cargo("build") + p.cargo("check") .with_status(101) .with_stderr( "\ @@ -683,7 +683,7 @@ fn override_with_nothing() { .file("src/lib.rs", "") .build(); - p.cargo("build") + p.cargo("check") .with_status(101) .with_stderr( "\ @@ -722,7 +722,7 @@ fn override_wrong_version() { .file("src/lib.rs", "") .build(); - p.cargo("build") + p.cargo("check") .with_status(101) .with_stderr( "\ @@ -769,7 +769,7 @@ fn multiple_specs() { .file("src/lib.rs", "") .build(); - p.cargo("build") + p.cargo("check") .with_status(101) .with_stderr( "\ @@ -919,7 +919,7 @@ fn no_override_self() { .file("src/lib.rs", "#![no_std] pub extern crate near;") .build(); - p.cargo("build --verbose").run(); + p.cargo("check --verbose").run(); } #[cargo_test] @@ -1029,7 +1029,7 @@ fn override_an_override() { .file("serde/src/lib.rs", "pub fn serde08_override() {}") .build(); - p.cargo("build -v").run(); + p.cargo("check -v").run(); } #[cargo_test] @@ -1078,8 +1078,8 @@ fn overriding_nonexistent_no_spurious() { .file("src/lib.rs", "") .build(); - p.cargo("build").run(); - p.cargo("build") + p.cargo("check").run(); + p.cargo("check") .with_stderr( "\ [WARNING] package replacement is not used: [..]baz@0.1.0 @@ -1127,24 +1127,24 @@ fn no_warnings_when_replace_is_used_in_another_workspace_member() { .file("local_bar/src/lib.rs", "") .build(); - p.cargo("build") + p.cargo("check") .cwd("first_crate") .with_stdout("") .with_stderr( "\ [UPDATING] `[..]` index -[COMPILING] bar v0.1.0 ([..]) -[COMPILING] first_crate v0.1.0 ([..]) +[CHECKING] bar v0.1.0 ([..]) +[CHECKING] first_crate v0.1.0 ([..]) [FINISHED] [..]", ) .run(); - p.cargo("build") + p.cargo("check") .cwd("second_crate") .with_stdout("") .with_stderr( "\ -[COMPILING] second_crate v0.1.0 ([..]) +[CHECKING] second_crate v0.1.0 ([..]) [FINISHED] [..]", ) .run(); @@ -1192,7 +1192,7 @@ fn replace_to_path_dep() { .file("bar/baz/src/lib.rs", "pub fn baz() {}") .build(); - p.cargo("build").run(); + p.cargo("check").run(); } #[cargo_test] @@ -1293,7 +1293,7 @@ fn override_plus_dep() { .file("bar/src/lib.rs", "") .build(); - p.cargo("build") + p.cargo("check") .with_status(101) .with_stderr_contains("error: cyclic package dependency: [..]") .run(); From bd8cc1129fc70ed75cc7ac7db160e2e5b9715fd9 Mon Sep 17 00:00:00 2001 From: Scott Schafer Date: Wed, 15 Feb 2023 20:55:40 -0600 Subject: [PATCH 57/62] chore: update `rust_version` tests to use check --- tests/testsuite/rust_version.rs | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/tests/testsuite/rust_version.rs b/tests/testsuite/rust_version.rs index fb16d997a89d..91711cf1ad98 100644 --- a/tests/testsuite/rust_version.rs +++ b/tests/testsuite/rust_version.rs @@ -20,8 +20,8 @@ fn rust_version_satisfied() { .file("src/main.rs", "fn main() {}") .build(); - p.cargo("build").run(); - p.cargo("build --ignore-rust-version").run(); + p.cargo("check").run(); + p.cargo("check --ignore-rust-version").run(); } #[cargo_test] @@ -41,7 +41,7 @@ fn rust_version_bad_caret() { ) .file("src/main.rs", "fn main() {}") .build() - .cargo("build") + .cargo("check") .with_status(101) .with_stderr( "error: failed to parse manifest at `[..]`\n\n\ @@ -67,7 +67,7 @@ fn rust_version_bad_pre_release() { ) .file("src/main.rs", "fn main() {}") .build() - .cargo("build") + .cargo("check") .with_status(101) .with_stderr( "error: failed to parse manifest at `[..]`\n\n\ @@ -93,7 +93,7 @@ fn rust_version_bad_nonsense() { ) .file("src/main.rs", "fn main() {}") .build() - .cargo("build") + .cargo("check") .with_status(101) .with_stderr( "error: failed to parse manifest at `[..]`\n\n\ @@ -120,14 +120,14 @@ fn rust_version_too_high() { .file("src/main.rs", "fn main() {}") .build(); - p.cargo("build") + p.cargo("check") .with_status(101) .with_stderr( "error: package `foo v0.0.1 ([..])` cannot be built because it requires \ rustc 1.9876.0 or newer, while the currently active rustc version is [..]\n\n", ) .run(); - p.cargo("build --ignore-rust-version").run(); + p.cargo("check --ignore-rust-version").run(); } #[cargo_test] @@ -152,7 +152,7 @@ fn rust_version_dependency_fails() { .file("src/main.rs", "fn main(){}") .build(); - p.cargo("build") + p.cargo("check") .with_status(101) .with_stderr( " Updating `[..]` index\n \ @@ -165,7 +165,7 @@ fn rust_version_dependency_fails() { where `ver` is the latest version of `bar` supporting rustc [..]", ) .run(); - p.cargo("build --ignore-rust-version").run(); + p.cargo("check --ignore-rust-version").run(); } #[cargo_test] @@ -186,7 +186,7 @@ fn rust_version_older_than_edition() { ) .file("src/main.rs", "fn main() {}") .build() - .cargo("build") + .cargo("check") .with_status(101) .with_stderr_contains(" rust-version 1.1 is older than first version (1.31.0) required by the specified edition (2018)", ) From 67027e34f3ed6f494888d61e009f6120d7ef26a3 Mon Sep 17 00:00:00 2001 From: Scott Schafer Date: Wed, 15 Feb 2023 21:00:59 -0600 Subject: [PATCH 58/62] chore: update `rustflags` tests to use check --- tests/testsuite/rustflags.rs | 138 +++++++++++++++++------------------ 1 file changed, 69 insertions(+), 69 deletions(-) diff --git a/tests/testsuite/rustflags.rs b/tests/testsuite/rustflags.rs index 7d0fd75db596..6677beb04407 100644 --- a/tests/testsuite/rustflags.rs +++ b/tests/testsuite/rustflags.rs @@ -24,17 +24,17 @@ fn env_rustflags_normal_source() { .build(); // Use RUSTFLAGS to pass an argument that will generate an error - p.cargo("build --lib") + p.cargo("check --lib") .env("RUSTFLAGS", "-Z bogus") .with_status(101) .with_stderr_contains("[..]bogus[..]") .run(); - p.cargo("build --bin=a") + p.cargo("check --bin=a") .env("RUSTFLAGS", "-Z bogus") .with_status(101) .with_stderr_contains("[..]bogus[..]") .run(); - p.cargo("build --example=b") + p.cargo("check --example=b") .env("RUSTFLAGS", "-Z bogus") .with_status(101) .with_stderr_contains("[..]bogus[..]") @@ -74,7 +74,7 @@ fn env_rustflags_build_script() { ) .build(); - p.cargo("build").env("RUSTFLAGS", "--cfg foo").run(); + p.cargo("check").env("RUSTFLAGS", "--cfg foo").run(); } #[cargo_test] @@ -111,7 +111,7 @@ fn env_rustflags_build_script_dep() { ) .build(); - foo.cargo("build").env("RUSTFLAGS", "--cfg foo").run(); + foo.cargo("check").env("RUSTFLAGS", "--cfg foo").run(); } #[cargo_test] @@ -142,7 +142,7 @@ fn env_rustflags_plugin() { ) .build(); - p.cargo("build").env("RUSTFLAGS", "--cfg foo").run(); + p.cargo("check").env("RUSTFLAGS", "--cfg foo").run(); } #[cargo_test] @@ -181,7 +181,7 @@ fn env_rustflags_plugin_dep() { ) .build(); - foo.cargo("build").env("RUSTFLAGS", "--cfg foo").run(); + foo.cargo("check").env("RUSTFLAGS", "--cfg foo").run(); } #[cargo_test] @@ -204,19 +204,19 @@ fn env_rustflags_normal_source_with_target() { let host = &rustc_host(); // Use RUSTFLAGS to pass an argument that will generate an error - p.cargo("build --lib --target") + p.cargo("check --lib --target") .arg(host) .env("RUSTFLAGS", "-Z bogus") .with_status(101) .with_stderr_contains("[..]bogus[..]") .run(); - p.cargo("build --bin=a --target") + p.cargo("check --bin=a --target") .arg(host) .env("RUSTFLAGS", "-Z bogus") .with_status(101) .with_stderr_contains("[..]bogus[..]") .run(); - p.cargo("build --example=b --target") + p.cargo("check --example=b --target") .arg(host) .env("RUSTFLAGS", "-Z bogus") .with_status(101) @@ -260,7 +260,7 @@ fn env_rustflags_build_script_with_target() { .build(); let host = rustc_host(); - p.cargo("build --target") + p.cargo("check --target") .arg(host) .env("RUSTFLAGS", "--cfg foo") .run(); @@ -296,7 +296,7 @@ fn env_rustflags_build_script_with_target_doesnt_apply_to_host_kind() { .build(); let host = rustc_host(); - p.cargo("build --target") + p.cargo("check --target") .masquerade_as_nightly_cargo(&["target-applies-to-host"]) .arg(host) .arg("-Ztarget-applies-to-host") @@ -339,7 +339,7 @@ fn env_rustflags_build_script_dep_with_target() { .build(); let host = rustc_host(); - foo.cargo("build --target") + foo.cargo("check --target") .arg(host) .env("RUSTFLAGS", "--cfg foo") .run(); @@ -374,7 +374,7 @@ fn env_rustflags_plugin_with_target() { .build(); let host = rustc_host(); - p.cargo("build --target") + p.cargo("check --target") .arg(host) .env("RUSTFLAGS", "--cfg foo") .run(); @@ -417,7 +417,7 @@ fn env_rustflags_plugin_dep_with_target() { .build(); let host = rustc_host(); - foo.cargo("build --target") + foo.cargo("check --target") .arg(host) .env("RUSTFLAGS", "--cfg foo") .run(); @@ -427,9 +427,9 @@ fn env_rustflags_plugin_dep_with_target() { fn env_rustflags_recompile() { let p = project().file("src/lib.rs", "").build(); - p.cargo("build").run(); + p.cargo("check").run(); // Setting RUSTFLAGS forces a recompile - p.cargo("build") + p.cargo("check") .env("RUSTFLAGS", "-Z bogus") .with_status(101) .with_stderr_contains("[..]bogus[..]") @@ -440,9 +440,9 @@ fn env_rustflags_recompile() { fn env_rustflags_recompile2() { let p = project().file("src/lib.rs", "").build(); - p.cargo("build").env("RUSTFLAGS", "--cfg foo").run(); + p.cargo("check").env("RUSTFLAGS", "--cfg foo").run(); // Setting RUSTFLAGS forces a recompile - p.cargo("build") + p.cargo("check") .env("RUSTFLAGS", "-Z bogus") .with_status(101) .with_stderr_contains("[..]bogus[..]") @@ -453,8 +453,8 @@ fn env_rustflags_recompile2() { fn env_rustflags_no_recompile() { let p = project().file("src/lib.rs", "").build(); - p.cargo("build").env("RUSTFLAGS", "--cfg foo").run(); - p.cargo("build") + p.cargo("check").env("RUSTFLAGS", "--cfg foo").run(); + p.cargo("check") .env("RUSTFLAGS", "--cfg foo") .with_stdout("") .run(); @@ -484,15 +484,15 @@ fn build_rustflags_normal_source() { ) .build(); - p.cargo("build --lib") + p.cargo("check --lib") .with_status(101) .with_stderr_contains("[..]bogus[..]") .run(); - p.cargo("build --bin=a") + p.cargo("check --bin=a") .with_status(101) .with_stderr_contains("[..]bogus[..]") .run(); - p.cargo("build --example=b") + p.cargo("check --example=b") .with_status(101) .with_stderr_contains("[..]bogus[..]") .run(); @@ -536,7 +536,7 @@ fn build_rustflags_build_script() { ) .build(); - p.cargo("build").run(); + p.cargo("check").run(); } #[cargo_test] @@ -580,7 +580,7 @@ fn build_rustflags_build_script_dep() { ) .build(); - foo.cargo("build").run(); + foo.cargo("check").run(); } #[cargo_test] @@ -618,7 +618,7 @@ fn build_rustflags_plugin() { ) .build(); - p.cargo("build").run(); + p.cargo("check").run(); } #[cargo_test] @@ -664,7 +664,7 @@ fn build_rustflags_plugin_dep() { ) .build(); - foo.cargo("build").run(); + foo.cargo("check").run(); } #[cargo_test] @@ -694,17 +694,17 @@ fn build_rustflags_normal_source_with_target() { let host = &rustc_host(); // Use build.rustflags to pass an argument that will generate an error - p.cargo("build --lib --target") + p.cargo("check --lib --target") .arg(host) .with_status(101) .with_stderr_contains("[..]bogus[..]") .run(); - p.cargo("build --bin=a --target") + p.cargo("check --bin=a --target") .arg(host) .with_status(101) .with_stderr_contains("[..]bogus[..]") .run(); - p.cargo("build --example=b --target") + p.cargo("check --example=b --target") .arg(host) .with_status(101) .with_stderr_contains("[..]bogus[..]") @@ -752,7 +752,7 @@ fn build_rustflags_build_script_with_target() { .build(); let host = rustc_host(); - p.cargo("build --target").arg(host).run(); + p.cargo("check --target").arg(host).run(); } #[cargo_test] @@ -797,7 +797,7 @@ fn build_rustflags_build_script_dep_with_target() { .build(); let host = rustc_host(); - foo.cargo("build --target").arg(host).run(); + foo.cargo("check --target").arg(host).run(); } #[cargo_test] @@ -836,7 +836,7 @@ fn build_rustflags_plugin_with_target() { .build(); let host = rustc_host(); - p.cargo("build --target").arg(host).run(); + p.cargo("check --target").arg(host).run(); } #[cargo_test] @@ -883,14 +883,14 @@ fn build_rustflags_plugin_dep_with_target() { .build(); let host = rustc_host(); - foo.cargo("build --target").arg(host).run(); + foo.cargo("check --target").arg(host).run(); } #[cargo_test] fn build_rustflags_recompile() { let p = project().file("src/lib.rs", "").build(); - p.cargo("build").run(); + p.cargo("check").run(); // Setting RUSTFLAGS forces a recompile let config = r#" @@ -901,7 +901,7 @@ fn build_rustflags_recompile() { fs::create_dir_all(config_file.parent().unwrap()).unwrap(); fs::write(config_file, config).unwrap(); - p.cargo("build") + p.cargo("check") .with_status(101) .with_stderr_contains("[..]bogus[..]") .run(); @@ -911,7 +911,7 @@ fn build_rustflags_recompile() { fn build_rustflags_recompile2() { let p = project().file("src/lib.rs", "").build(); - p.cargo("build").env("RUSTFLAGS", "--cfg foo").run(); + p.cargo("check").env("RUSTFLAGS", "--cfg foo").run(); // Setting RUSTFLAGS forces a recompile let config = r#" @@ -922,7 +922,7 @@ fn build_rustflags_recompile2() { fs::create_dir_all(config_file.parent().unwrap()).unwrap(); fs::write(config_file, config).unwrap(); - p.cargo("build") + p.cargo("check") .with_status(101) .with_stderr_contains("[..]bogus[..]") .run(); @@ -941,8 +941,8 @@ fn build_rustflags_no_recompile() { ) .build(); - p.cargo("build").env("RUSTFLAGS", "--cfg foo").run(); - p.cargo("build") + p.cargo("check").env("RUSTFLAGS", "--cfg foo").run(); + p.cargo("check") .env("RUSTFLAGS", "--cfg foo") .with_stdout("") .run(); @@ -967,7 +967,7 @@ fn build_rustflags_with_home_config() { // so the walking process finds the home project twice. let p = project_in_home("foo").file("src/lib.rs", "").build(); - p.cargo("build -v").run(); + p.cargo("check -v").run(); } #[cargo_test] @@ -997,15 +997,15 @@ fn target_rustflags_normal_source() { ) .build(); - p.cargo("build --lib") + p.cargo("check --lib") .with_status(101) .with_stderr_contains("[..]bogus[..]") .run(); - p.cargo("build --bin=a") + p.cargo("check --bin=a") .with_status(101) .with_stderr_contains("[..]bogus[..]") .run(); - p.cargo("build --example=b") + p.cargo("check --example=b") .with_status(101) .with_stderr_contains("[..]bogus[..]") .run(); @@ -1041,7 +1041,7 @@ fn target_rustflags_also_for_build_scripts() { ) .build(); - p.cargo("build").run(); + p.cargo("check").run(); } #[cargo_test] @@ -1067,10 +1067,10 @@ fn target_rustflags_not_for_build_scripts_with_target() { ) .build(); - p.cargo("build --target").arg(host).run(); + p.cargo("check --target").arg(host).run(); // Enabling -Ztarget-applies-to-host should not make a difference without the config setting - p.cargo("build --target") + p.cargo("check --target") .arg(host) .masquerade_as_nightly_cargo(&["target-applies-to-host"]) .arg("-Ztarget-applies-to-host") @@ -1090,7 +1090,7 @@ fn target_rustflags_not_for_build_scripts_with_target() { host ), ); - p.cargo("build --target") + p.cargo("check --target") .arg(host) .masquerade_as_nightly_cargo(&["target-applies-to-host"]) .arg("-Ztarget-applies-to-host") @@ -1118,21 +1118,21 @@ fn build_rustflags_for_build_scripts() { .build(); // With "legacy" behavior, build.rustflags should apply to build scripts without --target - p.cargo("build").run(); + p.cargo("check").run(); // But should _not_ apply _with_ --target - p.cargo("build --target") + p.cargo("check --target") .arg(host) .with_status(101) .with_stderr_contains("[..]assertion failed[..]") .run(); // Enabling -Ztarget-applies-to-host should not make a difference without the config setting - p.cargo("build") + p.cargo("check") .masquerade_as_nightly_cargo(&["target-applies-to-host"]) .arg("-Ztarget-applies-to-host") .run(); - p.cargo("build --target") + p.cargo("check --target") .arg(host) .masquerade_as_nightly_cargo(&["target-applies-to-host"]) .arg("-Ztarget-applies-to-host") @@ -1151,13 +1151,13 @@ fn build_rustflags_for_build_scripts() { rustflags = [\"--cfg=foo\"] ", ); - p.cargo("build") + p.cargo("check") .masquerade_as_nightly_cargo(&["target-applies-to-host"]) .arg("-Ztarget-applies-to-host") .with_status(101) .with_stderr_contains("[..]assertion failed[..]") .run(); - p.cargo("build --target") + p.cargo("check --target") .arg(host) .masquerade_as_nightly_cargo(&["target-applies-to-host"]) .arg("-Ztarget-applies-to-host") @@ -1192,7 +1192,7 @@ fn host_rustflags_for_build_scripts() { ) .build(); - p.cargo("build --target") + p.cargo("check --target") .arg(host) .masquerade_as_nightly_cargo(&["target-applies-to-host", "host-config"]) .arg("-Ztarget-applies-to-host") @@ -1223,15 +1223,15 @@ fn target_rustflags_precedence() { ) .build(); - p.cargo("build --lib") + p.cargo("check --lib") .with_status(101) .with_stderr_contains("[..]bogus[..]") .run(); - p.cargo("build --bin=a") + p.cargo("check --bin=a") .with_status(101) .with_stderr_contains("[..]bogus[..]") .run(); - p.cargo("build --example=b") + p.cargo("check --example=b") .with_status(101) .with_stderr_contains("[..]bogus[..]") .run(); @@ -1428,10 +1428,10 @@ fn target_rustflags_string_and_array_form1() { ) .build(); - p1.cargo("build -v") + p1.cargo("check -v") .with_stderr( "\ -[COMPILING] foo v0.0.1 ([..]) +[CHECKING] foo v0.0.1 ([..]) [RUNNING] `rustc [..] --cfg foo[..]` [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", @@ -1449,10 +1449,10 @@ fn target_rustflags_string_and_array_form1() { ) .build(); - p2.cargo("build -v") + p2.cargo("check -v") .with_stderr( "\ -[COMPILING] foo v0.0.1 ([..]) +[CHECKING] foo v0.0.1 ([..]) [RUNNING] `rustc [..] --cfg foo[..]` [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", @@ -1476,10 +1476,10 @@ fn target_rustflags_string_and_array_form2() { .file("src/lib.rs", "") .build(); - p1.cargo("build -v") + p1.cargo("check -v") .with_stderr( "\ -[COMPILING] foo v0.0.1 ([..]) +[CHECKING] foo v0.0.1 ([..]) [RUNNING] `rustc [..] --cfg foo[..]` [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", @@ -1500,10 +1500,10 @@ fn target_rustflags_string_and_array_form2() { .file("src/lib.rs", "") .build(); - p2.cargo("build -v") + p2.cargo("check -v") .with_stderr( "\ -[COMPILING] foo v0.0.1 ([..]) +[CHECKING] foo v0.0.1 ([..]) [RUNNING] `rustc [..] --cfg foo[..]` [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", @@ -1575,7 +1575,7 @@ fn env_rustflags_misspelled_build_script() { .file("build.rs", "fn main() { }") .build(); - p.cargo("build") + p.cargo("check") .env("RUST_FLAGS", "foo") .with_stderr_contains("[WARNING] Cargo does not read `RUST_FLAGS` environment variable. Did you mean `RUSTFLAGS`?") .run(); @@ -1662,7 +1662,7 @@ fn host_config_rustflags_with_target() { .file(".cargo/config.toml", "target-applies-to-host = false") .build(); - p.cargo("build") + p.cargo("check") .masquerade_as_nightly_cargo(&["target-applies-to-host", "host-config"]) .arg("-Zhost-config") .arg("-Ztarget-applies-to-host") From e4892f451522f64da2435bbaf50e5021ad52da7b Mon Sep 17 00:00:00 2001 From: Scott Schafer Date: Wed, 15 Feb 2023 21:04:56 -0600 Subject: [PATCH 59/62] chore: update `tool_paths` tests to use check --- tests/testsuite/tool_paths.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/testsuite/tool_paths.rs b/tests/testsuite/tool_paths.rs index a211b5328375..334b34204298 100644 --- a/tests/testsuite/tool_paths.rs +++ b/tests/testsuite/tool_paths.rs @@ -21,10 +21,10 @@ fn pathless_tools() { ) .build(); - foo.cargo("build --verbose") + foo.cargo("check --verbose") .with_stderr( "\ -[COMPILING] foo v0.5.0 ([CWD]) +[CHECKING] foo v0.5.0 ([CWD]) [RUNNING] `rustc [..] -C linker=nonexistent-linker [..]` [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", @@ -59,10 +59,10 @@ fn absolute_tools() { ) .build(); - foo.cargo("build --verbose") + foo.cargo("check --verbose") .with_stderr( "\ -[COMPILING] foo v0.5.0 ([CWD]) +[CHECKING] foo v0.5.0 ([CWD]) [RUNNING] `rustc [..] -C linker=[..]bogus/nonexistent-linker [..]` [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", @@ -102,11 +102,11 @@ fn relative_tools() { let prefix = p.root().into_os_string().into_string().unwrap(); - p.cargo("build --verbose") + p.cargo("check --verbose") .cwd("bar") .with_stderr(&format!( "\ -[COMPILING] bar v0.5.0 ([CWD]) +[CHECKING] bar v0.5.0 ([CWD]) [RUNNING] `rustc [..] -C linker={prefix}/./tools/nonexistent-linker [..]` [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", @@ -350,7 +350,7 @@ fn target_in_environment_contains_lower_case() { target.to_lowercase().replace('-', "_") ); - p.cargo("build -v --target") + p.cargo("check -v --target") .arg(target) .env(&env_key, "nonexistent-linker") .with_stderr_contains(format!( From ccbb232bdd90fdc21db9e767f4550971d4289fe2 Mon Sep 17 00:00:00 2001 From: Scott Schafer Date: Wed, 15 Feb 2023 21:06:24 -0600 Subject: [PATCH 60/62] chore: update `update` tests to use check --- tests/testsuite/update.rs | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/tests/testsuite/update.rs b/tests/testsuite/update.rs index 1eef64ea3d47..a2105ba3efe7 100644 --- a/tests/testsuite/update.rs +++ b/tests/testsuite/update.rs @@ -36,7 +36,7 @@ fn minor_update_two_places() { .file("foo/src/lib.rs", "") .build(); - p.cargo("build").run(); + p.cargo("check").run(); Package::new("log", "0.1.1").publish(); p.change_file( @@ -52,7 +52,7 @@ fn minor_update_two_places() { "#, ); - p.cargo("build").run(); + p.cargo("check").run(); } #[cargo_test] @@ -91,7 +91,7 @@ fn transitive_minor_update() { .file("foo/src/lib.rs", "") .build(); - p.cargo("build").run(); + p.cargo("check").run(); Package::new("log", "0.1.1").publish(); Package::new("serde", "0.1.1").dep("log", "0.1.1").publish(); @@ -150,7 +150,7 @@ fn conservative() { .file("foo/src/lib.rs", "") .build(); - p.cargo("build").run(); + p.cargo("check").run(); Package::new("log", "0.1.1").publish(); Package::new("serde", "0.1.1").dep("log", "0.1").publish(); @@ -198,11 +198,11 @@ fn update_via_new_dep() { .file("foo/src/lib.rs", "") .build(); - p.cargo("build").run(); + p.cargo("check").run(); Package::new("log", "0.1.1").publish(); p.uncomment_root_manifest(); - p.cargo("build").env("CARGO_LOG", "cargo=trace").run(); + p.cargo("check").env("CARGO_LOG", "cargo=trace").run(); } #[cargo_test] @@ -240,11 +240,11 @@ fn update_via_new_member() { .file("foo/src/lib.rs", "") .build(); - p.cargo("build").run(); + p.cargo("check").run(); Package::new("log", "0.1.1").publish(); p.uncomment_root_manifest(); - p.cargo("build").run(); + p.cargo("check").run(); } #[cargo_test] @@ -267,13 +267,13 @@ fn add_dep_deep_new_requirement() { .file("src/lib.rs", "") .build(); - p.cargo("build").run(); + p.cargo("check").run(); Package::new("log", "0.1.1").publish(); Package::new("bar", "0.1.0").dep("log", "0.1.1").publish(); p.uncomment_root_manifest(); - p.cargo("build").run(); + p.cargo("check").run(); } #[cargo_test] @@ -297,13 +297,13 @@ fn everything_real_deep() { .file("src/lib.rs", "") .build(); - p.cargo("build").run(); + p.cargo("check").run(); Package::new("log", "0.1.1").publish(); Package::new("bar", "0.1.0").dep("log", "0.1.1").publish(); p.uncomment_root_manifest(); - p.cargo("build").run(); + p.cargo("check").run(); } #[cargo_test] @@ -339,7 +339,7 @@ fn change_package_version() { ) .build(); - p.cargo("build").run(); + p.cargo("check").run(); } #[cargo_test] @@ -377,7 +377,7 @@ fn update_precise() { .file("foo/src/lib.rs", "") .build(); - p.cargo("build").run(); + p.cargo("check").run(); Package::new("serde", "0.2.0").publish(); @@ -412,7 +412,7 @@ fn update_precise_do_not_force_update_deps() { .file("src/lib.rs", "") .build(); - p.cargo("build").run(); + p.cargo("check").run(); Package::new("log", "0.1.1").publish(); Package::new("serde", "0.2.2").dep("log", "0.1").publish(); @@ -448,7 +448,7 @@ fn update_aggressive() { .file("src/lib.rs", "") .build(); - p.cargo("build").run(); + p.cargo("check").run(); Package::new("log", "0.1.1").publish(); Package::new("serde", "0.2.2").dep("log", "0.1").publish(); @@ -709,7 +709,7 @@ fn dry_run_update() { .file("foo/src/lib.rs", "") .build(); - p.cargo("build").run(); + p.cargo("check").run(); let old_lockfile = p.read_lockfile(); Package::new("log", "0.1.1").publish(); From 7a04b8f7ffbde98d53b44a2d7e6e543030676fec Mon Sep 17 00:00:00 2001 From: Scott Schafer Date: Wed, 15 Feb 2023 21:07:01 -0600 Subject: [PATCH 61/62] chore: update `vendor` tests to use check --- tests/testsuite/vendor.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/testsuite/vendor.rs b/tests/testsuite/vendor.rs index 9392b29737b5..2b179fe2306a 100644 --- a/tests/testsuite/vendor.rs +++ b/tests/testsuite/vendor.rs @@ -34,7 +34,7 @@ fn vendor_simple() { assert!(lock.contains("version = \"0.3.5\"")); add_vendor_config(&p); - p.cargo("build").run(); + p.cargo("check").run(); } #[cargo_test] @@ -247,7 +247,7 @@ fn two_versions() { assert!(lock.contains("version = \"0.7.0\"")); add_vendor_config(&p); - p.cargo("build").run(); + p.cargo("check").run(); } #[cargo_test] @@ -292,7 +292,7 @@ fn two_explicit_versions() { assert!(lock.contains("version = \"0.7.0\"")); add_vendor_config(&p); - p.cargo("build").run(); + p.cargo("check").run(); } #[cargo_test] @@ -385,8 +385,8 @@ fn two_lockfiles() { assert!(lock.contains("version = \"0.7.0\"")); add_vendor_config(&p); - p.cargo("build").cwd("foo").run(); - p.cargo("build").cwd("bar").run(); + p.cargo("check").cwd("foo").run(); + p.cargo("check").cwd("bar").run(); } #[cargo_test] @@ -642,7 +642,7 @@ fn vendoring_git_crates() { p.read_file("vendor/serde_derive/src/wut.rs"); add_vendor_config(&p); - p.cargo("build").run(); + p.cargo("check").run(); } #[cargo_test] From b152e10fcd715db791f876043b356284f66a02d5 Mon Sep 17 00:00:00 2001 From: Scott Schafer Date: Wed, 15 Feb 2023 21:14:51 -0600 Subject: [PATCH 62/62] chore: update `workspaces` tests to use check --- tests/testsuite/workspaces.rs | 128 +++++++++++++++++----------------- 1 file changed, 64 insertions(+), 64 deletions(-) diff --git a/tests/testsuite/workspaces.rs b/tests/testsuite/workspaces.rs index c4099ceed504..c6698f76a7aa 100644 --- a/tests/testsuite/workspaces.rs +++ b/tests/testsuite/workspaces.rs @@ -104,16 +104,16 @@ fn non_virtual_default_members_build_other_member() { .file("baz/src/lib.rs", "pub fn baz() {}") .build(); - p.cargo("build") + p.cargo("check") .with_stderr( - "[..] Compiling baz v0.1.0 ([..])\n\ + "[CHECKING] baz v0.1.0 ([..])\n\ [..] Finished dev [unoptimized + debuginfo] target(s) in [..]\n", ) .run(); - p.cargo("build --manifest-path bar/Cargo.toml") + p.cargo("check --manifest-path bar/Cargo.toml") .with_stderr( - "[..] Compiling bar v0.1.0 ([..])\n\ + "[CHECKING] bar v0.1.0 ([..])\n\ [..] Finished dev [unoptimized + debuginfo] target(s) in [..]\n", ) .run(); @@ -140,9 +140,9 @@ fn non_virtual_default_members_build_root_project() { .file("bar/src/lib.rs", "pub fn bar() {}") .build(); - p.cargo("build") + p.cargo("check") .with_stderr( - "[..] Compiling foo v0.1.0 ([..])\n\ + "[CHECKING] foo v0.1.0 ([..])\n\ [..] Finished dev [unoptimized + debuginfo] target(s) in [..]\n", ) .run(); @@ -339,7 +339,7 @@ fn same_names_in_workspace() { .file("bar/src/main.rs", "fn main() {}"); let p = p.build(); - p.cargo("build") + p.cargo("check") .with_status(101) .with_stderr( "\ @@ -370,7 +370,7 @@ fn parent_doesnt_point_to_child() { .file("bar/src/main.rs", "fn main() {}"); let p = p.build(); - p.cargo("build") + p.cargo("check") .cwd("bar") .with_status(101) .with_stderr( @@ -402,7 +402,7 @@ fn invalid_parent_pointer() { .file("src/main.rs", "fn main() {}"); let p = p.build(); - p.cargo("build") + p.cargo("check") .with_status(101) .with_stderr( "\ @@ -433,7 +433,7 @@ fn invalid_members() { .file("src/main.rs", "fn main() {}"); let p = p.build(); - p.cargo("build") + p.cargo("check") .with_status(101) .with_stderr( "\ @@ -466,7 +466,7 @@ fn bare_workspace_ok() { .file("src/main.rs", "fn main() {}"); let p = p.build(); - p.cargo("build").run(); + p.cargo("check").run(); } #[cargo_test] @@ -500,7 +500,7 @@ fn two_roots() { .file("bar/src/main.rs", "fn main() {}"); let p = p.build(); - p.cargo("build") + p.cargo("check") .with_status(101) .with_stderr( "\ @@ -530,7 +530,7 @@ fn workspace_isnt_root() { .file("bar/src/main.rs", "fn main() {}"); let p = p.build(); - p.cargo("build") + p.cargo("check") .with_status(101) .with_stderr("error: root of a workspace inferred but wasn't a root: [..]") .run(); @@ -576,7 +576,7 @@ fn dangling_member() { .file("baz/src/main.rs", "fn main() {}"); let p = p.build(); - p.cargo("build") + p.cargo("check") .with_status(101) .with_stderr( "\ @@ -615,7 +615,7 @@ fn cycle() { .file("bar/src/main.rs", "fn main() {}"); let p = p.build(); - p.cargo("build") + p.cargo("check") .with_status(101) .with_stderr( "[ERROR] root of a workspace inferred but wasn't a root: [..]/foo/bar/Cargo.toml", @@ -660,14 +660,14 @@ fn share_dependencies() { Package::new("dep1", "0.1.3").publish(); Package::new("dep1", "0.1.8").publish(); - p.cargo("build") + p.cargo("check") .with_stderr( "\ [UPDATING] `[..]` index [DOWNLOADING] crates ... [DOWNLOADED] dep1 v0.1.3 ([..]) -[COMPILING] dep1 v0.1.3 -[COMPILING] foo v0.1.0 ([..]) +[CHECKING] dep1 v0.1.3 +[CHECKING] foo v0.1.0 ([..]) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", ) @@ -762,26 +762,26 @@ fn lock_works_for_everyone() { Package::new("dep1", "0.1.1").publish(); Package::new("dep2", "0.1.1").publish(); - p.cargo("build") + p.cargo("check") .with_stderr( "\ [DOWNLOADING] crates ... [DOWNLOADED] dep2 v0.1.0 ([..]) -[COMPILING] dep2 v0.1.0 -[COMPILING] foo v0.1.0 ([..]) +[CHECKING] dep2 v0.1.0 +[CHECKING] foo v0.1.0 ([..]) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", ) .run(); - p.cargo("build") + p.cargo("check") .cwd("bar") .with_stderr( "\ [DOWNLOADING] crates ... [DOWNLOADED] dep1 v0.1.0 ([..]) -[COMPILING] dep1 v0.1.0 -[COMPILING] bar v0.1.0 ([..]) +[CHECKING] dep1 v0.1.0 +[CHECKING] bar v0.1.0 ([..]) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..] ", ) @@ -838,7 +838,7 @@ fn virtual_misconfigure() { .file("bar/Cargo.toml", &basic_manifest("bar", "0.1.0")) .file("bar/src/main.rs", "fn main() {}"); let p = p.build(); - p.cargo("build") + p.cargo("check") .cwd("bar") .with_status(101) .with_stderr( @@ -868,7 +868,7 @@ fn virtual_build_all_implied() { .file("bar/Cargo.toml", &basic_manifest("bar", "0.1.0")) .file("bar/src/main.rs", "fn main() {}"); let p = p.build(); - p.cargo("build").run(); + p.cargo("check").run(); } #[cargo_test] @@ -906,7 +906,7 @@ fn virtual_default_member_is_not_a_member() { .file("bar/Cargo.toml", &basic_manifest("bar", "0.1.0")) .file("bar/src/main.rs", "fn main() {}"); let p = p.build(); - p.cargo("build") + p.cargo("check") .with_status(101) .with_stderr( "\ @@ -934,9 +934,9 @@ fn virtual_default_members_build_other_member() { .file("baz/src/lib.rs", "pub fn baz() {}") .build(); - p.cargo("build --manifest-path bar/Cargo.toml") + p.cargo("check --manifest-path bar/Cargo.toml") .with_stderr( - "[..] Compiling bar v0.1.0 ([..])\n\ + "[CHECKING] bar v0.1.0 ([..])\n\ [..] Finished dev [unoptimized + debuginfo] target(s) in [..]\n", ) .run(); @@ -951,7 +951,7 @@ fn virtual_build_no_members() { "#, ); let p = p.build(); - p.cargo("build") + p.cargo("check") .with_status(101) .with_stderr( "\ @@ -984,7 +984,7 @@ fn include_virtual() { "#, ); let p = p.build(); - p.cargo("build") + p.cargo("check") .with_status(101) .with_stderr( "\ @@ -1034,10 +1034,10 @@ fn members_include_path_deps() { .file("p3/src/lib.rs", ""); let p = p.build(); - p.cargo("build").cwd("p1").run(); - p.cargo("build").cwd("p2").run(); - p.cargo("build").cwd("p3").run(); - p.cargo("build").run(); + p.cargo("check").cwd("p1").run(); + p.cargo("check").cwd("p2").run(); + p.cargo("check").cwd("p3").run(); + p.cargo("check").run(); assert!(p.root().join("target").is_dir()); assert!(!p.root().join("p1/target").is_dir()); @@ -1142,11 +1142,11 @@ fn lock_doesnt_change_depending_on_crate() { Package::new("foo", "1.0.0").publish(); Package::new("bar", "1.0.0").publish(); - p.cargo("build").run(); + p.cargo("check").run(); let lockfile = p.read_lockfile(); - p.cargo("build").cwd("baz").run(); + p.cargo("check").cwd("baz").run(); let lockfile2 = p.read_lockfile(); @@ -1245,7 +1245,7 @@ fn workspace_in_git() { ); let p = p.build(); - p.cargo("build").run(); + p.cargo("check").run(); } #[cargo_test] @@ -1275,7 +1275,7 @@ fn lockfile_can_specify_nonexistent_members() { let p = p.build(); - p.cargo("build").cwd("a").run(); + p.cargo("check").cwd("a").run(); } #[cargo_test] @@ -1356,7 +1356,7 @@ fn error_if_parent_cargo_toml_is_invalid() { .file("bar/src/main.rs", "fn main() {}"); let p = p.build(); - p.cargo("build") + p.cargo("check") .cwd("bar") .with_status(101) .with_stderr_contains("[ERROR] failed to parse manifest at `[..]`") @@ -1392,8 +1392,8 @@ fn relative_path_for_member_works() { .file("bar/src/main.rs", "fn main() {}"); let p = p.build(); - p.cargo("build").cwd("foo").run(); - p.cargo("build").cwd("bar").run(); + p.cargo("check").cwd("foo").run(); + p.cargo("check").cwd("bar").run(); } #[cargo_test] @@ -1418,9 +1418,9 @@ fn relative_path_for_root_works() { .file("subproj/src/main.rs", "fn main() {}"); let p = p.build(); - p.cargo("build --manifest-path ./Cargo.toml").run(); + p.cargo("check --manifest-path ./Cargo.toml").run(); - p.cargo("build --manifest-path ../Cargo.toml") + p.cargo("check --manifest-path ../Cargo.toml") .cwd("subproj") .run(); } @@ -1448,7 +1448,7 @@ fn path_dep_outside_workspace_is_not_member() { .file("foo/src/lib.rs", ""); let p = p.build(); - p.cargo("build").cwd("ws").run(); + p.cargo("check").cwd("ws").run(); } #[cargo_test] @@ -1500,7 +1500,7 @@ fn test_in_and_out_of_workspace() { .file("bar/src/lib.rs", "pub fn f() { }"); let p = p.build(); - p.cargo("build").cwd("ws").run(); + p.cargo("check").cwd("ws").run(); assert!(p.root().join("ws/Cargo.lock").is_file()); assert!(p.root().join("ws/target").is_dir()); @@ -1509,7 +1509,7 @@ fn test_in_and_out_of_workspace() { assert!(!p.root().join("bar/Cargo.lock").is_file()); assert!(!p.root().join("bar/target").is_dir()); - p.cargo("build").cwd("foo").run(); + p.cargo("check").cwd("foo").run(); assert!(p.root().join("foo/Cargo.lock").is_file()); assert!(p.root().join("foo/target").is_dir()); assert!(!p.root().join("bar/Cargo.lock").is_file()); @@ -1555,12 +1555,12 @@ fn test_path_dependency_under_member() { .file("foo/bar/src/lib.rs", "pub fn f() { }"); let p = p.build(); - p.cargo("build").cwd("ws").run(); + p.cargo("check").cwd("ws").run(); assert!(!p.root().join("foo/bar/Cargo.lock").is_file()); assert!(!p.root().join("foo/bar/target").is_dir()); - p.cargo("build").cwd("foo/bar").run(); + p.cargo("check").cwd("foo/bar").run(); assert!(!p.root().join("foo/bar/Cargo.lock").is_file()); assert!(!p.root().join("foo/bar/target").is_dir()); @@ -1586,9 +1586,9 @@ fn excluded_simple() { .file("foo/src/lib.rs", ""); let p = p.build(); - p.cargo("build").run(); + p.cargo("check").run(); assert!(p.root().join("target").is_dir()); - p.cargo("build").cwd("foo").run(); + p.cargo("check").cwd("foo").run(); assert!(p.root().join("foo/target").is_dir()); } @@ -1615,11 +1615,11 @@ fn exclude_members_preferred() { .file("foo/bar/src/lib.rs", ""); let p = p.build(); - p.cargo("build").run(); + p.cargo("check").run(); assert!(p.root().join("target").is_dir()); - p.cargo("build").cwd("foo").run(); + p.cargo("check").cwd("foo").run(); assert!(p.root().join("foo/target").is_dir()); - p.cargo("build").cwd("foo/bar").run(); + p.cargo("check").cwd("foo/bar").run(); assert!(!p.root().join("foo/bar/target").is_dir()); } @@ -1648,11 +1648,11 @@ fn exclude_but_also_depend() { .file("foo/bar/src/lib.rs", ""); let p = p.build(); - p.cargo("build").run(); + p.cargo("check").run(); assert!(p.root().join("target").is_dir()); - p.cargo("build").cwd("foo").run(); + p.cargo("check").cwd("foo").run(); assert!(p.root().join("foo/target").is_dir()); - p.cargo("build").cwd("foo/bar").run(); + p.cargo("check").cwd("foo/bar").run(); assert!(p.root().join("foo/bar/target").is_dir()); } @@ -1672,7 +1672,7 @@ fn excluded_default_members_still_must_be_members() { .file("foo/src/lib.rs", "") .file("bar/something.txt", ""); let p = p.build(); - p.cargo("build") + p.cargo("check") .with_status(101) .with_stderr( "\ @@ -1901,7 +1901,7 @@ fn glob_syntax_invalid_members() { .file("crates/bar/src/main.rs", "fn main() {}"); let p = p.build(); - p.cargo("build") + p.cargo("check") .with_status(101) .with_stderr( "\ @@ -2073,7 +2073,7 @@ fn dont_recurse_out_of_cargo_home() { .file("src/lib.rs", ""); let p = p.build(); - p.cargo("build") + p.cargo("check") .env("CARGO_HOME", p.root().join(".cargo")) .run(); } @@ -2121,8 +2121,8 @@ fn cargo_home_at_root_works() { .file("a/src/lib.rs", ""); let p = p.build(); - p.cargo("build").run(); - p.cargo("build --frozen").env("CARGO_HOME", p.root()).run(); + p.cargo("check").run(); + p.cargo("check --frozen").env("CARGO_HOME", p.root()).run(); } #[cargo_test] @@ -2335,7 +2335,7 @@ fn invalid_missing() { .file("src/lib.rs", "") .build(); - p.cargo("build -q") + p.cargo("check -q") .with_status(101) .with_stderr( "\ @@ -2387,7 +2387,7 @@ fn member_dep_missing() { .file("bar/src/main.rs", "fn main() {}") .build(); - p.cargo("build -q") + p.cargo("check -q") .with_status(101) .with_stderr( "\