diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-30 03:59:35 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-30 03:59:35 +0000 |
commit | d1b2d29528b7794b41e66fc2136e395a02f8529b (patch) | |
tree | a4a17504b260206dec3cf55b2dca82929a348ac2 /src/tools/cargo/tests | |
parent | Releasing progress-linux version 1.72.1+dfsg1-1~progress7.99u1. (diff) | |
download | rustc-d1b2d29528b7794b41e66fc2136e395a02f8529b.tar.xz rustc-d1b2d29528b7794b41e66fc2136e395a02f8529b.zip |
Merging upstream version 1.73.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/tools/cargo/tests')
440 files changed, 3420 insertions, 538 deletions
diff --git a/src/tools/cargo/tests/testsuite/alt_registry.rs b/src/tools/cargo/tests/testsuite/alt_registry.rs index ac60ca92f..91157cd53 100644 --- a/src/tools/cargo/tests/testsuite/alt_registry.rs +++ b/src/tools/cargo/tests/testsuite/alt_registry.rs @@ -1506,3 +1506,44 @@ fn publish_with_transitive_dep() { .build(); p2.cargo("publish").run(); } + +#[cargo_test] +fn warn_for_unused_fields() { + let _ = RegistryBuilder::new() + .no_configure_token() + .alternative() + .build(); + let p = project() + .file("src/lib.rs", "") + .file( + ".cargo/config.toml", + "[registry] + unexpected-field = 'foo' + [registries.alternative] + unexpected-field = 'foo' + ", + ) + .build(); + + p.cargo("publish --registry alternative") + .with_status(101) + .with_stderr( + "\ +[UPDATING] `alternative` index +[WARNING] unused config key `registries.alternative.unexpected-field` in `[..]config.toml` +[ERROR] no token found for `alternative`, please run `cargo login --registry alternative` +or use environment variable CARGO_REGISTRIES_ALTERNATIVE_TOKEN", + ) + .run(); + + p.cargo("publish --registry crates-io") + .with_status(101) + .with_stderr( + "\ +[UPDATING] crates.io index +[WARNING] unused config key `registry.unexpected-field` in `[..]config.toml` +[ERROR] no token found, please run `cargo login` +or use environment variable CARGO_REGISTRY_TOKEN", + ) + .run(); +} diff --git a/src/tools/cargo/tests/testsuite/bench.rs b/src/tools/cargo/tests/testsuite/bench.rs index 581acbe15..d773308c6 100644 --- a/src/tools/cargo/tests/testsuite/bench.rs +++ b/src/tools/cargo/tests/testsuite/bench.rs @@ -314,9 +314,9 @@ fn cargo_bench_failing_test() { [RUNNING] [..] (target/release/deps/foo-[..][EXE])", ) .with_stdout_contains("[..]thread '[..]' panicked at[..]") - .with_stdout_contains("[..]assertion failed[..]") - .with_stdout_contains("[..]left: `\"hello\"`[..]") - .with_stdout_contains("[..]right: `\"nope\"`[..]") + .with_stdout_contains("[..]assertion [..]failed[..]") + .with_stdout_contains("[..]left: [..]\"hello\"[..]") + .with_stdout_contains("[..]right: [..]\"nope\"[..]") .with_stdout_contains("[..]src/main.rs:15[..]") .with_status(101) .run(); @@ -1670,3 +1670,58 @@ fn json_artifact_includes_executable_for_benchmark() { ) .run(); } + +#[cargo_test] +fn cargo_bench_no_keep_going() { + let p = project() + .file("Cargo.toml", &basic_bin_manifest("foo")) + .file("src/main.rs", "") + .build(); + + p.cargo("bench --keep-going") + .with_stderr( + "\ +error: unexpected argument `--keep-going` found + + tip: to run as many benchmarks as possible without failing fast, use `--no-fail-fast`", + ) + .with_status(101) + .run(); +} + +#[cargo_test(nightly, reason = "bench")] +fn cargo_bench_print_env_verbose() { + let p = project() + .file("Cargo.toml", &basic_manifest("foo", "0.0.1")) + .file( + "src/main.rs", + r#" + #![feature(test)] + #[cfg(test)] + extern crate test; + + fn hello() -> &'static str { + "hello" + } + + pub fn main() { + println!("{}", hello()) + } + + #[bench] + fn bench_hello(_b: &mut test::Bencher) { + assert_eq!(hello(), "hello") + } + "#, + ) + .build(); + p.cargo("bench -vv") + .with_stderr( + "\ +[COMPILING] foo v0.0.1 ([CWD]) +[RUNNING] `[..]CARGO_MANIFEST_DIR=[CWD][..] rustc[..]` +[FINISHED] bench [optimized] target(s) in [..] +[RUNNING] `[..]CARGO_MANIFEST_DIR=[CWD][..] [CWD]/target/release/deps/foo-[..][EXE] --bench`", + ) + .run(); +} diff --git a/src/tools/cargo/tests/testsuite/build_script.rs b/src/tools/cargo/tests/testsuite/build_script.rs index 4840356c6..400d10547 100644 --- a/src/tools/cargo/tests/testsuite/build_script.rs +++ b/src/tools/cargo/tests/testsuite/build_script.rs @@ -5141,6 +5141,35 @@ for more information about build script outputs. } #[cargo_test] +fn wrong_syntax_with_two_colons() { + let p = project() + .file("src/lib.rs", "") + .file( + "build.rs", + r#" + fn main() { + println!("cargo::foo=bar"); + } + "#, + ) + .build(); + + p.cargo("build") + .with_status(101) + .with_stderr( + "\ +[COMPILING] foo [..] +error: unsupported output in build script of `foo v0.0.1 ([ROOT]/foo)`: `cargo::foo=bar` +Found a `cargo::key=value` build directive which is reserved for future use. +Either change the directive to `cargo:key=value` syntax (note the single `:`) or upgrade your version of Rust. +See https://doc.rust-lang.org/cargo/reference/build-scripts.html#outputs-of-the-build-script \ +for more information about build script outputs. +", + ) + .run(); +} + +#[cargo_test] fn custom_build_closes_stdin() { // Ensure stdin is closed to prevent deadlock. // See https://github.com/rust-lang/cargo/issues/11196 diff --git a/src/tools/cargo/tests/testsuite/build_script_env.rs b/src/tools/cargo/tests/testsuite/build_script_env.rs index bc87b7120..df574600c 100644 --- a/src/tools/cargo/tests/testsuite/build_script_env.rs +++ b/src/tools/cargo/tests/testsuite/build_script_env.rs @@ -117,7 +117,10 @@ fn rustc_bootstrap() { "#; let p = project() .file("Cargo.toml", &basic_manifest("has-dashes", "0.0.1")) - .file("src/lib.rs", "#![feature(rustc_attrs)]") + .file( + "src/lib.rs", + "#![allow(internal_features)] #![feature(rustc_attrs)]", + ) .file("build.rs", build_rs) .build(); // RUSTC_BOOTSTRAP unset on stable should error @@ -154,7 +157,10 @@ fn rustc_bootstrap() { // Tests for binaries instead of libraries let p = project() .file("Cargo.toml", &basic_manifest("foo", "0.0.1")) - .file("src/main.rs", "#![feature(rustc_attrs)] fn main() {}") + .file( + "src/main.rs", + "#![allow(internal_features)] #![feature(rustc_attrs)] fn main() {}", + ) .file("build.rs", build_rs) .build(); // nightly should warn when there's no library whether or not RUSTC_BOOTSTRAP is set diff --git a/src/tools/cargo/tests/testsuite/cargo/help/mod.rs b/src/tools/cargo/tests/testsuite/cargo/help/mod.rs new file mode 100644 index 000000000..559377b27 --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo/help/mod.rs @@ -0,0 +1,12 @@ +use cargo_test_support::curr_dir; +use cargo_test_support::prelude::*; + +#[cargo_test] +fn case() { + snapbox::cmd::Command::cargo_ui() + .arg("--help") + .assert() + .success() + .stdout_matches_path(curr_dir!().join("stdout.log")) + .stderr_matches_path(curr_dir!().join("stderr.log")); +} diff --git a/src/tools/cargo/tests/testsuite/init/auto_git/stdout.log b/src/tools/cargo/tests/testsuite/cargo/help/stderr.log index e69de29bb..e69de29bb 100644 --- a/src/tools/cargo/tests/testsuite/init/auto_git/stdout.log +++ b/src/tools/cargo/tests/testsuite/cargo/help/stderr.log diff --git a/src/tools/cargo/tests/testsuite/cargo/help/stdout.log b/src/tools/cargo/tests/testsuite/cargo/help/stdout.log new file mode 100644 index 000000000..26bcd745b --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo/help/stdout.log @@ -0,0 +1,39 @@ +Rust's package manager + +Usage: cargo [..][OPTIONS] [COMMAND] + cargo [..][OPTIONS] -Zscript <MANIFEST_RS> [ARGS]... + +Options: + -V, --version Print version info and exit + --list List installed commands + --explain <CODE> Run `rustc --explain CODE` + -v, --verbose... Use verbose output (-vv very verbose/build.rs output) + -q, --quiet Do not print cargo log messages + --color <WHEN> Coloring: auto, always, never + -C <DIRECTORY> Change to DIRECTORY before doing anything (nightly-only) + --frozen Require Cargo.lock and cache are up to date + --locked Require Cargo.lock is up to date + --offline Run without accessing the network + --config <KEY=VALUE> Override a configuration value + -Z <FLAG> Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for details + -h, --help Print help + +Some common cargo commands are (see all commands with --list): + build, b Compile the current package + check, c Analyze the current package and report errors, but don't build object files + clean Remove the target directory + doc, d Build this package's and its dependencies' documentation + new Create a new cargo package + init Create a new cargo package in an existing directory + add Add dependencies to a manifest file + remove Remove dependencies from a manifest file + run, r Run a binary or example of the local package + test, t Run the tests + bench Run the benchmarks + update Update dependencies listed in Cargo.lock + search Search registry for crates + publish Package and upload this package to the registry + install Install a Rust binary. Default location is $HOME/.cargo/bin + uninstall Uninstall a Rust binary + +See 'cargo help <command>' for more information on a specific command. diff --git a/src/tools/cargo/tests/testsuite/cargo/mod.rs b/src/tools/cargo/tests/testsuite/cargo/mod.rs new file mode 100644 index 000000000..c0ce11180 --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo/mod.rs @@ -0,0 +1 @@ +mod help; diff --git a/src/tools/cargo/tests/testsuite/cargo_add/help/mod.rs b/src/tools/cargo/tests/testsuite/cargo_add/help/mod.rs new file mode 100644 index 000000000..0962047f8 --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_add/help/mod.rs @@ -0,0 +1,13 @@ +use cargo_test_support::curr_dir; +use cargo_test_support::prelude::*; + +#[cargo_test] +fn case() { + snapbox::cmd::Command::cargo_ui() + .arg("add") + .arg("--help") + .assert() + .success() + .stdout_matches_path(curr_dir!().join("stdout.log")) + .stderr_matches_path(curr_dir!().join("stderr.log")); +} diff --git a/src/tools/cargo/tests/testsuite/init/bin_already_exists_explicit/stdout.log b/src/tools/cargo/tests/testsuite/cargo_add/help/stderr.log index e69de29bb..e69de29bb 100644 --- a/src/tools/cargo/tests/testsuite/init/bin_already_exists_explicit/stdout.log +++ b/src/tools/cargo/tests/testsuite/cargo_add/help/stderr.log diff --git a/src/tools/cargo/tests/testsuite/cargo_add/help/stdout.log b/src/tools/cargo/tests/testsuite/cargo_add/help/stdout.log new file mode 100644 index 000000000..0daba1a94 --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_add/help/stdout.log @@ -0,0 +1,124 @@ +Add dependencies to a Cargo.toml manifest file + +Usage: cargo add [OPTIONS] <DEP>[@<VERSION>] ... + cargo add [OPTIONS] --path <PATH> ... + cargo add [OPTIONS] --git <URL> ... + +Arguments: + [DEP_ID]... + Reference to a package to add as a dependency + + You can reference a package by: + - `<name>`, like `cargo add serde` (latest version will be used) + - `<name>@<version-req>`, like `cargo add serde@1` or `cargo add serde@=1.0.38` + +Options: + --no-default-features + Disable the default features + + --default-features + Re-enable the default features + + -F, --features <FEATURES> + Space or comma separated list of features to activate + + --optional + Mark the dependency as optional + + The package name will be exposed as feature of your crate. + + --no-optional + Mark the dependency as required + + The package will be removed from your features. + + --rename <NAME> + Rename the dependency + + Example uses: + - Depending on multiple versions of a crate + - Depend on crates with the same name from different registries + + --ignore-rust-version + Ignore `rust-version` specification in packages (unstable) + + --dry-run + Don't actually write the manifest + + -q, --quiet + Do not print cargo log messages + + -v, --verbose... + Use verbose output (-vv very verbose/build.rs output) + + --color <WHEN> + Coloring: auto, always, never + + --config <KEY=VALUE> + Override a configuration value + + -Z <FLAG> + Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for details + + -h, --help + Print help (see a summary with '-h') + +Manifest Options: + --manifest-path <PATH> + Path to Cargo.toml + + --frozen + Require Cargo.lock and cache are up to date + + --locked + Require Cargo.lock is up to date + + --offline + Run without accessing the network + +Package Selection: + -p, --package [<SPEC>] + Package to modify + +Source: + --path <PATH> + Filesystem path to local crate to add + + --git <URI> + Git repository location + + Without any other information, cargo will use latest commit on the main branch. + + --branch <BRANCH> + Git branch to download the crate from + + --tag <TAG> + Git tag to download the crate from + + --rev <REV> + Git reference to download the crate from + + This is the catch all, handling hashes to named references in remote repositories. + + --registry <NAME> + Package registry for this dependency + +Section: + --dev + Add as development dependency + + Dev-dependencies are not used when compiling a package for building, but are used for + compiling tests, examples, and benchmarks. + + These dependencies are not propagated to other packages which depend on this package. + + --build + Add as build dependency + + Build-dependencies are the only dependencies available for use by build scripts + (`build.rs` files). + + --target <TARGET> + Add as dependency to the given target platform + +Run `cargo help add` for more detailed information. diff --git a/src/tools/cargo/tests/testsuite/cargo_add/mod.rs b/src/tools/cargo/tests/testsuite/cargo_add/mod.rs index be7a1546b..de93afbc1 100644 --- a/src/tools/cargo/tests/testsuite/cargo_add/mod.rs +++ b/src/tools/cargo/tests/testsuite/cargo_add/mod.rs @@ -35,6 +35,7 @@ mod git_normalized_name; mod git_registry; mod git_rev; mod git_tag; +mod help; mod infer_prerelease; mod invalid_arg; mod invalid_git_name; diff --git a/src/tools/cargo/tests/testsuite/cargo_bench/help/mod.rs b/src/tools/cargo/tests/testsuite/cargo_bench/help/mod.rs new file mode 100644 index 000000000..9338664e5 --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_bench/help/mod.rs @@ -0,0 +1,13 @@ +use cargo_test_support::curr_dir; +use cargo_test_support::prelude::*; + +#[cargo_test] +fn case() { + snapbox::cmd::Command::cargo_ui() + .arg("bench") + .arg("--help") + .assert() + .success() + .stdout_matches_path(curr_dir!().join("stdout.log")) + .stderr_matches_path(curr_dir!().join("stderr.log")); +} diff --git a/src/tools/cargo/tests/testsuite/init/bin_already_exists_explicit_nosrc/stdout.log b/src/tools/cargo/tests/testsuite/cargo_bench/help/stderr.log index e69de29bb..e69de29bb 100644 --- a/src/tools/cargo/tests/testsuite/init/bin_already_exists_explicit_nosrc/stdout.log +++ b/src/tools/cargo/tests/testsuite/cargo_bench/help/stderr.log diff --git a/src/tools/cargo/tests/testsuite/cargo_bench/help/stdout.log b/src/tools/cargo/tests/testsuite/cargo_bench/help/stdout.log new file mode 100644 index 000000000..5d9484df9 --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_bench/help/stdout.log @@ -0,0 +1,59 @@ +Execute all benchmarks of a local package + +Usage: cargo[EXE] bench [OPTIONS] [BENCHNAME] [-- [args]...] + +Arguments: + [BENCHNAME] If specified, only run benches containing this string in their names + [args]... Arguments for the bench binary + +Options: + --no-run Compile, but don't run benchmarks + --no-fail-fast Run all benchmarks regardless of failure + --ignore-rust-version Ignore `rust-version` specification in packages + --message-format <FMT> Error format + -q, --quiet Do not print cargo log messages + -v, --verbose... Use verbose output (-vv very verbose/build.rs output) + --color <WHEN> Coloring: auto, always, never + --config <KEY=VALUE> Override a configuration value + -Z <FLAG> Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for + details + -h, --help Print help + +Package Selection: + -p, --package [<SPEC>] Package to run benchmarks for + --workspace Benchmark all packages in the workspace + --exclude <SPEC> Exclude packages from the benchmark + --all Alias for --workspace (deprecated) + +Target Selection: + --lib Benchmark only this package's library + --bins Benchmark all binaries + --bin [<NAME>] Benchmark only the specified binary + --examples Benchmark all examples + --example [<NAME>] Benchmark only the specified example + --tests Benchmark all tests + --test [<NAME>] Benchmark only the specified test target + --benches Benchmark all benches + --bench [<NAME>] Benchmark only the specified bench target + --all-targets Benchmark all targets + +Feature Selection: + -F, --features <FEATURES> Space or comma separated list of features to activate + --all-features Activate all available features + --no-default-features Do not activate the `default` feature + +Compilation Options: + -j, --jobs <N> Number of parallel jobs, defaults to # of CPUs. + --profile <PROFILE-NAME> Build artifacts with the specified profile + --target <TRIPLE> Build for the target triple + --target-dir <DIRECTORY> Directory for all generated artifacts + --unit-graph Output build graph in JSON (unstable) + --timings[=<FMTS>] Timing output formats (unstable) (comma separated): html, json + +Manifest Options: + --manifest-path <PATH> Path to Cargo.toml + --frozen Require Cargo.lock and cache are up to date + --locked Require Cargo.lock is up to date + --offline Run without accessing the network + +Run `cargo help bench` for more detailed information. diff --git a/src/tools/cargo/tests/testsuite/cargo_bench/mod.rs b/src/tools/cargo/tests/testsuite/cargo_bench/mod.rs new file mode 100644 index 000000000..c0ce11180 --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_bench/mod.rs @@ -0,0 +1 @@ +mod help; diff --git a/src/tools/cargo/tests/testsuite/cargo_build/help/mod.rs b/src/tools/cargo/tests/testsuite/cargo_build/help/mod.rs new file mode 100644 index 000000000..9ca23b478 --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_build/help/mod.rs @@ -0,0 +1,13 @@ +use cargo_test_support::curr_dir; +use cargo_test_support::prelude::*; + +#[cargo_test] +fn case() { + snapbox::cmd::Command::cargo_ui() + .arg("build") + .arg("--help") + .assert() + .success() + .stdout_matches_path(curr_dir!().join("stdout.log")) + .stderr_matches_path(curr_dir!().join("stderr.log")); +} diff --git a/src/tools/cargo/tests/testsuite/init/bin_already_exists_implicit/stdout.log b/src/tools/cargo/tests/testsuite/cargo_build/help/stderr.log index e69de29bb..e69de29bb 100644 --- a/src/tools/cargo/tests/testsuite/init/bin_already_exists_implicit/stdout.log +++ b/src/tools/cargo/tests/testsuite/cargo_build/help/stderr.log diff --git a/src/tools/cargo/tests/testsuite/cargo_build/help/stdout.log b/src/tools/cargo/tests/testsuite/cargo_build/help/stdout.log new file mode 100644 index 000000000..af906c24f --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_build/help/stdout.log @@ -0,0 +1,58 @@ +Compile a local package and all of its dependencies + +Usage: cargo[EXE] build [OPTIONS] + +Options: + --ignore-rust-version Ignore `rust-version` specification in packages + --future-incompat-report Outputs a future incompatibility report at the end of the build + --message-format <FMT> Error format + -q, --quiet Do not print cargo log messages + -v, --verbose... Use verbose output (-vv very verbose/build.rs output) + --color <WHEN> Coloring: auto, always, never + --config <KEY=VALUE> Override a configuration value + -Z <FLAG> Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for + details + -h, --help Print help + +Package Selection: + -p, --package [<SPEC>] Package to build (see `cargo help pkgid`) + --workspace Build all packages in the workspace + --exclude <SPEC> Exclude packages from the build + --all Alias for --workspace (deprecated) + +Target Selection: + --lib Build only this package's library + --bins Build all binaries + --bin [<NAME>] Build only the specified binary + --examples Build all examples + --example [<NAME>] Build only the specified example + --tests Build all tests + --test [<NAME>] Build only the specified test target + --benches Build all benches + --bench [<NAME>] Build only the specified bench target + --all-targets Build all targets + +Feature Selection: + -F, --features <FEATURES> Space or comma separated list of features to activate + --all-features Activate all available features + --no-default-features Do not activate the `default` feature + +Compilation Options: + -r, --release Build artifacts in release mode, with optimizations + --profile <PROFILE-NAME> Build artifacts with the specified profile + -j, --jobs <N> Number of parallel jobs, defaults to # of CPUs. + --keep-going Do not abort the build as soon as there is an error (unstable) + --target <TRIPLE> Build for the target triple + --target-dir <DIRECTORY> Directory for all generated artifacts + --out-dir <PATH> Copy final artifacts to this directory (unstable) + --build-plan Output the build plan in JSON (unstable) + --unit-graph Output build graph in JSON (unstable) + --timings[=<FMTS>] Timing output formats (unstable) (comma separated): html, json + +Manifest Options: + --manifest-path <PATH> Path to Cargo.toml + --frozen Require Cargo.lock and cache are up to date + --locked Require Cargo.lock is up to date + --offline Run without accessing the network + +Run `cargo help build` for more detailed information. diff --git a/src/tools/cargo/tests/testsuite/cargo_build/mod.rs b/src/tools/cargo/tests/testsuite/cargo_build/mod.rs new file mode 100644 index 000000000..c0ce11180 --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_build/mod.rs @@ -0,0 +1 @@ +mod help; diff --git a/src/tools/cargo/tests/testsuite/cargo_check/help/mod.rs b/src/tools/cargo/tests/testsuite/cargo_check/help/mod.rs new file mode 100644 index 000000000..71571bc95 --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_check/help/mod.rs @@ -0,0 +1,13 @@ +use cargo_test_support::curr_dir; +use cargo_test_support::prelude::*; + +#[cargo_test] +fn case() { + snapbox::cmd::Command::cargo_ui() + .arg("check") + .arg("--help") + .assert() + .success() + .stdout_matches_path(curr_dir!().join("stdout.log")) + .stderr_matches_path(curr_dir!().join("stderr.log")); +} diff --git a/src/tools/cargo/tests/testsuite/init/bin_already_exists_implicit_namenosrc/stdout.log b/src/tools/cargo/tests/testsuite/cargo_check/help/stderr.log index e69de29bb..e69de29bb 100644 --- a/src/tools/cargo/tests/testsuite/init/bin_already_exists_implicit_namenosrc/stdout.log +++ b/src/tools/cargo/tests/testsuite/cargo_check/help/stderr.log diff --git a/src/tools/cargo/tests/testsuite/cargo_check/help/stdout.log b/src/tools/cargo/tests/testsuite/cargo_check/help/stdout.log new file mode 100644 index 000000000..7c87615cd --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_check/help/stdout.log @@ -0,0 +1,56 @@ +Check a local package and all of its dependencies for errors + +Usage: cargo[EXE] check [OPTIONS] + +Options: + --ignore-rust-version Ignore `rust-version` specification in packages + --future-incompat-report Outputs a future incompatibility report at the end of the build + --message-format <FMT> Error format + -q, --quiet Do not print cargo log messages + -v, --verbose... Use verbose output (-vv very verbose/build.rs output) + --color <WHEN> Coloring: auto, always, never + --config <KEY=VALUE> Override a configuration value + -Z <FLAG> Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for + details + -h, --help Print help + +Package Selection: + -p, --package [<SPEC>] Package(s) to check + --workspace Check all packages in the workspace + --exclude <SPEC> Exclude packages from the check + --all Alias for --workspace (deprecated) + +Target Selection: + --lib Check only this package's library + --bins Check all binaries + --bin [<NAME>] Check only the specified binary + --examples Check all examples + --example [<NAME>] Check only the specified example + --tests Check all tests + --test [<NAME>] Check only the specified test target + --benches Check all benches + --bench [<NAME>] Check only the specified bench target + --all-targets Check all targets + +Feature Selection: + -F, --features <FEATURES> Space or comma separated list of features to activate + --all-features Activate all available features + --no-default-features Do not activate the `default` feature + +Compilation Options: + -j, --jobs <N> Number of parallel jobs, defaults to # of CPUs. + --keep-going Do not abort the build as soon as there is an error (unstable) + -r, --release Check artifacts in release mode, with optimizations + --profile <PROFILE-NAME> Check artifacts with the specified profile + --target <TRIPLE> Check for the target triple + --target-dir <DIRECTORY> Directory for all generated artifacts + --unit-graph Output build graph in JSON (unstable) + --timings[=<FMTS>] Timing output formats (unstable) (comma separated): html, json + +Manifest Options: + --manifest-path <PATH> Path to Cargo.toml + --frozen Require Cargo.lock and cache are up to date + --locked Require Cargo.lock is up to date + --offline Run without accessing the network + +Run `cargo help check` for more detailed information. diff --git a/src/tools/cargo/tests/testsuite/cargo_check/mod.rs b/src/tools/cargo/tests/testsuite/cargo_check/mod.rs new file mode 100644 index 000000000..c0ce11180 --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_check/mod.rs @@ -0,0 +1 @@ +mod help; diff --git a/src/tools/cargo/tests/testsuite/cargo_clean/help/mod.rs b/src/tools/cargo/tests/testsuite/cargo_clean/help/mod.rs new file mode 100644 index 000000000..7225292b8 --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_clean/help/mod.rs @@ -0,0 +1,13 @@ +use cargo_test_support::curr_dir; +use cargo_test_support::prelude::*; + +#[cargo_test] +fn case() { + snapbox::cmd::Command::cargo_ui() + .arg("clean") + .arg("--help") + .assert() + .success() + .stdout_matches_path(curr_dir!().join("stdout.log")) + .stderr_matches_path(curr_dir!().join("stderr.log")); +} diff --git a/src/tools/cargo/tests/testsuite/init/bin_already_exists_implicit_namesrc/stdout.log b/src/tools/cargo/tests/testsuite/cargo_clean/help/stderr.log index e69de29bb..e69de29bb 100644 --- a/src/tools/cargo/tests/testsuite/init/bin_already_exists_implicit_namesrc/stdout.log +++ b/src/tools/cargo/tests/testsuite/cargo_clean/help/stderr.log diff --git a/src/tools/cargo/tests/testsuite/cargo_clean/help/stdout.log b/src/tools/cargo/tests/testsuite/cargo_clean/help/stdout.log new file mode 100644 index 000000000..fd3c8855c --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_clean/help/stdout.log @@ -0,0 +1,29 @@ +Remove artifacts that cargo has generated in the past + +Usage: cargo[EXE] clean [OPTIONS] + +Options: + --doc Whether or not to clean just the documentation directory + -q, --quiet Do not print cargo log messages + -v, --verbose... Use verbose output (-vv very verbose/build.rs output) + --color <WHEN> Coloring: auto, always, never + --config <KEY=VALUE> Override a configuration value + -Z <FLAG> Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for details + -h, --help Print help + +Package Selection: + -p, --package [<SPEC>] Package to clean artifacts for + +Compilation Options: + -r, --release Whether or not to clean release artifacts + --profile <PROFILE-NAME> Clean artifacts of the specified profile + --target <TRIPLE> Target triple to clean output for + --target-dir <DIRECTORY> Directory for all generated artifacts + +Manifest Options: + --manifest-path <PATH> Path to Cargo.toml + --frozen Require Cargo.lock and cache are up to date + --locked Require Cargo.lock is up to date + --offline Run without accessing the network + +Run `cargo help clean` for more detailed information. diff --git a/src/tools/cargo/tests/testsuite/cargo_clean/mod.rs b/src/tools/cargo/tests/testsuite/cargo_clean/mod.rs new file mode 100644 index 000000000..c0ce11180 --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_clean/mod.rs @@ -0,0 +1 @@ +mod help; diff --git a/src/tools/cargo/tests/testsuite/cargo_config/help/mod.rs b/src/tools/cargo/tests/testsuite/cargo_config/help/mod.rs new file mode 100644 index 000000000..070238ef0 --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_config/help/mod.rs @@ -0,0 +1,13 @@ +use cargo_test_support::curr_dir; +use cargo_test_support::prelude::*; + +#[cargo_test] +fn case() { + snapbox::cmd::Command::cargo_ui() + .arg("config") + .arg("--help") + .assert() + .success() + .stdout_matches_path(curr_dir!().join("stdout.log")) + .stderr_matches_path(curr_dir!().join("stderr.log")); +} diff --git a/src/tools/cargo/tests/testsuite/init/bin_already_exists_implicit_nosrc/stdout.log b/src/tools/cargo/tests/testsuite/cargo_config/help/stderr.log index e69de29bb..e69de29bb 100644 --- a/src/tools/cargo/tests/testsuite/init/bin_already_exists_implicit_nosrc/stdout.log +++ b/src/tools/cargo/tests/testsuite/cargo_config/help/stderr.log diff --git a/src/tools/cargo/tests/testsuite/cargo_config/help/stdout.log b/src/tools/cargo/tests/testsuite/cargo_config/help/stdout.log new file mode 100644 index 000000000..50caca72a --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_config/help/stdout.log @@ -0,0 +1,18 @@ +Inspect configuration values + +Usage: cargo[EXE] config [OPTIONS] <COMMAND> + +Commands: + get + +Options: + -v, --verbose... Use verbose output (-vv very verbose/build.rs output) + --color <WHEN> Coloring: auto, always, never + --config <KEY=VALUE> Override a configuration value + -Z <FLAG> Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for details + -h, --help Print help + +Manifest Options: + --frozen Require Cargo.lock and cache are up to date + --locked Require Cargo.lock is up to date + --offline Run without accessing the network diff --git a/src/tools/cargo/tests/testsuite/cargo_config.rs b/src/tools/cargo/tests/testsuite/cargo_config/mod.rs index e367f8e06..dc0a40ed8 100644 --- a/src/tools/cargo/tests/testsuite/cargo_config.rs +++ b/src/tools/cargo/tests/testsuite/cargo_config/mod.rs @@ -5,6 +5,8 @@ use cargo_test_support::paths; use std::fs; use std::path::PathBuf; +mod help; + fn cargo_process(s: &str) -> cargo_test_support::Execs { let mut p = cargo_test_support::cargo_process(s); // Clear out some of the environment added by the default cargo_process so diff --git a/src/tools/cargo/tests/testsuite/cargo_doc/help/mod.rs b/src/tools/cargo/tests/testsuite/cargo_doc/help/mod.rs new file mode 100644 index 000000000..b0fd4f3e8 --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_doc/help/mod.rs @@ -0,0 +1,13 @@ +use cargo_test_support::curr_dir; +use cargo_test_support::prelude::*; + +#[cargo_test] +fn case() { + snapbox::cmd::Command::cargo_ui() + .arg("doc") + .arg("--help") + .assert() + .success() + .stdout_matches_path(curr_dir!().join("stdout.log")) + .stderr_matches_path(curr_dir!().join("stderr.log")); +} diff --git a/src/tools/cargo/tests/testsuite/init/both_lib_and_bin/stdout.log b/src/tools/cargo/tests/testsuite/cargo_doc/help/stderr.log index e69de29bb..e69de29bb 100644 --- a/src/tools/cargo/tests/testsuite/init/both_lib_and_bin/stdout.log +++ b/src/tools/cargo/tests/testsuite/cargo_doc/help/stderr.log diff --git a/src/tools/cargo/tests/testsuite/cargo_doc/help/stdout.log b/src/tools/cargo/tests/testsuite/cargo_doc/help/stdout.log new file mode 100644 index 000000000..480e189c1 --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_doc/help/stdout.log @@ -0,0 +1,53 @@ +Build a package's documentation + +Usage: cargo[EXE] doc [OPTIONS] + +Options: + --open Opens the docs in a browser after the operation + --no-deps Don't build documentation for dependencies + --document-private-items Document private items + --ignore-rust-version Ignore `rust-version` specification in packages + --message-format <FMT> Error format + -q, --quiet Do not print cargo log messages + -v, --verbose... Use verbose output (-vv very verbose/build.rs output) + --color <WHEN> Coloring: auto, always, never + --config <KEY=VALUE> Override a configuration value + -Z <FLAG> Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for + details + -h, --help Print help + +Package Selection: + -p, --package [<SPEC>] Package to document + --workspace Document all packages in the workspace + --exclude <SPEC> Exclude packages from the build + --all Alias for --workspace (deprecated) + +Feature Selection: + -F, --features <FEATURES> Space or comma separated list of features to activate + --all-features Activate all available features + --no-default-features Do not activate the `default` feature + +Target Selection: + --lib Document only this package's library + --bins Document all binaries + --bin [<NAME>] Document only the specified binary + --examples Document all examples + --example [<NAME>] Document only the specified example + +Compilation Options: + -j, --jobs <N> Number of parallel jobs, defaults to # of CPUs. + --keep-going Do not abort the build as soon as there is an error (unstable) + -r, --release Build artifacts in release mode, with optimizations + --profile <PROFILE-NAME> Build artifacts with the specified profile + --target <TRIPLE> Build for the target triple + --target-dir <DIRECTORY> Directory for all generated artifacts + --unit-graph Output build graph in JSON (unstable) + --timings[=<FMTS>] Timing output formats (unstable) (comma separated): html, json + +Manifest Options: + --manifest-path <PATH> Path to Cargo.toml + --frozen Require Cargo.lock and cache are up to date + --locked Require Cargo.lock is up to date + --offline Run without accessing the network + +Run `cargo help doc` for more detailed information. diff --git a/src/tools/cargo/tests/testsuite/cargo_doc/mod.rs b/src/tools/cargo/tests/testsuite/cargo_doc/mod.rs new file mode 100644 index 000000000..c0ce11180 --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_doc/mod.rs @@ -0,0 +1 @@ +mod help; diff --git a/src/tools/cargo/tests/testsuite/cargo_fetch/help/mod.rs b/src/tools/cargo/tests/testsuite/cargo_fetch/help/mod.rs new file mode 100644 index 000000000..79025bc32 --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_fetch/help/mod.rs @@ -0,0 +1,13 @@ +use cargo_test_support::curr_dir; +use cargo_test_support::prelude::*; + +#[cargo_test] +fn case() { + snapbox::cmd::Command::cargo_ui() + .arg("fetch") + .arg("--help") + .assert() + .success() + .stdout_matches_path(curr_dir!().join("stdout.log")) + .stderr_matches_path(curr_dir!().join("stderr.log")); +} diff --git a/src/tools/cargo/tests/testsuite/init/cant_create_library_when_both_binlib_present/stdout.log b/src/tools/cargo/tests/testsuite/cargo_fetch/help/stderr.log index e69de29bb..e69de29bb 100644 --- a/src/tools/cargo/tests/testsuite/init/cant_create_library_when_both_binlib_present/stdout.log +++ b/src/tools/cargo/tests/testsuite/cargo_fetch/help/stderr.log diff --git a/src/tools/cargo/tests/testsuite/cargo_fetch/help/stdout.log b/src/tools/cargo/tests/testsuite/cargo_fetch/help/stdout.log new file mode 100644 index 000000000..b9bd6c35b --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_fetch/help/stdout.log @@ -0,0 +1,22 @@ +Fetch dependencies of a package from the network + +Usage: cargo[EXE] fetch [OPTIONS] + +Options: + -q, --quiet Do not print cargo log messages + -v, --verbose... Use verbose output (-vv very verbose/build.rs output) + --color <WHEN> Coloring: auto, always, never + --config <KEY=VALUE> Override a configuration value + -Z <FLAG> Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for details + -h, --help Print help + +Compilation Options: + --target <TRIPLE> Fetch dependencies for the target triple + +Manifest Options: + --manifest-path <PATH> Path to Cargo.toml + --frozen Require Cargo.lock and cache are up to date + --locked Require Cargo.lock is up to date + --offline Run without accessing the network + +Run `cargo help fetch` for more detailed information. diff --git a/src/tools/cargo/tests/testsuite/cargo_fetch/mod.rs b/src/tools/cargo/tests/testsuite/cargo_fetch/mod.rs new file mode 100644 index 000000000..c0ce11180 --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_fetch/mod.rs @@ -0,0 +1 @@ +mod help; diff --git a/src/tools/cargo/tests/testsuite/cargo_fix/help/mod.rs b/src/tools/cargo/tests/testsuite/cargo_fix/help/mod.rs new file mode 100644 index 000000000..2c67e1556 --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_fix/help/mod.rs @@ -0,0 +1,13 @@ +use cargo_test_support::curr_dir; +use cargo_test_support::prelude::*; + +#[cargo_test] +fn case() { + snapbox::cmd::Command::cargo_ui() + .arg("fix") + .arg("--help") + .assert() + .success() + .stdout_matches_path(curr_dir!().join("stdout.log")) + .stderr_matches_path(curr_dir!().join("stderr.log")); +} diff --git a/src/tools/cargo/tests/testsuite/init/confused_by_multiple_lib_files/stdout.log b/src/tools/cargo/tests/testsuite/cargo_fix/help/stderr.log index e69de29bb..e69de29bb 100644 --- a/src/tools/cargo/tests/testsuite/init/confused_by_multiple_lib_files/stdout.log +++ b/src/tools/cargo/tests/testsuite/cargo_fix/help/stderr.log diff --git a/src/tools/cargo/tests/testsuite/cargo_fix/help/stdout.log b/src/tools/cargo/tests/testsuite/cargo_fix/help/stdout.log new file mode 100644 index 000000000..c0a98218a --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_fix/help/stdout.log @@ -0,0 +1,60 @@ +Automatically fix lint warnings reported by rustc + +Usage: cargo[EXE] fix [OPTIONS] + +Options: + --edition Fix in preparation for the next edition + --edition-idioms Fix warnings to migrate to the idioms of an edition + --broken-code Fix code even if it already has compiler errors + --allow-no-vcs Fix code even if a VCS was not detected + --allow-dirty Fix code even if the working directory is dirty + --allow-staged Fix code even if the working directory has staged changes + --ignore-rust-version Ignore `rust-version` specification in packages + --message-format <FMT> Error format + -q, --quiet Do not print cargo log messages + -v, --verbose... Use verbose output (-vv very verbose/build.rs output) + --color <WHEN> Coloring: auto, always, never + --config <KEY=VALUE> Override a configuration value + -Z <FLAG> Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for + details + -h, --help Print help + +Package Selection: + -p, --package [<SPEC>] Package(s) to fix + --workspace Fix all packages in the workspace + --exclude <SPEC> Exclude packages from the fixes + --all Alias for --workspace (deprecated) + +Target Selection: + --lib Fix only this package's library + --bins Fix all binaries + --bin [<NAME>] Fix only the specified binary + --examples Fix all examples + --example [<NAME>] Fix only the specified example + --tests Fix all tests + --test [<NAME>] Fix only the specified test target + --benches Fix all benches + --bench [<NAME>] Fix only the specified bench target + --all-targets Fix all targets (default) + +Feature Selection: + -F, --features <FEATURES> Space or comma separated list of features to activate + --all-features Activate all available features + --no-default-features Do not activate the `default` feature + +Compilation Options: + -j, --jobs <N> Number of parallel jobs, defaults to # of CPUs. + --keep-going Do not abort the build as soon as there is an error (unstable) + -r, --release Fix artifacts in release mode, with optimizations + --profile <PROFILE-NAME> Build artifacts with the specified profile + --target <TRIPLE> Fix for the target triple + --target-dir <DIRECTORY> Directory for all generated artifacts + --timings[=<FMTS>] Timing output formats (unstable) (comma separated): html, json + +Manifest Options: + --manifest-path <PATH> Path to Cargo.toml + --frozen Require Cargo.lock and cache are up to date + --locked Require Cargo.lock is up to date + --offline Run without accessing the network + +Run `cargo help fix` for more detailed information. diff --git a/src/tools/cargo/tests/testsuite/cargo_fix/mod.rs b/src/tools/cargo/tests/testsuite/cargo_fix/mod.rs new file mode 100644 index 000000000..c0ce11180 --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_fix/mod.rs @@ -0,0 +1 @@ +mod help; diff --git a/src/tools/cargo/tests/testsuite/cargo_generate_lockfile/help/mod.rs b/src/tools/cargo/tests/testsuite/cargo_generate_lockfile/help/mod.rs new file mode 100644 index 000000000..0408ce06b --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_generate_lockfile/help/mod.rs @@ -0,0 +1,13 @@ +use cargo_test_support::curr_dir; +use cargo_test_support::prelude::*; + +#[cargo_test] +fn case() { + snapbox::cmd::Command::cargo_ui() + .arg("generate-lockfile") + .arg("--help") + .assert() + .success() + .stdout_matches_path(curr_dir!().join("stdout.log")) + .stderr_matches_path(curr_dir!().join("stderr.log")); +} diff --git a/src/tools/cargo/tests/testsuite/init/creates_binary_when_both_binlib_present/stdout.log b/src/tools/cargo/tests/testsuite/cargo_generate_lockfile/help/stderr.log index e69de29bb..e69de29bb 100644 --- a/src/tools/cargo/tests/testsuite/init/creates_binary_when_both_binlib_present/stdout.log +++ b/src/tools/cargo/tests/testsuite/cargo_generate_lockfile/help/stderr.log diff --git a/src/tools/cargo/tests/testsuite/cargo_generate_lockfile/help/stdout.log b/src/tools/cargo/tests/testsuite/cargo_generate_lockfile/help/stdout.log new file mode 100644 index 000000000..07eff888a --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_generate_lockfile/help/stdout.log @@ -0,0 +1,19 @@ +Generate the lockfile for a package + +Usage: cargo[EXE] generate-lockfile [OPTIONS] + +Options: + -q, --quiet Do not print cargo log messages + -v, --verbose... Use verbose output (-vv very verbose/build.rs output) + --color <WHEN> Coloring: auto, always, never + --config <KEY=VALUE> Override a configuration value + -Z <FLAG> Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for details + -h, --help Print help + +Manifest Options: + --manifest-path <PATH> Path to Cargo.toml + --frozen Require Cargo.lock and cache are up to date + --locked Require Cargo.lock is up to date + --offline Run without accessing the network + +Run `cargo help generate-lockfile` for more detailed information. diff --git a/src/tools/cargo/tests/testsuite/cargo_generate_lockfile/mod.rs b/src/tools/cargo/tests/testsuite/cargo_generate_lockfile/mod.rs new file mode 100644 index 000000000..c0ce11180 --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_generate_lockfile/mod.rs @@ -0,0 +1 @@ +mod help; diff --git a/src/tools/cargo/tests/testsuite/cargo_git_checkout/help/mod.rs b/src/tools/cargo/tests/testsuite/cargo_git_checkout/help/mod.rs new file mode 100644 index 000000000..5ff877fbb --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_git_checkout/help/mod.rs @@ -0,0 +1,13 @@ +use cargo_test_support::curr_dir; +use cargo_test_support::prelude::*; + +#[cargo_test] +fn case() { + snapbox::cmd::Command::cargo_ui() + .arg("git-checkout") + .arg("--help") + .assert() + .success() + .stdout_matches_path(curr_dir!().join("stdout.log")) + .stderr_matches_path(curr_dir!().join("stderr.log")); +} diff --git a/src/tools/cargo/tests/testsuite/init/creates_binary_when_instructed_and_has_lib_file/stdout.log b/src/tools/cargo/tests/testsuite/cargo_git_checkout/help/stderr.log index e69de29bb..e69de29bb 100644 --- a/src/tools/cargo/tests/testsuite/init/creates_binary_when_instructed_and_has_lib_file/stdout.log +++ b/src/tools/cargo/tests/testsuite/cargo_git_checkout/help/stderr.log diff --git a/src/tools/cargo/tests/testsuite/cargo_git_checkout/help/stdout.log b/src/tools/cargo/tests/testsuite/cargo_git_checkout/help/stdout.log new file mode 100644 index 000000000..675090fd3 --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_git_checkout/help/stdout.log @@ -0,0 +1 @@ +The `git-checkout` command has been removed. diff --git a/src/tools/cargo/tests/testsuite/cargo_git_checkout/mod.rs b/src/tools/cargo/tests/testsuite/cargo_git_checkout/mod.rs new file mode 100644 index 000000000..c0ce11180 --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_git_checkout/mod.rs @@ -0,0 +1 @@ +mod help; diff --git a/src/tools/cargo/tests/testsuite/cargo_help/help/mod.rs b/src/tools/cargo/tests/testsuite/cargo_help/help/mod.rs new file mode 100644 index 000000000..af445cda1 --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_help/help/mod.rs @@ -0,0 +1,13 @@ +use cargo_test_support::curr_dir; +use cargo_test_support::prelude::*; + +#[cargo_test] +fn case() { + snapbox::cmd::Command::cargo_ui() + .arg("help") + .arg("--help") + .assert() + .success() + .stdout_matches_path(curr_dir!().join("stdout.log")) + .stderr_matches_path(curr_dir!().join("stderr.log")); +} diff --git a/src/tools/cargo/tests/testsuite/init/creates_library_when_instructed_and_has_bin_file/stdout.log b/src/tools/cargo/tests/testsuite/cargo_help/help/stderr.log index e69de29bb..e69de29bb 100644 --- a/src/tools/cargo/tests/testsuite/init/creates_library_when_instructed_and_has_bin_file/stdout.log +++ b/src/tools/cargo/tests/testsuite/cargo_help/help/stderr.log diff --git a/src/tools/cargo/tests/testsuite/cargo_help/help/stdout.log b/src/tools/cargo/tests/testsuite/cargo_help/help/stdout.log new file mode 100644 index 000000000..a03946b45 --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_help/help/stdout.log @@ -0,0 +1,18 @@ +Displays help for a cargo subcommand + +Usage: cargo[EXE] help [OPTIONS] [COMMAND] + +Arguments: + [COMMAND] + +Options: + -v, --verbose... Use verbose output (-vv very verbose/build.rs output) + --color <WHEN> Coloring: auto, always, never + --config <KEY=VALUE> Override a configuration value + -Z <FLAG> Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for details + -h, --help Print help + +Manifest Options: + --frozen Require Cargo.lock and cache are up to date + --locked Require Cargo.lock is up to date + --offline Run without accessing the network diff --git a/src/tools/cargo/tests/testsuite/cargo_help/mod.rs b/src/tools/cargo/tests/testsuite/cargo_help/mod.rs new file mode 100644 index 000000000..c0ce11180 --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_help/mod.rs @@ -0,0 +1 @@ +mod help; diff --git a/src/tools/cargo/tests/testsuite/init/auto_git/in b/src/tools/cargo/tests/testsuite/cargo_init/auto_git/in index 1202506b6..1202506b6 120000 --- a/src/tools/cargo/tests/testsuite/init/auto_git/in +++ b/src/tools/cargo/tests/testsuite/cargo_init/auto_git/in diff --git a/src/tools/cargo/tests/testsuite/init/auto_git/mod.rs b/src/tools/cargo/tests/testsuite/cargo_init/auto_git/mod.rs index 68c217520..68c217520 100644 --- a/src/tools/cargo/tests/testsuite/init/auto_git/mod.rs +++ b/src/tools/cargo/tests/testsuite/cargo_init/auto_git/mod.rs diff --git a/src/tools/cargo/tests/testsuite/init/auto_git/out/Cargo.toml b/src/tools/cargo/tests/testsuite/cargo_init/auto_git/out/Cargo.toml index dcdb8da2c..dcdb8da2c 100644 --- a/src/tools/cargo/tests/testsuite/init/auto_git/out/Cargo.toml +++ b/src/tools/cargo/tests/testsuite/cargo_init/auto_git/out/Cargo.toml diff --git a/src/tools/cargo/tests/testsuite/init/auto_git/out/src/lib.rs b/src/tools/cargo/tests/testsuite/cargo_init/auto_git/out/src/lib.rs index 7d12d9af8..7d12d9af8 100644 --- a/src/tools/cargo/tests/testsuite/init/auto_git/out/src/lib.rs +++ b/src/tools/cargo/tests/testsuite/cargo_init/auto_git/out/src/lib.rs diff --git a/src/tools/cargo/tests/testsuite/init/auto_git/stderr.log b/src/tools/cargo/tests/testsuite/cargo_init/auto_git/stderr.log index f459bf226..f459bf226 100644 --- a/src/tools/cargo/tests/testsuite/init/auto_git/stderr.log +++ b/src/tools/cargo/tests/testsuite/cargo_init/auto_git/stderr.log diff --git a/src/tools/cargo/tests/testsuite/init/explicit_bin_with_git/stdout.log b/src/tools/cargo/tests/testsuite/cargo_init/auto_git/stdout.log index e69de29bb..e69de29bb 100644 --- a/src/tools/cargo/tests/testsuite/init/explicit_bin_with_git/stdout.log +++ b/src/tools/cargo/tests/testsuite/cargo_init/auto_git/stdout.log diff --git a/src/tools/cargo/tests/testsuite/init/bin_already_exists_explicit/in/src/main.rs b/src/tools/cargo/tests/testsuite/cargo_init/bin_already_exists_explicit/in/src/main.rs index 65fdcf8da..65fdcf8da 100644 --- a/src/tools/cargo/tests/testsuite/init/bin_already_exists_explicit/in/src/main.rs +++ b/src/tools/cargo/tests/testsuite/cargo_init/bin_already_exists_explicit/in/src/main.rs diff --git a/src/tools/cargo/tests/testsuite/init/bin_already_exists_explicit/mod.rs b/src/tools/cargo/tests/testsuite/cargo_init/bin_already_exists_explicit/mod.rs index 326bd218a..326bd218a 100644 --- a/src/tools/cargo/tests/testsuite/init/bin_already_exists_explicit/mod.rs +++ b/src/tools/cargo/tests/testsuite/cargo_init/bin_already_exists_explicit/mod.rs diff --git a/src/tools/cargo/tests/testsuite/init/bin_already_exists_explicit/out/Cargo.toml b/src/tools/cargo/tests/testsuite/cargo_init/bin_already_exists_explicit/out/Cargo.toml index dcdb8da2c..dcdb8da2c 100644 --- a/src/tools/cargo/tests/testsuite/init/bin_already_exists_explicit/out/Cargo.toml +++ b/src/tools/cargo/tests/testsuite/cargo_init/bin_already_exists_explicit/out/Cargo.toml diff --git a/src/tools/cargo/tests/testsuite/init/bin_already_exists_explicit/out/src/main.rs b/src/tools/cargo/tests/testsuite/cargo_init/bin_already_exists_explicit/out/src/main.rs index 65fdcf8da..65fdcf8da 100644 --- a/src/tools/cargo/tests/testsuite/init/bin_already_exists_explicit/out/src/main.rs +++ b/src/tools/cargo/tests/testsuite/cargo_init/bin_already_exists_explicit/out/src/main.rs diff --git a/src/tools/cargo/tests/testsuite/init/bin_already_exists_explicit/stderr.log b/src/tools/cargo/tests/testsuite/cargo_init/bin_already_exists_explicit/stderr.log index 3847e4e4a..3847e4e4a 100644 --- a/src/tools/cargo/tests/testsuite/init/bin_already_exists_explicit/stderr.log +++ b/src/tools/cargo/tests/testsuite/cargo_init/bin_already_exists_explicit/stderr.log diff --git a/src/tools/cargo/tests/testsuite/init/formats_source/stdout.log b/src/tools/cargo/tests/testsuite/cargo_init/bin_already_exists_explicit/stdout.log index e69de29bb..e69de29bb 100644 --- a/src/tools/cargo/tests/testsuite/init/formats_source/stdout.log +++ b/src/tools/cargo/tests/testsuite/cargo_init/bin_already_exists_explicit/stdout.log diff --git a/src/tools/cargo/tests/testsuite/init/bin_already_exists_explicit_nosrc/in/main.rs b/src/tools/cargo/tests/testsuite/cargo_init/bin_already_exists_explicit_nosrc/in/main.rs index 65fdcf8da..65fdcf8da 100644 --- a/src/tools/cargo/tests/testsuite/init/bin_already_exists_explicit_nosrc/in/main.rs +++ b/src/tools/cargo/tests/testsuite/cargo_init/bin_already_exists_explicit_nosrc/in/main.rs diff --git a/src/tools/cargo/tests/testsuite/init/bin_already_exists_explicit_nosrc/mod.rs b/src/tools/cargo/tests/testsuite/cargo_init/bin_already_exists_explicit_nosrc/mod.rs index 1f16fb659..1f16fb659 100644 --- a/src/tools/cargo/tests/testsuite/init/bin_already_exists_explicit_nosrc/mod.rs +++ b/src/tools/cargo/tests/testsuite/cargo_init/bin_already_exists_explicit_nosrc/mod.rs diff --git a/src/tools/cargo/tests/testsuite/init/bin_already_exists_explicit_nosrc/out/Cargo.toml b/src/tools/cargo/tests/testsuite/cargo_init/bin_already_exists_explicit_nosrc/out/Cargo.toml index 5c6c9158c..5c6c9158c 100644 --- a/src/tools/cargo/tests/testsuite/init/bin_already_exists_explicit_nosrc/out/Cargo.toml +++ b/src/tools/cargo/tests/testsuite/cargo_init/bin_already_exists_explicit_nosrc/out/Cargo.toml diff --git a/src/tools/cargo/tests/testsuite/init/bin_already_exists_explicit_nosrc/out/main.rs b/src/tools/cargo/tests/testsuite/cargo_init/bin_already_exists_explicit_nosrc/out/main.rs index 65fdcf8da..65fdcf8da 100644 --- a/src/tools/cargo/tests/testsuite/init/bin_already_exists_explicit_nosrc/out/main.rs +++ b/src/tools/cargo/tests/testsuite/cargo_init/bin_already_exists_explicit_nosrc/out/main.rs diff --git a/src/tools/cargo/tests/testsuite/init/bin_already_exists_explicit_nosrc/stderr.log b/src/tools/cargo/tests/testsuite/cargo_init/bin_already_exists_explicit_nosrc/stderr.log index 3847e4e4a..3847e4e4a 100644 --- a/src/tools/cargo/tests/testsuite/init/bin_already_exists_explicit_nosrc/stderr.log +++ b/src/tools/cargo/tests/testsuite/cargo_init/bin_already_exists_explicit_nosrc/stderr.log diff --git a/src/tools/cargo/tests/testsuite/init/fossil_autodetect/stdout.log b/src/tools/cargo/tests/testsuite/cargo_init/bin_already_exists_explicit_nosrc/stdout.log index e69de29bb..e69de29bb 100644 --- a/src/tools/cargo/tests/testsuite/init/fossil_autodetect/stdout.log +++ b/src/tools/cargo/tests/testsuite/cargo_init/bin_already_exists_explicit_nosrc/stdout.log diff --git a/src/tools/cargo/tests/testsuite/init/bin_already_exists_implicit/in/src/main.rs b/src/tools/cargo/tests/testsuite/cargo_init/bin_already_exists_implicit/in/src/main.rs index 65fdcf8da..65fdcf8da 100644 --- a/src/tools/cargo/tests/testsuite/init/bin_already_exists_implicit/in/src/main.rs +++ b/src/tools/cargo/tests/testsuite/cargo_init/bin_already_exists_implicit/in/src/main.rs diff --git a/src/tools/cargo/tests/testsuite/init/bin_already_exists_implicit/mod.rs b/src/tools/cargo/tests/testsuite/cargo_init/bin_already_exists_implicit/mod.rs index 12349a09b..12349a09b 100644 --- a/src/tools/cargo/tests/testsuite/init/bin_already_exists_implicit/mod.rs +++ b/src/tools/cargo/tests/testsuite/cargo_init/bin_already_exists_implicit/mod.rs diff --git a/src/tools/cargo/tests/testsuite/init/bin_already_exists_implicit/out/Cargo.toml b/src/tools/cargo/tests/testsuite/cargo_init/bin_already_exists_implicit/out/Cargo.toml index dcdb8da2c..dcdb8da2c 100644 --- a/src/tools/cargo/tests/testsuite/init/bin_already_exists_implicit/out/Cargo.toml +++ b/src/tools/cargo/tests/testsuite/cargo_init/bin_already_exists_implicit/out/Cargo.toml diff --git a/src/tools/cargo/tests/testsuite/init/bin_already_exists_implicit/out/src/main.rs b/src/tools/cargo/tests/testsuite/cargo_init/bin_already_exists_implicit/out/src/main.rs index 65fdcf8da..65fdcf8da 100644 --- a/src/tools/cargo/tests/testsuite/init/bin_already_exists_implicit/out/src/main.rs +++ b/src/tools/cargo/tests/testsuite/cargo_init/bin_already_exists_implicit/out/src/main.rs diff --git a/src/tools/cargo/tests/testsuite/init/bin_already_exists_implicit/stderr.log b/src/tools/cargo/tests/testsuite/cargo_init/bin_already_exists_implicit/stderr.log index 3847e4e4a..3847e4e4a 100644 --- a/src/tools/cargo/tests/testsuite/init/bin_already_exists_implicit/stderr.log +++ b/src/tools/cargo/tests/testsuite/cargo_init/bin_already_exists_implicit/stderr.log diff --git a/src/tools/cargo/tests/testsuite/init/git_autodetect/stdout.log b/src/tools/cargo/tests/testsuite/cargo_init/bin_already_exists_implicit/stdout.log index e69de29bb..e69de29bb 100644 --- a/src/tools/cargo/tests/testsuite/init/git_autodetect/stdout.log +++ b/src/tools/cargo/tests/testsuite/cargo_init/bin_already_exists_implicit/stdout.log diff --git a/src/tools/cargo/tests/testsuite/init/bin_already_exists_implicit_namenosrc/in/case.rs b/src/tools/cargo/tests/testsuite/cargo_init/bin_already_exists_implicit_namenosrc/in/case.rs index 65fdcf8da..65fdcf8da 100644 --- a/src/tools/cargo/tests/testsuite/init/bin_already_exists_implicit_namenosrc/in/case.rs +++ b/src/tools/cargo/tests/testsuite/cargo_init/bin_already_exists_implicit_namenosrc/in/case.rs diff --git a/src/tools/cargo/tests/testsuite/init/bin_already_exists_implicit_namenosrc/mod.rs b/src/tools/cargo/tests/testsuite/cargo_init/bin_already_exists_implicit_namenosrc/mod.rs index fe65940db..fe65940db 100644 --- a/src/tools/cargo/tests/testsuite/init/bin_already_exists_implicit_namenosrc/mod.rs +++ b/src/tools/cargo/tests/testsuite/cargo_init/bin_already_exists_implicit_namenosrc/mod.rs diff --git a/src/tools/cargo/tests/testsuite/init/bin_already_exists_implicit_namenosrc/out/Cargo.toml b/src/tools/cargo/tests/testsuite/cargo_init/bin_already_exists_implicit_namenosrc/out/Cargo.toml index 8da5fe778..8da5fe778 100644 --- a/src/tools/cargo/tests/testsuite/init/bin_already_exists_implicit_namenosrc/out/Cargo.toml +++ b/src/tools/cargo/tests/testsuite/cargo_init/bin_already_exists_implicit_namenosrc/out/Cargo.toml diff --git a/src/tools/cargo/tests/testsuite/init/bin_already_exists_implicit_namenosrc/out/case.rs b/src/tools/cargo/tests/testsuite/cargo_init/bin_already_exists_implicit_namenosrc/out/case.rs index 65fdcf8da..65fdcf8da 100644 --- a/src/tools/cargo/tests/testsuite/init/bin_already_exists_implicit_namenosrc/out/case.rs +++ b/src/tools/cargo/tests/testsuite/cargo_init/bin_already_exists_implicit_namenosrc/out/case.rs diff --git a/src/tools/cargo/tests/testsuite/init/bin_already_exists_implicit_namenosrc/stderr.log b/src/tools/cargo/tests/testsuite/cargo_init/bin_already_exists_implicit_namenosrc/stderr.log index 3847e4e4a..3847e4e4a 100644 --- a/src/tools/cargo/tests/testsuite/init/bin_already_exists_implicit_namenosrc/stderr.log +++ b/src/tools/cargo/tests/testsuite/cargo_init/bin_already_exists_implicit_namenosrc/stderr.log diff --git a/src/tools/cargo/tests/testsuite/init/git_ignore_exists_no_conflicting_entries/stdout.log b/src/tools/cargo/tests/testsuite/cargo_init/bin_already_exists_implicit_namenosrc/stdout.log index e69de29bb..e69de29bb 100644 --- a/src/tools/cargo/tests/testsuite/init/git_ignore_exists_no_conflicting_entries/stdout.log +++ b/src/tools/cargo/tests/testsuite/cargo_init/bin_already_exists_implicit_namenosrc/stdout.log diff --git a/src/tools/cargo/tests/testsuite/init/bin_already_exists_implicit_namesrc/in/src/case.rs b/src/tools/cargo/tests/testsuite/cargo_init/bin_already_exists_implicit_namesrc/in/src/case.rs index 65fdcf8da..65fdcf8da 100644 --- a/src/tools/cargo/tests/testsuite/init/bin_already_exists_implicit_namesrc/in/src/case.rs +++ b/src/tools/cargo/tests/testsuite/cargo_init/bin_already_exists_implicit_namesrc/in/src/case.rs diff --git a/src/tools/cargo/tests/testsuite/init/bin_already_exists_implicit_namesrc/mod.rs b/src/tools/cargo/tests/testsuite/cargo_init/bin_already_exists_implicit_namesrc/mod.rs index d3e8e66df..d3e8e66df 100644 --- a/src/tools/cargo/tests/testsuite/init/bin_already_exists_implicit_namesrc/mod.rs +++ b/src/tools/cargo/tests/testsuite/cargo_init/bin_already_exists_implicit_namesrc/mod.rs diff --git a/src/tools/cargo/tests/testsuite/init/bin_already_exists_implicit_namesrc/out/Cargo.toml b/src/tools/cargo/tests/testsuite/cargo_init/bin_already_exists_implicit_namesrc/out/Cargo.toml index dec0aaea9..dec0aaea9 100644 --- a/src/tools/cargo/tests/testsuite/init/bin_already_exists_implicit_namesrc/out/Cargo.toml +++ b/src/tools/cargo/tests/testsuite/cargo_init/bin_already_exists_implicit_namesrc/out/Cargo.toml diff --git a/src/tools/cargo/tests/testsuite/init/bin_already_exists_implicit_namesrc/out/src/case.rs b/src/tools/cargo/tests/testsuite/cargo_init/bin_already_exists_implicit_namesrc/out/src/case.rs index 65fdcf8da..65fdcf8da 100644 --- a/src/tools/cargo/tests/testsuite/init/bin_already_exists_implicit_namesrc/out/src/case.rs +++ b/src/tools/cargo/tests/testsuite/cargo_init/bin_already_exists_implicit_namesrc/out/src/case.rs diff --git a/src/tools/cargo/tests/testsuite/init/bin_already_exists_implicit_namesrc/stderr.log b/src/tools/cargo/tests/testsuite/cargo_init/bin_already_exists_implicit_namesrc/stderr.log index 3847e4e4a..3847e4e4a 100644 --- a/src/tools/cargo/tests/testsuite/init/bin_already_exists_implicit_namesrc/stderr.log +++ b/src/tools/cargo/tests/testsuite/cargo_init/bin_already_exists_implicit_namesrc/stderr.log diff --git a/src/tools/cargo/tests/testsuite/init/ignores_failure_to_format_source/stdout.log b/src/tools/cargo/tests/testsuite/cargo_init/bin_already_exists_implicit_namesrc/stdout.log index e69de29bb..e69de29bb 100644 --- a/src/tools/cargo/tests/testsuite/init/ignores_failure_to_format_source/stdout.log +++ b/src/tools/cargo/tests/testsuite/cargo_init/bin_already_exists_implicit_namesrc/stdout.log diff --git a/src/tools/cargo/tests/testsuite/init/bin_already_exists_implicit_nosrc/in/main.rs b/src/tools/cargo/tests/testsuite/cargo_init/bin_already_exists_implicit_nosrc/in/main.rs index 65fdcf8da..65fdcf8da 100644 --- a/src/tools/cargo/tests/testsuite/init/bin_already_exists_implicit_nosrc/in/main.rs +++ b/src/tools/cargo/tests/testsuite/cargo_init/bin_already_exists_implicit_nosrc/in/main.rs diff --git a/src/tools/cargo/tests/testsuite/init/bin_already_exists_implicit_nosrc/mod.rs b/src/tools/cargo/tests/testsuite/cargo_init/bin_already_exists_implicit_nosrc/mod.rs index fe65940db..fe65940db 100644 --- a/src/tools/cargo/tests/testsuite/init/bin_already_exists_implicit_nosrc/mod.rs +++ b/src/tools/cargo/tests/testsuite/cargo_init/bin_already_exists_implicit_nosrc/mod.rs diff --git a/src/tools/cargo/tests/testsuite/init/bin_already_exists_implicit_nosrc/out/Cargo.toml b/src/tools/cargo/tests/testsuite/cargo_init/bin_already_exists_implicit_nosrc/out/Cargo.toml index 5c6c9158c..5c6c9158c 100644 --- a/src/tools/cargo/tests/testsuite/init/bin_already_exists_implicit_nosrc/out/Cargo.toml +++ b/src/tools/cargo/tests/testsuite/cargo_init/bin_already_exists_implicit_nosrc/out/Cargo.toml diff --git a/src/tools/cargo/tests/testsuite/init/bin_already_exists_implicit_nosrc/out/main.rs b/src/tools/cargo/tests/testsuite/cargo_init/bin_already_exists_implicit_nosrc/out/main.rs index 65fdcf8da..65fdcf8da 100644 --- a/src/tools/cargo/tests/testsuite/init/bin_already_exists_implicit_nosrc/out/main.rs +++ b/src/tools/cargo/tests/testsuite/cargo_init/bin_already_exists_implicit_nosrc/out/main.rs diff --git a/src/tools/cargo/tests/testsuite/init/bin_already_exists_implicit_nosrc/stderr.log b/src/tools/cargo/tests/testsuite/cargo_init/bin_already_exists_implicit_nosrc/stderr.log index 3847e4e4a..3847e4e4a 100644 --- a/src/tools/cargo/tests/testsuite/init/bin_already_exists_implicit_nosrc/stderr.log +++ b/src/tools/cargo/tests/testsuite/cargo_init/bin_already_exists_implicit_nosrc/stderr.log diff --git a/src/tools/cargo/tests/testsuite/init/inferred_bin_with_git/stdout.log b/src/tools/cargo/tests/testsuite/cargo_init/bin_already_exists_implicit_nosrc/stdout.log index e69de29bb..e69de29bb 100644 --- a/src/tools/cargo/tests/testsuite/init/inferred_bin_with_git/stdout.log +++ b/src/tools/cargo/tests/testsuite/cargo_init/bin_already_exists_implicit_nosrc/stdout.log diff --git a/src/tools/cargo/tests/testsuite/init/both_lib_and_bin/mod.rs b/src/tools/cargo/tests/testsuite/cargo_init/both_lib_and_bin/mod.rs index c9232320a..c9232320a 100644 --- a/src/tools/cargo/tests/testsuite/init/both_lib_and_bin/mod.rs +++ b/src/tools/cargo/tests/testsuite/cargo_init/both_lib_and_bin/mod.rs diff --git a/src/tools/cargo/tests/testsuite/init/both_lib_and_bin/stderr.log b/src/tools/cargo/tests/testsuite/cargo_init/both_lib_and_bin/stderr.log index 9d635a427..9d635a427 100644 --- a/src/tools/cargo/tests/testsuite/init/both_lib_and_bin/stderr.log +++ b/src/tools/cargo/tests/testsuite/cargo_init/both_lib_and_bin/stderr.log diff --git a/src/tools/cargo/tests/testsuite/init/inferred_lib_with_git/stdout.log b/src/tools/cargo/tests/testsuite/cargo_init/both_lib_and_bin/stdout.log index e69de29bb..e69de29bb 100644 --- a/src/tools/cargo/tests/testsuite/init/inferred_lib_with_git/stdout.log +++ b/src/tools/cargo/tests/testsuite/cargo_init/both_lib_and_bin/stdout.log diff --git a/src/tools/cargo/tests/testsuite/init/cant_create_library_when_both_binlib_present/in/case.rs b/src/tools/cargo/tests/testsuite/cargo_init/cant_create_library_when_both_binlib_present/in/case.rs index f328e4d9d..f328e4d9d 100644 --- a/src/tools/cargo/tests/testsuite/init/cant_create_library_when_both_binlib_present/in/case.rs +++ b/src/tools/cargo/tests/testsuite/cargo_init/cant_create_library_when_both_binlib_present/in/case.rs diff --git a/src/tools/cargo/tests/testsuite/init/cant_create_library_when_both_binlib_present/in/lib.rs b/src/tools/cargo/tests/testsuite/cargo_init/cant_create_library_when_both_binlib_present/in/lib.rs index 59760b549..59760b549 100644 --- a/src/tools/cargo/tests/testsuite/init/cant_create_library_when_both_binlib_present/in/lib.rs +++ b/src/tools/cargo/tests/testsuite/cargo_init/cant_create_library_when_both_binlib_present/in/lib.rs diff --git a/src/tools/cargo/tests/testsuite/init/cant_create_library_when_both_binlib_present/mod.rs b/src/tools/cargo/tests/testsuite/cargo_init/cant_create_library_when_both_binlib_present/mod.rs index 5e9e1b94c..5e9e1b94c 100644 --- a/src/tools/cargo/tests/testsuite/init/cant_create_library_when_both_binlib_present/mod.rs +++ b/src/tools/cargo/tests/testsuite/cargo_init/cant_create_library_when_both_binlib_present/mod.rs diff --git a/src/tools/cargo/tests/testsuite/init/cant_create_library_when_both_binlib_present/stderr.log b/src/tools/cargo/tests/testsuite/cargo_init/cant_create_library_when_both_binlib_present/stderr.log index c08dce96b..c08dce96b 100644 --- a/src/tools/cargo/tests/testsuite/init/cant_create_library_when_both_binlib_present/stderr.log +++ b/src/tools/cargo/tests/testsuite/cargo_init/cant_create_library_when_both_binlib_present/stderr.log diff --git a/src/tools/cargo/tests/testsuite/init/inherit_workspace_package_table/stdout.log b/src/tools/cargo/tests/testsuite/cargo_init/cant_create_library_when_both_binlib_present/stdout.log index e69de29bb..e69de29bb 100644 --- a/src/tools/cargo/tests/testsuite/init/inherit_workspace_package_table/stdout.log +++ b/src/tools/cargo/tests/testsuite/cargo_init/cant_create_library_when_both_binlib_present/stdout.log diff --git a/src/tools/cargo/tests/testsuite/init/confused_by_multiple_lib_files/in/lib.rs b/src/tools/cargo/tests/testsuite/cargo_init/confused_by_multiple_lib_files/in/lib.rs index 321163744..321163744 100644 --- a/src/tools/cargo/tests/testsuite/init/confused_by_multiple_lib_files/in/lib.rs +++ b/src/tools/cargo/tests/testsuite/cargo_init/confused_by_multiple_lib_files/in/lib.rs diff --git a/src/tools/cargo/tests/testsuite/init/confused_by_multiple_lib_files/in/src/lib.rs b/src/tools/cargo/tests/testsuite/cargo_init/confused_by_multiple_lib_files/in/src/lib.rs index f71455a1a..f71455a1a 100644 --- a/src/tools/cargo/tests/testsuite/init/confused_by_multiple_lib_files/in/src/lib.rs +++ b/src/tools/cargo/tests/testsuite/cargo_init/confused_by_multiple_lib_files/in/src/lib.rs diff --git a/src/tools/cargo/tests/testsuite/init/confused_by_multiple_lib_files/mod.rs b/src/tools/cargo/tests/testsuite/cargo_init/confused_by_multiple_lib_files/mod.rs index d1cba2ff7..d1cba2ff7 100644 --- a/src/tools/cargo/tests/testsuite/init/confused_by_multiple_lib_files/mod.rs +++ b/src/tools/cargo/tests/testsuite/cargo_init/confused_by_multiple_lib_files/mod.rs diff --git a/src/tools/cargo/tests/testsuite/init/confused_by_multiple_lib_files/out/lib.rs b/src/tools/cargo/tests/testsuite/cargo_init/confused_by_multiple_lib_files/out/lib.rs index 321163744..321163744 100644 --- a/src/tools/cargo/tests/testsuite/init/confused_by_multiple_lib_files/out/lib.rs +++ b/src/tools/cargo/tests/testsuite/cargo_init/confused_by_multiple_lib_files/out/lib.rs diff --git a/src/tools/cargo/tests/testsuite/init/confused_by_multiple_lib_files/out/src/lib.rs b/src/tools/cargo/tests/testsuite/cargo_init/confused_by_multiple_lib_files/out/src/lib.rs index f71455a1a..f71455a1a 100644 --- a/src/tools/cargo/tests/testsuite/init/confused_by_multiple_lib_files/out/src/lib.rs +++ b/src/tools/cargo/tests/testsuite/cargo_init/confused_by_multiple_lib_files/out/src/lib.rs diff --git a/src/tools/cargo/tests/testsuite/init/confused_by_multiple_lib_files/stderr.log b/src/tools/cargo/tests/testsuite/cargo_init/confused_by_multiple_lib_files/stderr.log index 8dbd2aaf0..8dbd2aaf0 100644 --- a/src/tools/cargo/tests/testsuite/init/confused_by_multiple_lib_files/stderr.log +++ b/src/tools/cargo/tests/testsuite/cargo_init/confused_by_multiple_lib_files/stderr.log diff --git a/src/tools/cargo/tests/testsuite/init/invalid_dir_name/stdout.log b/src/tools/cargo/tests/testsuite/cargo_init/confused_by_multiple_lib_files/stdout.log index e69de29bb..e69de29bb 100644 --- a/src/tools/cargo/tests/testsuite/init/invalid_dir_name/stdout.log +++ b/src/tools/cargo/tests/testsuite/cargo_init/confused_by_multiple_lib_files/stdout.log diff --git a/src/tools/cargo/tests/testsuite/init/creates_binary_when_both_binlib_present/in/case.rs b/src/tools/cargo/tests/testsuite/cargo_init/creates_binary_when_both_binlib_present/in/case.rs index f328e4d9d..f328e4d9d 100644 --- a/src/tools/cargo/tests/testsuite/init/creates_binary_when_both_binlib_present/in/case.rs +++ b/src/tools/cargo/tests/testsuite/cargo_init/creates_binary_when_both_binlib_present/in/case.rs diff --git a/src/tools/cargo/tests/testsuite/init/creates_binary_when_both_binlib_present/in/lib.rs b/src/tools/cargo/tests/testsuite/cargo_init/creates_binary_when_both_binlib_present/in/lib.rs index 59760b549..59760b549 100644 --- a/src/tools/cargo/tests/testsuite/init/creates_binary_when_both_binlib_present/in/lib.rs +++ b/src/tools/cargo/tests/testsuite/cargo_init/creates_binary_when_both_binlib_present/in/lib.rs diff --git a/src/tools/cargo/tests/testsuite/init/creates_binary_when_both_binlib_present/mod.rs b/src/tools/cargo/tests/testsuite/cargo_init/creates_binary_when_both_binlib_present/mod.rs index 326bd218a..326bd218a 100644 --- a/src/tools/cargo/tests/testsuite/init/creates_binary_when_both_binlib_present/mod.rs +++ b/src/tools/cargo/tests/testsuite/cargo_init/creates_binary_when_both_binlib_present/mod.rs diff --git a/src/tools/cargo/tests/testsuite/init/creates_binary_when_both_binlib_present/out/Cargo.toml b/src/tools/cargo/tests/testsuite/cargo_init/creates_binary_when_both_binlib_present/out/Cargo.toml index 675c888a5..675c888a5 100644 --- a/src/tools/cargo/tests/testsuite/init/creates_binary_when_both_binlib_present/out/Cargo.toml +++ b/src/tools/cargo/tests/testsuite/cargo_init/creates_binary_when_both_binlib_present/out/Cargo.toml diff --git a/src/tools/cargo/tests/testsuite/init/creates_binary_when_both_binlib_present/out/case.rs b/src/tools/cargo/tests/testsuite/cargo_init/creates_binary_when_both_binlib_present/out/case.rs index f328e4d9d..f328e4d9d 100644 --- a/src/tools/cargo/tests/testsuite/init/creates_binary_when_both_binlib_present/out/case.rs +++ b/src/tools/cargo/tests/testsuite/cargo_init/creates_binary_when_both_binlib_present/out/case.rs diff --git a/src/tools/cargo/tests/testsuite/init/creates_binary_when_both_binlib_present/out/lib.rs b/src/tools/cargo/tests/testsuite/cargo_init/creates_binary_when_both_binlib_present/out/lib.rs index 59760b549..59760b549 100644 --- a/src/tools/cargo/tests/testsuite/init/creates_binary_when_both_binlib_present/out/lib.rs +++ b/src/tools/cargo/tests/testsuite/cargo_init/creates_binary_when_both_binlib_present/out/lib.rs diff --git a/src/tools/cargo/tests/testsuite/init/creates_binary_when_both_binlib_present/stderr.log b/src/tools/cargo/tests/testsuite/cargo_init/creates_binary_when_both_binlib_present/stderr.log index 3847e4e4a..3847e4e4a 100644 --- a/src/tools/cargo/tests/testsuite/init/creates_binary_when_both_binlib_present/stderr.log +++ b/src/tools/cargo/tests/testsuite/cargo_init/creates_binary_when_both_binlib_present/stderr.log diff --git a/src/tools/cargo/tests/testsuite/init/lib_already_exists_nosrc/stdout.log b/src/tools/cargo/tests/testsuite/cargo_init/creates_binary_when_both_binlib_present/stdout.log index e69de29bb..e69de29bb 100644 --- a/src/tools/cargo/tests/testsuite/init/lib_already_exists_nosrc/stdout.log +++ b/src/tools/cargo/tests/testsuite/cargo_init/creates_binary_when_both_binlib_present/stdout.log diff --git a/src/tools/cargo/tests/testsuite/init/creates_binary_when_instructed_and_has_lib_file/in/case.rs b/src/tools/cargo/tests/testsuite/cargo_init/creates_binary_when_instructed_and_has_lib_file/in/case.rs index 59760b549..59760b549 100644 --- a/src/tools/cargo/tests/testsuite/init/creates_binary_when_instructed_and_has_lib_file/in/case.rs +++ b/src/tools/cargo/tests/testsuite/cargo_init/creates_binary_when_instructed_and_has_lib_file/in/case.rs diff --git a/src/tools/cargo/tests/testsuite/init/creates_binary_when_instructed_and_has_lib_file/mod.rs b/src/tools/cargo/tests/testsuite/cargo_init/creates_binary_when_instructed_and_has_lib_file/mod.rs index 326bd218a..326bd218a 100644 --- a/src/tools/cargo/tests/testsuite/init/creates_binary_when_instructed_and_has_lib_file/mod.rs +++ b/src/tools/cargo/tests/testsuite/cargo_init/creates_binary_when_instructed_and_has_lib_file/mod.rs diff --git a/src/tools/cargo/tests/testsuite/init/creates_binary_when_instructed_and_has_lib_file/out/Cargo.toml b/src/tools/cargo/tests/testsuite/cargo_init/creates_binary_when_instructed_and_has_lib_file/out/Cargo.toml index 8da5fe778..8da5fe778 100644 --- a/src/tools/cargo/tests/testsuite/init/creates_binary_when_instructed_and_has_lib_file/out/Cargo.toml +++ b/src/tools/cargo/tests/testsuite/cargo_init/creates_binary_when_instructed_and_has_lib_file/out/Cargo.toml diff --git a/src/tools/cargo/tests/testsuite/init/creates_binary_when_instructed_and_has_lib_file/out/case.rs b/src/tools/cargo/tests/testsuite/cargo_init/creates_binary_when_instructed_and_has_lib_file/out/case.rs index 59760b549..59760b549 100644 --- a/src/tools/cargo/tests/testsuite/init/creates_binary_when_instructed_and_has_lib_file/out/case.rs +++ b/src/tools/cargo/tests/testsuite/cargo_init/creates_binary_when_instructed_and_has_lib_file/out/case.rs diff --git a/src/tools/cargo/tests/testsuite/init/creates_binary_when_instructed_and_has_lib_file/stderr.log b/src/tools/cargo/tests/testsuite/cargo_init/creates_binary_when_instructed_and_has_lib_file/stderr.log index ec428f31c..ec428f31c 100644 --- a/src/tools/cargo/tests/testsuite/init/creates_binary_when_instructed_and_has_lib_file/stderr.log +++ b/src/tools/cargo/tests/testsuite/cargo_init/creates_binary_when_instructed_and_has_lib_file/stderr.log diff --git a/src/tools/cargo/tests/testsuite/init/lib_already_exists_src/stdout.log b/src/tools/cargo/tests/testsuite/cargo_init/creates_binary_when_instructed_and_has_lib_file/stdout.log index e69de29bb..e69de29bb 100644 --- a/src/tools/cargo/tests/testsuite/init/lib_already_exists_src/stdout.log +++ b/src/tools/cargo/tests/testsuite/cargo_init/creates_binary_when_instructed_and_has_lib_file/stdout.log diff --git a/src/tools/cargo/tests/testsuite/init/creates_library_when_instructed_and_has_bin_file/in/case.rs b/src/tools/cargo/tests/testsuite/cargo_init/creates_library_when_instructed_and_has_bin_file/in/case.rs index f328e4d9d..f328e4d9d 100644 --- a/src/tools/cargo/tests/testsuite/init/creates_library_when_instructed_and_has_bin_file/in/case.rs +++ b/src/tools/cargo/tests/testsuite/cargo_init/creates_library_when_instructed_and_has_bin_file/in/case.rs diff --git a/src/tools/cargo/tests/testsuite/init/creates_library_when_instructed_and_has_bin_file/mod.rs b/src/tools/cargo/tests/testsuite/cargo_init/creates_library_when_instructed_and_has_bin_file/mod.rs index 59c192cb9..59c192cb9 100644 --- a/src/tools/cargo/tests/testsuite/init/creates_library_when_instructed_and_has_bin_file/mod.rs +++ b/src/tools/cargo/tests/testsuite/cargo_init/creates_library_when_instructed_and_has_bin_file/mod.rs diff --git a/src/tools/cargo/tests/testsuite/init/creates_library_when_instructed_and_has_bin_file/out/Cargo.toml b/src/tools/cargo/tests/testsuite/cargo_init/creates_library_when_instructed_and_has_bin_file/out/Cargo.toml index 2c0464468..2c0464468 100644 --- a/src/tools/cargo/tests/testsuite/init/creates_library_when_instructed_and_has_bin_file/out/Cargo.toml +++ b/src/tools/cargo/tests/testsuite/cargo_init/creates_library_when_instructed_and_has_bin_file/out/Cargo.toml diff --git a/src/tools/cargo/tests/testsuite/init/creates_library_when_instructed_and_has_bin_file/out/case.rs b/src/tools/cargo/tests/testsuite/cargo_init/creates_library_when_instructed_and_has_bin_file/out/case.rs index f328e4d9d..f328e4d9d 100644 --- a/src/tools/cargo/tests/testsuite/init/creates_library_when_instructed_and_has_bin_file/out/case.rs +++ b/src/tools/cargo/tests/testsuite/cargo_init/creates_library_when_instructed_and_has_bin_file/out/case.rs diff --git a/src/tools/cargo/tests/testsuite/init/creates_library_when_instructed_and_has_bin_file/stderr.log b/src/tools/cargo/tests/testsuite/cargo_init/creates_library_when_instructed_and_has_bin_file/stderr.log index bf070e2da..bf070e2da 100644 --- a/src/tools/cargo/tests/testsuite/init/creates_library_when_instructed_and_has_bin_file/stderr.log +++ b/src/tools/cargo/tests/testsuite/cargo_init/creates_library_when_instructed_and_has_bin_file/stderr.log diff --git a/src/tools/cargo/tests/testsuite/init/mercurial_autodetect/stdout.log b/src/tools/cargo/tests/testsuite/cargo_init/creates_library_when_instructed_and_has_bin_file/stdout.log index e69de29bb..e69de29bb 100644 --- a/src/tools/cargo/tests/testsuite/init/mercurial_autodetect/stdout.log +++ b/src/tools/cargo/tests/testsuite/cargo_init/creates_library_when_instructed_and_has_bin_file/stdout.log diff --git a/src/tools/cargo/tests/testsuite/init/empty_dir/.keep b/src/tools/cargo/tests/testsuite/cargo_init/empty_dir/.keep index e69de29bb..e69de29bb 100644 --- a/src/tools/cargo/tests/testsuite/init/empty_dir/.keep +++ b/src/tools/cargo/tests/testsuite/cargo_init/empty_dir/.keep diff --git a/src/tools/cargo/tests/testsuite/init/empty_dir/mod.rs b/src/tools/cargo/tests/testsuite/cargo_init/empty_dir/mod.rs index 074954f01..074954f01 100644 --- a/src/tools/cargo/tests/testsuite/init/empty_dir/mod.rs +++ b/src/tools/cargo/tests/testsuite/cargo_init/empty_dir/mod.rs diff --git a/src/tools/cargo/tests/testsuite/init/explicit_bin_with_git/in b/src/tools/cargo/tests/testsuite/cargo_init/explicit_bin_with_git/in index 1202506b6..1202506b6 120000 --- a/src/tools/cargo/tests/testsuite/init/explicit_bin_with_git/in +++ b/src/tools/cargo/tests/testsuite/cargo_init/explicit_bin_with_git/in diff --git a/src/tools/cargo/tests/testsuite/init/explicit_bin_with_git/mod.rs b/src/tools/cargo/tests/testsuite/cargo_init/explicit_bin_with_git/mod.rs index 7314e955c..7314e955c 100644 --- a/src/tools/cargo/tests/testsuite/init/explicit_bin_with_git/mod.rs +++ b/src/tools/cargo/tests/testsuite/cargo_init/explicit_bin_with_git/mod.rs diff --git a/src/tools/cargo/tests/testsuite/init/explicit_bin_with_git/out/Cargo.toml b/src/tools/cargo/tests/testsuite/cargo_init/explicit_bin_with_git/out/Cargo.toml index dcdb8da2c..dcdb8da2c 100644 --- a/src/tools/cargo/tests/testsuite/init/explicit_bin_with_git/out/Cargo.toml +++ b/src/tools/cargo/tests/testsuite/cargo_init/explicit_bin_with_git/out/Cargo.toml diff --git a/src/tools/cargo/tests/testsuite/init/explicit_bin_with_git/out/src/main.rs b/src/tools/cargo/tests/testsuite/cargo_init/explicit_bin_with_git/out/src/main.rs index e7a11a969..e7a11a969 100644 --- a/src/tools/cargo/tests/testsuite/init/explicit_bin_with_git/out/src/main.rs +++ b/src/tools/cargo/tests/testsuite/cargo_init/explicit_bin_with_git/out/src/main.rs diff --git a/src/tools/cargo/tests/testsuite/init/explicit_bin_with_git/stderr.log b/src/tools/cargo/tests/testsuite/cargo_init/explicit_bin_with_git/stderr.log index 3847e4e4a..3847e4e4a 100644 --- a/src/tools/cargo/tests/testsuite/init/explicit_bin_with_git/stderr.log +++ b/src/tools/cargo/tests/testsuite/cargo_init/explicit_bin_with_git/stderr.log diff --git a/src/tools/cargo/tests/testsuite/init/multibin_project_name_clash/stdout.log b/src/tools/cargo/tests/testsuite/cargo_init/explicit_bin_with_git/stdout.log index e69de29bb..e69de29bb 100644 --- a/src/tools/cargo/tests/testsuite/init/multibin_project_name_clash/stdout.log +++ b/src/tools/cargo/tests/testsuite/cargo_init/explicit_bin_with_git/stdout.log diff --git a/src/tools/cargo/tests/testsuite/init/formats_source/in/rustfmt.toml b/src/tools/cargo/tests/testsuite/cargo_init/formats_source/in/rustfmt.toml index b196eaa2d..b196eaa2d 100644 --- a/src/tools/cargo/tests/testsuite/init/formats_source/in/rustfmt.toml +++ b/src/tools/cargo/tests/testsuite/cargo_init/formats_source/in/rustfmt.toml diff --git a/src/tools/cargo/tests/testsuite/init/formats_source/mod.rs b/src/tools/cargo/tests/testsuite/cargo_init/formats_source/mod.rs index ac1fb6271..ac1fb6271 100644 --- a/src/tools/cargo/tests/testsuite/init/formats_source/mod.rs +++ b/src/tools/cargo/tests/testsuite/cargo_init/formats_source/mod.rs diff --git a/src/tools/cargo/tests/testsuite/init/formats_source/out/Cargo.toml b/src/tools/cargo/tests/testsuite/cargo_init/formats_source/out/Cargo.toml index dcdb8da2c..dcdb8da2c 100644 --- a/src/tools/cargo/tests/testsuite/init/formats_source/out/Cargo.toml +++ b/src/tools/cargo/tests/testsuite/cargo_init/formats_source/out/Cargo.toml diff --git a/src/tools/cargo/tests/testsuite/init/formats_source/out/rustfmt.toml b/src/tools/cargo/tests/testsuite/cargo_init/formats_source/out/rustfmt.toml index b196eaa2d..b196eaa2d 100644 --- a/src/tools/cargo/tests/testsuite/init/formats_source/out/rustfmt.toml +++ b/src/tools/cargo/tests/testsuite/cargo_init/formats_source/out/rustfmt.toml diff --git a/src/tools/cargo/tests/testsuite/init/formats_source/out/src/lib.rs b/src/tools/cargo/tests/testsuite/cargo_init/formats_source/out/src/lib.rs index 3b9acffd5..3b9acffd5 100644 --- a/src/tools/cargo/tests/testsuite/init/formats_source/out/src/lib.rs +++ b/src/tools/cargo/tests/testsuite/cargo_init/formats_source/out/src/lib.rs diff --git a/src/tools/cargo/tests/testsuite/init/formats_source/stderr.log b/src/tools/cargo/tests/testsuite/cargo_init/formats_source/stderr.log index f459bf226..f459bf226 100644 --- a/src/tools/cargo/tests/testsuite/init/formats_source/stderr.log +++ b/src/tools/cargo/tests/testsuite/cargo_init/formats_source/stderr.log diff --git a/src/tools/cargo/tests/testsuite/init/no_filename/stdout.log b/src/tools/cargo/tests/testsuite/cargo_init/formats_source/stdout.log index e69de29bb..e69de29bb 100644 --- a/src/tools/cargo/tests/testsuite/init/no_filename/stdout.log +++ b/src/tools/cargo/tests/testsuite/cargo_init/formats_source/stdout.log diff --git a/src/tools/cargo/tests/testsuite/init/fossil_autodetect/in/.fossil/.keep b/src/tools/cargo/tests/testsuite/cargo_init/fossil_autodetect/in/.fossil/.keep index e69de29bb..e69de29bb 100644 --- a/src/tools/cargo/tests/testsuite/init/fossil_autodetect/in/.fossil/.keep +++ b/src/tools/cargo/tests/testsuite/cargo_init/fossil_autodetect/in/.fossil/.keep diff --git a/src/tools/cargo/tests/testsuite/init/fossil_autodetect/mod.rs b/src/tools/cargo/tests/testsuite/cargo_init/fossil_autodetect/mod.rs index d45ba868a..d45ba868a 100644 --- a/src/tools/cargo/tests/testsuite/init/fossil_autodetect/mod.rs +++ b/src/tools/cargo/tests/testsuite/cargo_init/fossil_autodetect/mod.rs diff --git a/src/tools/cargo/tests/testsuite/init/fossil_autodetect/out/.fossil-settings/clean-glob b/src/tools/cargo/tests/testsuite/cargo_init/fossil_autodetect/out/.fossil-settings/clean-glob index a9d37c560..a9d37c560 100644 --- a/src/tools/cargo/tests/testsuite/init/fossil_autodetect/out/.fossil-settings/clean-glob +++ b/src/tools/cargo/tests/testsuite/cargo_init/fossil_autodetect/out/.fossil-settings/clean-glob diff --git a/src/tools/cargo/tests/testsuite/init/fossil_autodetect/out/.fossil-settings/ignore-glob b/src/tools/cargo/tests/testsuite/cargo_init/fossil_autodetect/out/.fossil-settings/ignore-glob index a9d37c560..a9d37c560 100644 --- a/src/tools/cargo/tests/testsuite/init/fossil_autodetect/out/.fossil-settings/ignore-glob +++ b/src/tools/cargo/tests/testsuite/cargo_init/fossil_autodetect/out/.fossil-settings/ignore-glob diff --git a/src/tools/cargo/tests/testsuite/init/fossil_autodetect/out/Cargo.toml b/src/tools/cargo/tests/testsuite/cargo_init/fossil_autodetect/out/Cargo.toml index dcdb8da2c..dcdb8da2c 100644 --- a/src/tools/cargo/tests/testsuite/init/fossil_autodetect/out/Cargo.toml +++ b/src/tools/cargo/tests/testsuite/cargo_init/fossil_autodetect/out/Cargo.toml diff --git a/src/tools/cargo/tests/testsuite/init/fossil_autodetect/out/src/lib.rs b/src/tools/cargo/tests/testsuite/cargo_init/fossil_autodetect/out/src/lib.rs index 7d12d9af8..7d12d9af8 100644 --- a/src/tools/cargo/tests/testsuite/init/fossil_autodetect/out/src/lib.rs +++ b/src/tools/cargo/tests/testsuite/cargo_init/fossil_autodetect/out/src/lib.rs diff --git a/src/tools/cargo/tests/testsuite/init/fossil_autodetect/stderr.log b/src/tools/cargo/tests/testsuite/cargo_init/fossil_autodetect/stderr.log index f459bf226..f459bf226 100644 --- a/src/tools/cargo/tests/testsuite/init/fossil_autodetect/stderr.log +++ b/src/tools/cargo/tests/testsuite/cargo_init/fossil_autodetect/stderr.log diff --git a/src/tools/cargo/tests/testsuite/init/path_contains_separator/stdout.log b/src/tools/cargo/tests/testsuite/cargo_init/fossil_autodetect/stdout.log index e69de29bb..e69de29bb 100644 --- a/src/tools/cargo/tests/testsuite/init/path_contains_separator/stdout.log +++ b/src/tools/cargo/tests/testsuite/cargo_init/fossil_autodetect/stdout.log diff --git a/src/tools/cargo/tests/testsuite/init/git_autodetect/mod.rs b/src/tools/cargo/tests/testsuite/cargo_init/git_autodetect/mod.rs index aef47bc7d..aef47bc7d 100644 --- a/src/tools/cargo/tests/testsuite/init/git_autodetect/mod.rs +++ b/src/tools/cargo/tests/testsuite/cargo_init/git_autodetect/mod.rs diff --git a/src/tools/cargo/tests/testsuite/init/git_autodetect/out/Cargo.toml b/src/tools/cargo/tests/testsuite/cargo_init/git_autodetect/out/Cargo.toml index 1d9cfe317..1d9cfe317 100644 --- a/src/tools/cargo/tests/testsuite/init/git_autodetect/out/Cargo.toml +++ b/src/tools/cargo/tests/testsuite/cargo_init/git_autodetect/out/Cargo.toml diff --git a/src/tools/cargo/tests/testsuite/init/git_autodetect/out/src/lib.rs b/src/tools/cargo/tests/testsuite/cargo_init/git_autodetect/out/src/lib.rs index 7d12d9af8..7d12d9af8 100644 --- a/src/tools/cargo/tests/testsuite/init/git_autodetect/out/src/lib.rs +++ b/src/tools/cargo/tests/testsuite/cargo_init/git_autodetect/out/src/lib.rs diff --git a/src/tools/cargo/tests/testsuite/init/git_autodetect/stderr.log b/src/tools/cargo/tests/testsuite/cargo_init/git_autodetect/stderr.log index f459bf226..f459bf226 100644 --- a/src/tools/cargo/tests/testsuite/init/git_autodetect/stderr.log +++ b/src/tools/cargo/tests/testsuite/cargo_init/git_autodetect/stderr.log diff --git a/src/tools/cargo/tests/testsuite/init/pijul_autodetect/stdout.log b/src/tools/cargo/tests/testsuite/cargo_init/git_autodetect/stdout.log index e69de29bb..e69de29bb 100644 --- a/src/tools/cargo/tests/testsuite/init/pijul_autodetect/stdout.log +++ b/src/tools/cargo/tests/testsuite/cargo_init/git_autodetect/stdout.log diff --git a/src/tools/cargo/tests/testsuite/init/git_ignore_exists_no_conflicting_entries/mod.rs b/src/tools/cargo/tests/testsuite/cargo_init/git_ignore_exists_no_conflicting_entries/mod.rs index cd4437c65..cd4437c65 100644 --- a/src/tools/cargo/tests/testsuite/init/git_ignore_exists_no_conflicting_entries/mod.rs +++ b/src/tools/cargo/tests/testsuite/cargo_init/git_ignore_exists_no_conflicting_entries/mod.rs diff --git a/src/tools/cargo/tests/testsuite/init/git_ignore_exists_no_conflicting_entries/out/Cargo.toml b/src/tools/cargo/tests/testsuite/cargo_init/git_ignore_exists_no_conflicting_entries/out/Cargo.toml index a6269fdcd..a6269fdcd 100644 --- a/src/tools/cargo/tests/testsuite/init/git_ignore_exists_no_conflicting_entries/out/Cargo.toml +++ b/src/tools/cargo/tests/testsuite/cargo_init/git_ignore_exists_no_conflicting_entries/out/Cargo.toml diff --git a/src/tools/cargo/tests/testsuite/init/git_ignore_exists_no_conflicting_entries/out/src/lib.rs b/src/tools/cargo/tests/testsuite/cargo_init/git_ignore_exists_no_conflicting_entries/out/src/lib.rs index 7d12d9af8..7d12d9af8 100644 --- a/src/tools/cargo/tests/testsuite/init/git_ignore_exists_no_conflicting_entries/out/src/lib.rs +++ b/src/tools/cargo/tests/testsuite/cargo_init/git_ignore_exists_no_conflicting_entries/out/src/lib.rs diff --git a/src/tools/cargo/tests/testsuite/init/git_ignore_exists_no_conflicting_entries/stderr.log b/src/tools/cargo/tests/testsuite/cargo_init/git_ignore_exists_no_conflicting_entries/stderr.log index f459bf226..f459bf226 100644 --- a/src/tools/cargo/tests/testsuite/init/git_ignore_exists_no_conflicting_entries/stderr.log +++ b/src/tools/cargo/tests/testsuite/cargo_init/git_ignore_exists_no_conflicting_entries/stderr.log diff --git a/src/tools/cargo/tests/testsuite/init/reserved_name/stdout.log b/src/tools/cargo/tests/testsuite/cargo_init/git_ignore_exists_no_conflicting_entries/stdout.log index e69de29bb..e69de29bb 100644 --- a/src/tools/cargo/tests/testsuite/init/reserved_name/stdout.log +++ b/src/tools/cargo/tests/testsuite/cargo_init/git_ignore_exists_no_conflicting_entries/stdout.log diff --git a/src/tools/cargo/tests/testsuite/cargo_init/help/mod.rs b/src/tools/cargo/tests/testsuite/cargo_init/help/mod.rs new file mode 100644 index 000000000..7f00d347a --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_init/help/mod.rs @@ -0,0 +1,13 @@ +use cargo_test_support::curr_dir; +use cargo_test_support::prelude::*; + +#[cargo_test] +fn case() { + snapbox::cmd::Command::cargo_ui() + .arg("init") + .arg("--help") + .assert() + .success() + .stdout_matches_path(curr_dir!().join("stdout.log")) + .stderr_matches_path(curr_dir!().join("stderr.log")); +} diff --git a/src/tools/cargo/tests/testsuite/init/inherit_workspace_package_table/in/README.md b/src/tools/cargo/tests/testsuite/cargo_init/help/stderr.log index e69de29bb..e69de29bb 100644 --- a/src/tools/cargo/tests/testsuite/init/inherit_workspace_package_table/in/README.md +++ b/src/tools/cargo/tests/testsuite/cargo_init/help/stderr.log diff --git a/src/tools/cargo/tests/testsuite/cargo_init/help/stdout.log b/src/tools/cargo/tests/testsuite/cargo_init/help/stdout.log new file mode 100644 index 000000000..5dfb02498 --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_init/help/stdout.log @@ -0,0 +1,31 @@ +Create a new cargo package in an existing directory + +Usage: cargo[EXE] init [OPTIONS] [path] + +Arguments: + [path] [default: .] + +Options: + --vcs <VCS> Initialize a new repository for the given version control system (git, + hg, pijul, or fossil) or do not initialize any version control at all + (none), overriding a global configuration. [possible values: git, hg, + pijul, fossil, none] + --bin Use a binary (application) template [default] + --lib Use a library template + --edition <YEAR> Edition to set for the crate generated [possible values: 2015, 2018, + 2021] + --name <NAME> Set the resulting package name, defaults to the directory name + --registry <REGISTRY> Registry to use + -q, --quiet Do not print cargo log messages + -v, --verbose... Use verbose output (-vv very verbose/build.rs output) + --color <WHEN> Coloring: auto, always, never + --config <KEY=VALUE> Override a configuration value + -Z <FLAG> Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for details + -h, --help Print help + +Manifest Options: + --frozen Require Cargo.lock and cache are up to date + --locked Require Cargo.lock is up to date + --offline Run without accessing the network + +Run `cargo help init` for more detailed information. diff --git a/src/tools/cargo/tests/testsuite/init/ignores_failure_to_format_source/in/rustfmt.toml b/src/tools/cargo/tests/testsuite/cargo_init/ignores_failure_to_format_source/in/rustfmt.toml index b196eaa2d..b196eaa2d 100644 --- a/src/tools/cargo/tests/testsuite/init/ignores_failure_to_format_source/in/rustfmt.toml +++ b/src/tools/cargo/tests/testsuite/cargo_init/ignores_failure_to_format_source/in/rustfmt.toml diff --git a/src/tools/cargo/tests/testsuite/init/ignores_failure_to_format_source/mod.rs b/src/tools/cargo/tests/testsuite/cargo_init/ignores_failure_to_format_source/mod.rs index fd9394049..fd9394049 100644 --- a/src/tools/cargo/tests/testsuite/init/ignores_failure_to_format_source/mod.rs +++ b/src/tools/cargo/tests/testsuite/cargo_init/ignores_failure_to_format_source/mod.rs diff --git a/src/tools/cargo/tests/testsuite/init/ignores_failure_to_format_source/out/Cargo.toml b/src/tools/cargo/tests/testsuite/cargo_init/ignores_failure_to_format_source/out/Cargo.toml index dcdb8da2c..dcdb8da2c 100644 --- a/src/tools/cargo/tests/testsuite/init/ignores_failure_to_format_source/out/Cargo.toml +++ b/src/tools/cargo/tests/testsuite/cargo_init/ignores_failure_to_format_source/out/Cargo.toml diff --git a/src/tools/cargo/tests/testsuite/init/ignores_failure_to_format_source/out/rustfmt.toml b/src/tools/cargo/tests/testsuite/cargo_init/ignores_failure_to_format_source/out/rustfmt.toml index b196eaa2d..b196eaa2d 100644 --- a/src/tools/cargo/tests/testsuite/init/ignores_failure_to_format_source/out/rustfmt.toml +++ b/src/tools/cargo/tests/testsuite/cargo_init/ignores_failure_to_format_source/out/rustfmt.toml diff --git a/src/tools/cargo/tests/testsuite/init/ignores_failure_to_format_source/out/src/lib.rs b/src/tools/cargo/tests/testsuite/cargo_init/ignores_failure_to_format_source/out/src/lib.rs index 7d12d9af8..7d12d9af8 100644 --- a/src/tools/cargo/tests/testsuite/init/ignores_failure_to_format_source/out/src/lib.rs +++ b/src/tools/cargo/tests/testsuite/cargo_init/ignores_failure_to_format_source/out/src/lib.rs diff --git a/src/tools/cargo/tests/testsuite/init/ignores_failure_to_format_source/stderr.log b/src/tools/cargo/tests/testsuite/cargo_init/ignores_failure_to_format_source/stderr.log index f459bf226..f459bf226 100644 --- a/src/tools/cargo/tests/testsuite/init/ignores_failure_to_format_source/stderr.log +++ b/src/tools/cargo/tests/testsuite/cargo_init/ignores_failure_to_format_source/stderr.log diff --git a/src/tools/cargo/tests/testsuite/init/simple_bin/stdout.log b/src/tools/cargo/tests/testsuite/cargo_init/ignores_failure_to_format_source/stdout.log index e69de29bb..e69de29bb 100644 --- a/src/tools/cargo/tests/testsuite/init/simple_bin/stdout.log +++ b/src/tools/cargo/tests/testsuite/cargo_init/ignores_failure_to_format_source/stdout.log diff --git a/src/tools/cargo/tests/testsuite/init/inferred_bin_with_git/in/main.rs b/src/tools/cargo/tests/testsuite/cargo_init/inferred_bin_with_git/in/main.rs index f328e4d9d..f328e4d9d 100644 --- a/src/tools/cargo/tests/testsuite/init/inferred_bin_with_git/in/main.rs +++ b/src/tools/cargo/tests/testsuite/cargo_init/inferred_bin_with_git/in/main.rs diff --git a/src/tools/cargo/tests/testsuite/init/inferred_bin_with_git/mod.rs b/src/tools/cargo/tests/testsuite/cargo_init/inferred_bin_with_git/mod.rs index 80bec8893..80bec8893 100644 --- a/src/tools/cargo/tests/testsuite/init/inferred_bin_with_git/mod.rs +++ b/src/tools/cargo/tests/testsuite/cargo_init/inferred_bin_with_git/mod.rs diff --git a/src/tools/cargo/tests/testsuite/init/inferred_bin_with_git/out/Cargo.toml b/src/tools/cargo/tests/testsuite/cargo_init/inferred_bin_with_git/out/Cargo.toml index 5c6c9158c..5c6c9158c 100644 --- a/src/tools/cargo/tests/testsuite/init/inferred_bin_with_git/out/Cargo.toml +++ b/src/tools/cargo/tests/testsuite/cargo_init/inferred_bin_with_git/out/Cargo.toml diff --git a/src/tools/cargo/tests/testsuite/init/inferred_bin_with_git/out/main.rs b/src/tools/cargo/tests/testsuite/cargo_init/inferred_bin_with_git/out/main.rs index f328e4d9d..f328e4d9d 100644 --- a/src/tools/cargo/tests/testsuite/init/inferred_bin_with_git/out/main.rs +++ b/src/tools/cargo/tests/testsuite/cargo_init/inferred_bin_with_git/out/main.rs diff --git a/src/tools/cargo/tests/testsuite/init/inferred_bin_with_git/stderr.log b/src/tools/cargo/tests/testsuite/cargo_init/inferred_bin_with_git/stderr.log index 3847e4e4a..3847e4e4a 100644 --- a/src/tools/cargo/tests/testsuite/init/inferred_bin_with_git/stderr.log +++ b/src/tools/cargo/tests/testsuite/cargo_init/inferred_bin_with_git/stderr.log diff --git a/src/tools/cargo/tests/testsuite/init/simple_git/stdout.log b/src/tools/cargo/tests/testsuite/cargo_init/inferred_bin_with_git/stdout.log index e69de29bb..e69de29bb 100644 --- a/src/tools/cargo/tests/testsuite/init/simple_git/stdout.log +++ b/src/tools/cargo/tests/testsuite/cargo_init/inferred_bin_with_git/stdout.log diff --git a/src/tools/cargo/tests/testsuite/init/inferred_lib_with_git/in/lib.rs b/src/tools/cargo/tests/testsuite/cargo_init/inferred_lib_with_git/in/lib.rs index 59760b549..59760b549 100644 --- a/src/tools/cargo/tests/testsuite/init/inferred_lib_with_git/in/lib.rs +++ b/src/tools/cargo/tests/testsuite/cargo_init/inferred_lib_with_git/in/lib.rs diff --git a/src/tools/cargo/tests/testsuite/init/inferred_lib_with_git/mod.rs b/src/tools/cargo/tests/testsuite/cargo_init/inferred_lib_with_git/mod.rs index 80bec8893..80bec8893 100644 --- a/src/tools/cargo/tests/testsuite/init/inferred_lib_with_git/mod.rs +++ b/src/tools/cargo/tests/testsuite/cargo_init/inferred_lib_with_git/mod.rs diff --git a/src/tools/cargo/tests/testsuite/init/inferred_lib_with_git/out/Cargo.toml b/src/tools/cargo/tests/testsuite/cargo_init/inferred_lib_with_git/out/Cargo.toml index 39e95fe94..39e95fe94 100644 --- a/src/tools/cargo/tests/testsuite/init/inferred_lib_with_git/out/Cargo.toml +++ b/src/tools/cargo/tests/testsuite/cargo_init/inferred_lib_with_git/out/Cargo.toml diff --git a/src/tools/cargo/tests/testsuite/init/inferred_lib_with_git/out/lib.rs b/src/tools/cargo/tests/testsuite/cargo_init/inferred_lib_with_git/out/lib.rs index 59760b549..59760b549 100644 --- a/src/tools/cargo/tests/testsuite/init/inferred_lib_with_git/out/lib.rs +++ b/src/tools/cargo/tests/testsuite/cargo_init/inferred_lib_with_git/out/lib.rs diff --git a/src/tools/cargo/tests/testsuite/init/inferred_lib_with_git/stderr.log b/src/tools/cargo/tests/testsuite/cargo_init/inferred_lib_with_git/stderr.log index f459bf226..f459bf226 100644 --- a/src/tools/cargo/tests/testsuite/init/inferred_lib_with_git/stderr.log +++ b/src/tools/cargo/tests/testsuite/cargo_init/inferred_lib_with_git/stderr.log diff --git a/src/tools/cargo/tests/testsuite/init/simple_git_ignore_exists/stdout.log b/src/tools/cargo/tests/testsuite/cargo_init/inferred_lib_with_git/stdout.log index e69de29bb..e69de29bb 100644 --- a/src/tools/cargo/tests/testsuite/init/simple_git_ignore_exists/stdout.log +++ b/src/tools/cargo/tests/testsuite/cargo_init/inferred_lib_with_git/stdout.log diff --git a/src/tools/cargo/tests/testsuite/init/inherit_workspace_package_table/in/Cargo.toml b/src/tools/cargo/tests/testsuite/cargo_init/inherit_workspace_package_table/in/Cargo.toml index b7a2e9036..b7a2e9036 100644 --- a/src/tools/cargo/tests/testsuite/init/inherit_workspace_package_table/in/Cargo.toml +++ b/src/tools/cargo/tests/testsuite/cargo_init/inherit_workspace_package_table/in/Cargo.toml diff --git a/src/tools/cargo/tests/testsuite/init/lib_already_exists_nosrc/in/lib.rs b/src/tools/cargo/tests/testsuite/cargo_init/inherit_workspace_package_table/in/README.md index e69de29bb..e69de29bb 100644 --- a/src/tools/cargo/tests/testsuite/init/lib_already_exists_nosrc/in/lib.rs +++ b/src/tools/cargo/tests/testsuite/cargo_init/inherit_workspace_package_table/in/README.md diff --git a/src/tools/cargo/tests/testsuite/init/inherit_workspace_package_table/in/crates/foo/src/main.rs b/src/tools/cargo/tests/testsuite/cargo_init/inherit_workspace_package_table/in/crates/foo/src/main.rs index 43f0dac5e..43f0dac5e 100644 --- a/src/tools/cargo/tests/testsuite/init/inherit_workspace_package_table/in/crates/foo/src/main.rs +++ b/src/tools/cargo/tests/testsuite/cargo_init/inherit_workspace_package_table/in/crates/foo/src/main.rs diff --git a/src/tools/cargo/tests/testsuite/init/inherit_workspace_package_table/in/src/lib.rs b/src/tools/cargo/tests/testsuite/cargo_init/inherit_workspace_package_table/in/src/lib.rs index 7d12d9af8..7d12d9af8 100644 --- a/src/tools/cargo/tests/testsuite/init/inherit_workspace_package_table/in/src/lib.rs +++ b/src/tools/cargo/tests/testsuite/cargo_init/inherit_workspace_package_table/in/src/lib.rs diff --git a/src/tools/cargo/tests/testsuite/init/inherit_workspace_package_table/mod.rs b/src/tools/cargo/tests/testsuite/cargo_init/inherit_workspace_package_table/mod.rs index 4e1dda845..4e1dda845 100644 --- a/src/tools/cargo/tests/testsuite/init/inherit_workspace_package_table/mod.rs +++ b/src/tools/cargo/tests/testsuite/cargo_init/inherit_workspace_package_table/mod.rs diff --git a/src/tools/cargo/tests/testsuite/init/inherit_workspace_package_table/out/Cargo.toml b/src/tools/cargo/tests/testsuite/cargo_init/inherit_workspace_package_table/out/Cargo.toml index b7a2e9036..b7a2e9036 100644 --- a/src/tools/cargo/tests/testsuite/init/inherit_workspace_package_table/out/Cargo.toml +++ b/src/tools/cargo/tests/testsuite/cargo_init/inherit_workspace_package_table/out/Cargo.toml diff --git a/src/tools/cargo/tests/testsuite/init/inherit_workspace_package_table/out/crates/foo/Cargo.toml b/src/tools/cargo/tests/testsuite/cargo_init/inherit_workspace_package_table/out/crates/foo/Cargo.toml index 137ed1c87..137ed1c87 100644 --- a/src/tools/cargo/tests/testsuite/init/inherit_workspace_package_table/out/crates/foo/Cargo.toml +++ b/src/tools/cargo/tests/testsuite/cargo_init/inherit_workspace_package_table/out/crates/foo/Cargo.toml diff --git a/src/tools/cargo/tests/testsuite/init/inherit_workspace_package_table/out/crates/foo/src/main.rs b/src/tools/cargo/tests/testsuite/cargo_init/inherit_workspace_package_table/out/crates/foo/src/main.rs index 43f0dac5e..43f0dac5e 100644 --- a/src/tools/cargo/tests/testsuite/init/inherit_workspace_package_table/out/crates/foo/src/main.rs +++ b/src/tools/cargo/tests/testsuite/cargo_init/inherit_workspace_package_table/out/crates/foo/src/main.rs diff --git a/src/tools/cargo/tests/testsuite/init/inherit_workspace_package_table/out/src/lib.rs b/src/tools/cargo/tests/testsuite/cargo_init/inherit_workspace_package_table/out/src/lib.rs index 7d12d9af8..7d12d9af8 100644 --- a/src/tools/cargo/tests/testsuite/init/inherit_workspace_package_table/out/src/lib.rs +++ b/src/tools/cargo/tests/testsuite/cargo_init/inherit_workspace_package_table/out/src/lib.rs diff --git a/src/tools/cargo/tests/testsuite/init/inherit_workspace_package_table/stderr.log b/src/tools/cargo/tests/testsuite/cargo_init/inherit_workspace_package_table/stderr.log index 3847e4e4a..3847e4e4a 100644 --- a/src/tools/cargo/tests/testsuite/init/inherit_workspace_package_table/stderr.log +++ b/src/tools/cargo/tests/testsuite/cargo_init/inherit_workspace_package_table/stderr.log diff --git a/src/tools/cargo/tests/testsuite/init/simple_hg/stdout.log b/src/tools/cargo/tests/testsuite/cargo_init/inherit_workspace_package_table/stdout.log index e69de29bb..e69de29bb 100644 --- a/src/tools/cargo/tests/testsuite/init/simple_hg/stdout.log +++ b/src/tools/cargo/tests/testsuite/cargo_init/inherit_workspace_package_table/stdout.log diff --git a/src/tools/cargo/tests/testsuite/init/invalid_dir_name/mod.rs b/src/tools/cargo/tests/testsuite/cargo_init/invalid_dir_name/mod.rs index 2b1be9022..2b1be9022 100644 --- a/src/tools/cargo/tests/testsuite/init/invalid_dir_name/mod.rs +++ b/src/tools/cargo/tests/testsuite/cargo_init/invalid_dir_name/mod.rs diff --git a/src/tools/cargo/tests/testsuite/init/invalid_dir_name/stderr.log b/src/tools/cargo/tests/testsuite/cargo_init/invalid_dir_name/stderr.log index 86d2c665f..86d2c665f 100644 --- a/src/tools/cargo/tests/testsuite/init/invalid_dir_name/stderr.log +++ b/src/tools/cargo/tests/testsuite/cargo_init/invalid_dir_name/stderr.log diff --git a/src/tools/cargo/tests/testsuite/init/simple_hg_ignore_exists/stdout.log b/src/tools/cargo/tests/testsuite/cargo_init/invalid_dir_name/stdout.log index e69de29bb..e69de29bb 100644 --- a/src/tools/cargo/tests/testsuite/init/simple_hg_ignore_exists/stdout.log +++ b/src/tools/cargo/tests/testsuite/cargo_init/invalid_dir_name/stdout.log diff --git a/src/tools/cargo/tests/testsuite/init/lib_already_exists_nosrc/out/lib.rs b/src/tools/cargo/tests/testsuite/cargo_init/lib_already_exists_nosrc/in/lib.rs index e69de29bb..e69de29bb 100644 --- a/src/tools/cargo/tests/testsuite/init/lib_already_exists_nosrc/out/lib.rs +++ b/src/tools/cargo/tests/testsuite/cargo_init/lib_already_exists_nosrc/in/lib.rs diff --git a/src/tools/cargo/tests/testsuite/init/lib_already_exists_nosrc/mod.rs b/src/tools/cargo/tests/testsuite/cargo_init/lib_already_exists_nosrc/mod.rs index d3e8e66df..d3e8e66df 100644 --- a/src/tools/cargo/tests/testsuite/init/lib_already_exists_nosrc/mod.rs +++ b/src/tools/cargo/tests/testsuite/cargo_init/lib_already_exists_nosrc/mod.rs diff --git a/src/tools/cargo/tests/testsuite/init/lib_already_exists_nosrc/out/Cargo.toml b/src/tools/cargo/tests/testsuite/cargo_init/lib_already_exists_nosrc/out/Cargo.toml index 39e95fe94..39e95fe94 100644 --- a/src/tools/cargo/tests/testsuite/init/lib_already_exists_nosrc/out/Cargo.toml +++ b/src/tools/cargo/tests/testsuite/cargo_init/lib_already_exists_nosrc/out/Cargo.toml diff --git a/src/tools/cargo/tests/testsuite/init/path_contains_separator/in/.keep b/src/tools/cargo/tests/testsuite/cargo_init/lib_already_exists_nosrc/out/lib.rs index e69de29bb..e69de29bb 100644 --- a/src/tools/cargo/tests/testsuite/init/path_contains_separator/in/.keep +++ b/src/tools/cargo/tests/testsuite/cargo_init/lib_already_exists_nosrc/out/lib.rs diff --git a/src/tools/cargo/tests/testsuite/init/lib_already_exists_nosrc/stderr.log b/src/tools/cargo/tests/testsuite/cargo_init/lib_already_exists_nosrc/stderr.log index f459bf226..f459bf226 100644 --- a/src/tools/cargo/tests/testsuite/init/lib_already_exists_nosrc/stderr.log +++ b/src/tools/cargo/tests/testsuite/cargo_init/lib_already_exists_nosrc/stderr.log diff --git a/src/tools/cargo/tests/testsuite/init/simple_lib/stdout.log b/src/tools/cargo/tests/testsuite/cargo_init/lib_already_exists_nosrc/stdout.log index e69de29bb..e69de29bb 100644 --- a/src/tools/cargo/tests/testsuite/init/simple_lib/stdout.log +++ b/src/tools/cargo/tests/testsuite/cargo_init/lib_already_exists_nosrc/stdout.log diff --git a/src/tools/cargo/tests/testsuite/init/lib_already_exists_src/in/src/lib.rs b/src/tools/cargo/tests/testsuite/cargo_init/lib_already_exists_src/in/src/lib.rs index 59760b549..59760b549 100644 --- a/src/tools/cargo/tests/testsuite/init/lib_already_exists_src/in/src/lib.rs +++ b/src/tools/cargo/tests/testsuite/cargo_init/lib_already_exists_src/in/src/lib.rs diff --git a/src/tools/cargo/tests/testsuite/init/lib_already_exists_src/mod.rs b/src/tools/cargo/tests/testsuite/cargo_init/lib_already_exists_src/mod.rs index d3e8e66df..d3e8e66df 100644 --- a/src/tools/cargo/tests/testsuite/init/lib_already_exists_src/mod.rs +++ b/src/tools/cargo/tests/testsuite/cargo_init/lib_already_exists_src/mod.rs diff --git a/src/tools/cargo/tests/testsuite/init/lib_already_exists_src/out/Cargo.toml b/src/tools/cargo/tests/testsuite/cargo_init/lib_already_exists_src/out/Cargo.toml index dcdb8da2c..dcdb8da2c 100644 --- a/src/tools/cargo/tests/testsuite/init/lib_already_exists_src/out/Cargo.toml +++ b/src/tools/cargo/tests/testsuite/cargo_init/lib_already_exists_src/out/Cargo.toml diff --git a/src/tools/cargo/tests/testsuite/init/lib_already_exists_src/out/src/lib.rs b/src/tools/cargo/tests/testsuite/cargo_init/lib_already_exists_src/out/src/lib.rs index 59760b549..59760b549 100644 --- a/src/tools/cargo/tests/testsuite/init/lib_already_exists_src/out/src/lib.rs +++ b/src/tools/cargo/tests/testsuite/cargo_init/lib_already_exists_src/out/src/lib.rs diff --git a/src/tools/cargo/tests/testsuite/init/lib_already_exists_src/stderr.log b/src/tools/cargo/tests/testsuite/cargo_init/lib_already_exists_src/stderr.log index f459bf226..f459bf226 100644 --- a/src/tools/cargo/tests/testsuite/init/lib_already_exists_src/stderr.log +++ b/src/tools/cargo/tests/testsuite/cargo_init/lib_already_exists_src/stderr.log diff --git a/src/tools/cargo/tests/testsuite/init/unknown_flags/stdout.log b/src/tools/cargo/tests/testsuite/cargo_init/lib_already_exists_src/stdout.log index e69de29bb..e69de29bb 100644 --- a/src/tools/cargo/tests/testsuite/init/unknown_flags/stdout.log +++ b/src/tools/cargo/tests/testsuite/cargo_init/lib_already_exists_src/stdout.log diff --git a/src/tools/cargo/tests/testsuite/init/mercurial_autodetect/mod.rs b/src/tools/cargo/tests/testsuite/cargo_init/mercurial_autodetect/mod.rs index d45ba868a..d45ba868a 100644 --- a/src/tools/cargo/tests/testsuite/init/mercurial_autodetect/mod.rs +++ b/src/tools/cargo/tests/testsuite/cargo_init/mercurial_autodetect/mod.rs diff --git a/src/tools/cargo/tests/testsuite/init/mercurial_autodetect/out/Cargo.toml b/src/tools/cargo/tests/testsuite/cargo_init/mercurial_autodetect/out/Cargo.toml index dcdb8da2c..dcdb8da2c 100644 --- a/src/tools/cargo/tests/testsuite/init/mercurial_autodetect/out/Cargo.toml +++ b/src/tools/cargo/tests/testsuite/cargo_init/mercurial_autodetect/out/Cargo.toml diff --git a/src/tools/cargo/tests/testsuite/init/mercurial_autodetect/out/src/lib.rs b/src/tools/cargo/tests/testsuite/cargo_init/mercurial_autodetect/out/src/lib.rs index 7d12d9af8..7d12d9af8 100644 --- a/src/tools/cargo/tests/testsuite/init/mercurial_autodetect/out/src/lib.rs +++ b/src/tools/cargo/tests/testsuite/cargo_init/mercurial_autodetect/out/src/lib.rs diff --git a/src/tools/cargo/tests/testsuite/init/mercurial_autodetect/stderr.log b/src/tools/cargo/tests/testsuite/cargo_init/mercurial_autodetect/stderr.log index f459bf226..f459bf226 100644 --- a/src/tools/cargo/tests/testsuite/init/mercurial_autodetect/stderr.log +++ b/src/tools/cargo/tests/testsuite/cargo_init/mercurial_autodetect/stderr.log diff --git a/src/tools/cargo/tests/testsuite/init/with_argument/stdout.log b/src/tools/cargo/tests/testsuite/cargo_init/mercurial_autodetect/stdout.log index e69de29bb..e69de29bb 100644 --- a/src/tools/cargo/tests/testsuite/init/with_argument/stdout.log +++ b/src/tools/cargo/tests/testsuite/cargo_init/mercurial_autodetect/stdout.log diff --git a/src/tools/cargo/tests/testsuite/init/mod.rs b/src/tools/cargo/tests/testsuite/cargo_init/mod.rs index 7853a1a0b..a1988a06a 100644 --- a/src/tools/cargo/tests/testsuite/init/mod.rs +++ b/src/tools/cargo/tests/testsuite/cargo_init/mod.rs @@ -18,6 +18,7 @@ mod formats_source; mod fossil_autodetect; mod git_autodetect; mod git_ignore_exists_no_conflicting_entries; +mod help; mod ignores_failure_to_format_source; mod inferred_bin_with_git; mod inferred_lib_with_git; diff --git a/src/tools/cargo/tests/testsuite/init/multibin_project_name_clash/in/case.rs b/src/tools/cargo/tests/testsuite/cargo_init/multibin_project_name_clash/in/case.rs index b31221118..b31221118 100644 --- a/src/tools/cargo/tests/testsuite/init/multibin_project_name_clash/in/case.rs +++ b/src/tools/cargo/tests/testsuite/cargo_init/multibin_project_name_clash/in/case.rs diff --git a/src/tools/cargo/tests/testsuite/init/multibin_project_name_clash/in/main.rs b/src/tools/cargo/tests/testsuite/cargo_init/multibin_project_name_clash/in/main.rs index 7937627b9..7937627b9 100644 --- a/src/tools/cargo/tests/testsuite/init/multibin_project_name_clash/in/main.rs +++ b/src/tools/cargo/tests/testsuite/cargo_init/multibin_project_name_clash/in/main.rs diff --git a/src/tools/cargo/tests/testsuite/init/multibin_project_name_clash/mod.rs b/src/tools/cargo/tests/testsuite/cargo_init/multibin_project_name_clash/mod.rs index fdd4476d9..fdd4476d9 100644 --- a/src/tools/cargo/tests/testsuite/init/multibin_project_name_clash/mod.rs +++ b/src/tools/cargo/tests/testsuite/cargo_init/multibin_project_name_clash/mod.rs diff --git a/src/tools/cargo/tests/testsuite/init/multibin_project_name_clash/out/case.rs b/src/tools/cargo/tests/testsuite/cargo_init/multibin_project_name_clash/out/case.rs index b31221118..b31221118 100644 --- a/src/tools/cargo/tests/testsuite/init/multibin_project_name_clash/out/case.rs +++ b/src/tools/cargo/tests/testsuite/cargo_init/multibin_project_name_clash/out/case.rs diff --git a/src/tools/cargo/tests/testsuite/init/multibin_project_name_clash/out/main.rs b/src/tools/cargo/tests/testsuite/cargo_init/multibin_project_name_clash/out/main.rs index 7937627b9..7937627b9 100644 --- a/src/tools/cargo/tests/testsuite/init/multibin_project_name_clash/out/main.rs +++ b/src/tools/cargo/tests/testsuite/cargo_init/multibin_project_name_clash/out/main.rs diff --git a/src/tools/cargo/tests/testsuite/init/multibin_project_name_clash/stderr.log b/src/tools/cargo/tests/testsuite/cargo_init/multibin_project_name_clash/stderr.log index 21a1dabee..21a1dabee 100644 --- a/src/tools/cargo/tests/testsuite/init/multibin_project_name_clash/stderr.log +++ b/src/tools/cargo/tests/testsuite/cargo_init/multibin_project_name_clash/stderr.log diff --git a/src/tools/cargo/tests/testsuite/init/pijul_autodetect/in/.pijul/.keep b/src/tools/cargo/tests/testsuite/cargo_init/multibin_project_name_clash/stdout.log index e69de29bb..e69de29bb 100644 --- a/src/tools/cargo/tests/testsuite/init/pijul_autodetect/in/.pijul/.keep +++ b/src/tools/cargo/tests/testsuite/cargo_init/multibin_project_name_clash/stdout.log diff --git a/src/tools/cargo/tests/testsuite/init/no_filename/mod.rs b/src/tools/cargo/tests/testsuite/cargo_init/no_filename/mod.rs index 8edfd2823..8edfd2823 100644 --- a/src/tools/cargo/tests/testsuite/init/no_filename/mod.rs +++ b/src/tools/cargo/tests/testsuite/cargo_init/no_filename/mod.rs diff --git a/src/tools/cargo/tests/testsuite/init/no_filename/stderr.log b/src/tools/cargo/tests/testsuite/cargo_init/no_filename/stderr.log index bd087ec90..bd087ec90 100644 --- a/src/tools/cargo/tests/testsuite/init/no_filename/stderr.log +++ b/src/tools/cargo/tests/testsuite/cargo_init/no_filename/stderr.log diff --git a/src/tools/cargo/tests/testsuite/init/with_argument/in/foo/.keep b/src/tools/cargo/tests/testsuite/cargo_init/no_filename/stdout.log index e69de29bb..e69de29bb 100644 --- a/src/tools/cargo/tests/testsuite/init/with_argument/in/foo/.keep +++ b/src/tools/cargo/tests/testsuite/cargo_init/no_filename/stdout.log diff --git a/src/tools/cargo/tests/testsuite/cargo_init/path_contains_separator/in/.keep b/src/tools/cargo/tests/testsuite/cargo_init/path_contains_separator/in/.keep new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_init/path_contains_separator/in/.keep diff --git a/src/tools/cargo/tests/testsuite/init/path_contains_separator/mod.rs b/src/tools/cargo/tests/testsuite/cargo_init/path_contains_separator/mod.rs index 0a12f4269..0a12f4269 100644 --- a/src/tools/cargo/tests/testsuite/init/path_contains_separator/mod.rs +++ b/src/tools/cargo/tests/testsuite/cargo_init/path_contains_separator/mod.rs diff --git a/src/tools/cargo/tests/testsuite/init/path_contains_separator/out/Cargo.toml b/src/tools/cargo/tests/testsuite/cargo_init/path_contains_separator/out/Cargo.toml index 11465f1fc..11465f1fc 100644 --- a/src/tools/cargo/tests/testsuite/init/path_contains_separator/out/Cargo.toml +++ b/src/tools/cargo/tests/testsuite/cargo_init/path_contains_separator/out/Cargo.toml diff --git a/src/tools/cargo/tests/testsuite/init/path_contains_separator/out/src/main.rs b/src/tools/cargo/tests/testsuite/cargo_init/path_contains_separator/out/src/main.rs index e7a11a969..e7a11a969 100644 --- a/src/tools/cargo/tests/testsuite/init/path_contains_separator/out/src/main.rs +++ b/src/tools/cargo/tests/testsuite/cargo_init/path_contains_separator/out/src/main.rs diff --git a/src/tools/cargo/tests/testsuite/init/path_contains_separator/stderr.log b/src/tools/cargo/tests/testsuite/cargo_init/path_contains_separator/stderr.log index d7947aea2..d7947aea2 100644 --- a/src/tools/cargo/tests/testsuite/init/path_contains_separator/stderr.log +++ b/src/tools/cargo/tests/testsuite/cargo_init/path_contains_separator/stderr.log diff --git a/src/tools/cargo/tests/testsuite/cargo_init/path_contains_separator/stdout.log b/src/tools/cargo/tests/testsuite/cargo_init/path_contains_separator/stdout.log new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_init/path_contains_separator/stdout.log diff --git a/src/tools/cargo/tests/testsuite/cargo_init/pijul_autodetect/in/.pijul/.keep b/src/tools/cargo/tests/testsuite/cargo_init/pijul_autodetect/in/.pijul/.keep new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_init/pijul_autodetect/in/.pijul/.keep diff --git a/src/tools/cargo/tests/testsuite/init/pijul_autodetect/mod.rs b/src/tools/cargo/tests/testsuite/cargo_init/pijul_autodetect/mod.rs index d45ba868a..d45ba868a 100644 --- a/src/tools/cargo/tests/testsuite/init/pijul_autodetect/mod.rs +++ b/src/tools/cargo/tests/testsuite/cargo_init/pijul_autodetect/mod.rs diff --git a/src/tools/cargo/tests/testsuite/init/pijul_autodetect/out/.ignore b/src/tools/cargo/tests/testsuite/cargo_init/pijul_autodetect/out/.ignore index 4fffb2f89..4fffb2f89 100644 --- a/src/tools/cargo/tests/testsuite/init/pijul_autodetect/out/.ignore +++ b/src/tools/cargo/tests/testsuite/cargo_init/pijul_autodetect/out/.ignore diff --git a/src/tools/cargo/tests/testsuite/init/pijul_autodetect/out/Cargo.toml b/src/tools/cargo/tests/testsuite/cargo_init/pijul_autodetect/out/Cargo.toml index dcdb8da2c..dcdb8da2c 100644 --- a/src/tools/cargo/tests/testsuite/init/pijul_autodetect/out/Cargo.toml +++ b/src/tools/cargo/tests/testsuite/cargo_init/pijul_autodetect/out/Cargo.toml diff --git a/src/tools/cargo/tests/testsuite/init/pijul_autodetect/out/src/lib.rs b/src/tools/cargo/tests/testsuite/cargo_init/pijul_autodetect/out/src/lib.rs index 7d12d9af8..7d12d9af8 100644 --- a/src/tools/cargo/tests/testsuite/init/pijul_autodetect/out/src/lib.rs +++ b/src/tools/cargo/tests/testsuite/cargo_init/pijul_autodetect/out/src/lib.rs diff --git a/src/tools/cargo/tests/testsuite/init/pijul_autodetect/stderr.log b/src/tools/cargo/tests/testsuite/cargo_init/pijul_autodetect/stderr.log index f459bf226..f459bf226 100644 --- a/src/tools/cargo/tests/testsuite/init/pijul_autodetect/stderr.log +++ b/src/tools/cargo/tests/testsuite/cargo_init/pijul_autodetect/stderr.log diff --git a/src/tools/cargo/tests/testsuite/cargo_init/pijul_autodetect/stdout.log b/src/tools/cargo/tests/testsuite/cargo_init/pijul_autodetect/stdout.log new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_init/pijul_autodetect/stdout.log diff --git a/src/tools/cargo/tests/testsuite/init/reserved_name/mod.rs b/src/tools/cargo/tests/testsuite/cargo_init/reserved_name/mod.rs index cc65fd0a1..cc65fd0a1 100644 --- a/src/tools/cargo/tests/testsuite/init/reserved_name/mod.rs +++ b/src/tools/cargo/tests/testsuite/cargo_init/reserved_name/mod.rs diff --git a/src/tools/cargo/tests/testsuite/init/reserved_name/stderr.log b/src/tools/cargo/tests/testsuite/cargo_init/reserved_name/stderr.log index 748971bdf..748971bdf 100644 --- a/src/tools/cargo/tests/testsuite/init/reserved_name/stderr.log +++ b/src/tools/cargo/tests/testsuite/cargo_init/reserved_name/stderr.log diff --git a/src/tools/cargo/tests/testsuite/cargo_init/reserved_name/stdout.log b/src/tools/cargo/tests/testsuite/cargo_init/reserved_name/stdout.log new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_init/reserved_name/stdout.log diff --git a/src/tools/cargo/tests/testsuite/init/simple_bin/in b/src/tools/cargo/tests/testsuite/cargo_init/simple_bin/in index 1202506b6..1202506b6 120000 --- a/src/tools/cargo/tests/testsuite/init/simple_bin/in +++ b/src/tools/cargo/tests/testsuite/cargo_init/simple_bin/in diff --git a/src/tools/cargo/tests/testsuite/init/simple_bin/mod.rs b/src/tools/cargo/tests/testsuite/cargo_init/simple_bin/mod.rs index eaf0955f9..eaf0955f9 100644 --- a/src/tools/cargo/tests/testsuite/init/simple_bin/mod.rs +++ b/src/tools/cargo/tests/testsuite/cargo_init/simple_bin/mod.rs diff --git a/src/tools/cargo/tests/testsuite/init/simple_bin/out/Cargo.toml b/src/tools/cargo/tests/testsuite/cargo_init/simple_bin/out/Cargo.toml index a6269fdcd..a6269fdcd 100644 --- a/src/tools/cargo/tests/testsuite/init/simple_bin/out/Cargo.toml +++ b/src/tools/cargo/tests/testsuite/cargo_init/simple_bin/out/Cargo.toml diff --git a/src/tools/cargo/tests/testsuite/init/simple_bin/out/src/main.rs b/src/tools/cargo/tests/testsuite/cargo_init/simple_bin/out/src/main.rs index e7a11a969..e7a11a969 100644 --- a/src/tools/cargo/tests/testsuite/init/simple_bin/out/src/main.rs +++ b/src/tools/cargo/tests/testsuite/cargo_init/simple_bin/out/src/main.rs diff --git a/src/tools/cargo/tests/testsuite/init/simple_bin/stderr.log b/src/tools/cargo/tests/testsuite/cargo_init/simple_bin/stderr.log index 3847e4e4a..3847e4e4a 100644 --- a/src/tools/cargo/tests/testsuite/init/simple_bin/stderr.log +++ b/src/tools/cargo/tests/testsuite/cargo_init/simple_bin/stderr.log diff --git a/src/tools/cargo/tests/testsuite/cargo_init/simple_bin/stdout.log b/src/tools/cargo/tests/testsuite/cargo_init/simple_bin/stdout.log new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_init/simple_bin/stdout.log diff --git a/src/tools/cargo/tests/testsuite/init/simple_git/in b/src/tools/cargo/tests/testsuite/cargo_init/simple_git/in index 1202506b6..1202506b6 120000 --- a/src/tools/cargo/tests/testsuite/init/simple_git/in +++ b/src/tools/cargo/tests/testsuite/cargo_init/simple_git/in diff --git a/src/tools/cargo/tests/testsuite/init/simple_git/mod.rs b/src/tools/cargo/tests/testsuite/cargo_init/simple_git/mod.rs index c373fe2a2..c373fe2a2 100644 --- a/src/tools/cargo/tests/testsuite/init/simple_git/mod.rs +++ b/src/tools/cargo/tests/testsuite/cargo_init/simple_git/mod.rs diff --git a/src/tools/cargo/tests/testsuite/init/simple_git/out/Cargo.toml b/src/tools/cargo/tests/testsuite/cargo_init/simple_git/out/Cargo.toml index dcdb8da2c..dcdb8da2c 100644 --- a/src/tools/cargo/tests/testsuite/init/simple_git/out/Cargo.toml +++ b/src/tools/cargo/tests/testsuite/cargo_init/simple_git/out/Cargo.toml diff --git a/src/tools/cargo/tests/testsuite/init/simple_git/out/src/lib.rs b/src/tools/cargo/tests/testsuite/cargo_init/simple_git/out/src/lib.rs index 7d12d9af8..7d12d9af8 100644 --- a/src/tools/cargo/tests/testsuite/init/simple_git/out/src/lib.rs +++ b/src/tools/cargo/tests/testsuite/cargo_init/simple_git/out/src/lib.rs diff --git a/src/tools/cargo/tests/testsuite/init/simple_git/stderr.log b/src/tools/cargo/tests/testsuite/cargo_init/simple_git/stderr.log index f459bf226..f459bf226 100644 --- a/src/tools/cargo/tests/testsuite/init/simple_git/stderr.log +++ b/src/tools/cargo/tests/testsuite/cargo_init/simple_git/stderr.log diff --git a/src/tools/cargo/tests/testsuite/cargo_init/simple_git/stdout.log b/src/tools/cargo/tests/testsuite/cargo_init/simple_git/stdout.log new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_init/simple_git/stdout.log diff --git a/src/tools/cargo/tests/testsuite/init/simple_git_ignore_exists/mod.rs b/src/tools/cargo/tests/testsuite/cargo_init/simple_git_ignore_exists/mod.rs index 142e86efd..142e86efd 100644 --- a/src/tools/cargo/tests/testsuite/init/simple_git_ignore_exists/mod.rs +++ b/src/tools/cargo/tests/testsuite/cargo_init/simple_git_ignore_exists/mod.rs diff --git a/src/tools/cargo/tests/testsuite/init/simple_git_ignore_exists/out/Cargo.toml b/src/tools/cargo/tests/testsuite/cargo_init/simple_git_ignore_exists/out/Cargo.toml index a6269fdcd..a6269fdcd 100644 --- a/src/tools/cargo/tests/testsuite/init/simple_git_ignore_exists/out/Cargo.toml +++ b/src/tools/cargo/tests/testsuite/cargo_init/simple_git_ignore_exists/out/Cargo.toml diff --git a/src/tools/cargo/tests/testsuite/init/simple_git_ignore_exists/out/src/lib.rs b/src/tools/cargo/tests/testsuite/cargo_init/simple_git_ignore_exists/out/src/lib.rs index 7d12d9af8..7d12d9af8 100644 --- a/src/tools/cargo/tests/testsuite/init/simple_git_ignore_exists/out/src/lib.rs +++ b/src/tools/cargo/tests/testsuite/cargo_init/simple_git_ignore_exists/out/src/lib.rs diff --git a/src/tools/cargo/tests/testsuite/init/simple_git_ignore_exists/stderr.log b/src/tools/cargo/tests/testsuite/cargo_init/simple_git_ignore_exists/stderr.log index f459bf226..f459bf226 100644 --- a/src/tools/cargo/tests/testsuite/init/simple_git_ignore_exists/stderr.log +++ b/src/tools/cargo/tests/testsuite/cargo_init/simple_git_ignore_exists/stderr.log diff --git a/src/tools/cargo/tests/testsuite/cargo_init/simple_git_ignore_exists/stdout.log b/src/tools/cargo/tests/testsuite/cargo_init/simple_git_ignore_exists/stdout.log new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_init/simple_git_ignore_exists/stdout.log diff --git a/src/tools/cargo/tests/testsuite/init/simple_hg/in b/src/tools/cargo/tests/testsuite/cargo_init/simple_hg/in index 1202506b6..1202506b6 120000 --- a/src/tools/cargo/tests/testsuite/init/simple_hg/in +++ b/src/tools/cargo/tests/testsuite/cargo_init/simple_hg/in diff --git a/src/tools/cargo/tests/testsuite/init/simple_hg/mod.rs b/src/tools/cargo/tests/testsuite/cargo_init/simple_hg/mod.rs index 1d6765453..1d6765453 100644 --- a/src/tools/cargo/tests/testsuite/init/simple_hg/mod.rs +++ b/src/tools/cargo/tests/testsuite/cargo_init/simple_hg/mod.rs diff --git a/src/tools/cargo/tests/testsuite/init/simple_hg/out/Cargo.toml b/src/tools/cargo/tests/testsuite/cargo_init/simple_hg/out/Cargo.toml index dcdb8da2c..dcdb8da2c 100644 --- a/src/tools/cargo/tests/testsuite/init/simple_hg/out/Cargo.toml +++ b/src/tools/cargo/tests/testsuite/cargo_init/simple_hg/out/Cargo.toml diff --git a/src/tools/cargo/tests/testsuite/init/simple_hg/out/src/lib.rs b/src/tools/cargo/tests/testsuite/cargo_init/simple_hg/out/src/lib.rs index 7d12d9af8..7d12d9af8 100644 --- a/src/tools/cargo/tests/testsuite/init/simple_hg/out/src/lib.rs +++ b/src/tools/cargo/tests/testsuite/cargo_init/simple_hg/out/src/lib.rs diff --git a/src/tools/cargo/tests/testsuite/init/simple_hg/stderr.log b/src/tools/cargo/tests/testsuite/cargo_init/simple_hg/stderr.log index f459bf226..f459bf226 100644 --- a/src/tools/cargo/tests/testsuite/init/simple_hg/stderr.log +++ b/src/tools/cargo/tests/testsuite/cargo_init/simple_hg/stderr.log diff --git a/src/tools/cargo/tests/testsuite/cargo_init/simple_hg/stdout.log b/src/tools/cargo/tests/testsuite/cargo_init/simple_hg/stdout.log new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_init/simple_hg/stdout.log diff --git a/src/tools/cargo/tests/testsuite/init/simple_hg_ignore_exists/mod.rs b/src/tools/cargo/tests/testsuite/cargo_init/simple_hg_ignore_exists/mod.rs index d45ba868a..d45ba868a 100644 --- a/src/tools/cargo/tests/testsuite/init/simple_hg_ignore_exists/mod.rs +++ b/src/tools/cargo/tests/testsuite/cargo_init/simple_hg_ignore_exists/mod.rs diff --git a/src/tools/cargo/tests/testsuite/init/simple_hg_ignore_exists/out/Cargo.toml b/src/tools/cargo/tests/testsuite/cargo_init/simple_hg_ignore_exists/out/Cargo.toml index dcdb8da2c..dcdb8da2c 100644 --- a/src/tools/cargo/tests/testsuite/init/simple_hg_ignore_exists/out/Cargo.toml +++ b/src/tools/cargo/tests/testsuite/cargo_init/simple_hg_ignore_exists/out/Cargo.toml diff --git a/src/tools/cargo/tests/testsuite/init/simple_hg_ignore_exists/out/src/lib.rs b/src/tools/cargo/tests/testsuite/cargo_init/simple_hg_ignore_exists/out/src/lib.rs index 7d12d9af8..7d12d9af8 100644 --- a/src/tools/cargo/tests/testsuite/init/simple_hg_ignore_exists/out/src/lib.rs +++ b/src/tools/cargo/tests/testsuite/cargo_init/simple_hg_ignore_exists/out/src/lib.rs diff --git a/src/tools/cargo/tests/testsuite/init/simple_hg_ignore_exists/stderr.log b/src/tools/cargo/tests/testsuite/cargo_init/simple_hg_ignore_exists/stderr.log index f459bf226..f459bf226 100644 --- a/src/tools/cargo/tests/testsuite/init/simple_hg_ignore_exists/stderr.log +++ b/src/tools/cargo/tests/testsuite/cargo_init/simple_hg_ignore_exists/stderr.log diff --git a/src/tools/cargo/tests/testsuite/cargo_init/simple_hg_ignore_exists/stdout.log b/src/tools/cargo/tests/testsuite/cargo_init/simple_hg_ignore_exists/stdout.log new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_init/simple_hg_ignore_exists/stdout.log diff --git a/src/tools/cargo/tests/testsuite/init/simple_lib/in b/src/tools/cargo/tests/testsuite/cargo_init/simple_lib/in index 1202506b6..1202506b6 120000 --- a/src/tools/cargo/tests/testsuite/init/simple_lib/in +++ b/src/tools/cargo/tests/testsuite/cargo_init/simple_lib/in diff --git a/src/tools/cargo/tests/testsuite/init/simple_lib/mod.rs b/src/tools/cargo/tests/testsuite/cargo_init/simple_lib/mod.rs index d6bae5167..d6bae5167 100644 --- a/src/tools/cargo/tests/testsuite/init/simple_lib/mod.rs +++ b/src/tools/cargo/tests/testsuite/cargo_init/simple_lib/mod.rs diff --git a/src/tools/cargo/tests/testsuite/init/simple_lib/out/Cargo.toml b/src/tools/cargo/tests/testsuite/cargo_init/simple_lib/out/Cargo.toml index a6269fdcd..a6269fdcd 100644 --- a/src/tools/cargo/tests/testsuite/init/simple_lib/out/Cargo.toml +++ b/src/tools/cargo/tests/testsuite/cargo_init/simple_lib/out/Cargo.toml diff --git a/src/tools/cargo/tests/testsuite/init/simple_lib/out/src/lib.rs b/src/tools/cargo/tests/testsuite/cargo_init/simple_lib/out/src/lib.rs index 7d12d9af8..7d12d9af8 100644 --- a/src/tools/cargo/tests/testsuite/init/simple_lib/out/src/lib.rs +++ b/src/tools/cargo/tests/testsuite/cargo_init/simple_lib/out/src/lib.rs diff --git a/src/tools/cargo/tests/testsuite/init/simple_lib/stderr.log b/src/tools/cargo/tests/testsuite/cargo_init/simple_lib/stderr.log index f459bf226..f459bf226 100644 --- a/src/tools/cargo/tests/testsuite/init/simple_lib/stderr.log +++ b/src/tools/cargo/tests/testsuite/cargo_init/simple_lib/stderr.log diff --git a/src/tools/cargo/tests/testsuite/cargo_init/simple_lib/stdout.log b/src/tools/cargo/tests/testsuite/cargo_init/simple_lib/stdout.log new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_init/simple_lib/stdout.log diff --git a/src/tools/cargo/tests/testsuite/init/unknown_flags/mod.rs b/src/tools/cargo/tests/testsuite/cargo_init/unknown_flags/mod.rs index 4289b4b9e..4289b4b9e 100644 --- a/src/tools/cargo/tests/testsuite/init/unknown_flags/mod.rs +++ b/src/tools/cargo/tests/testsuite/cargo_init/unknown_flags/mod.rs diff --git a/src/tools/cargo/tests/testsuite/init/unknown_flags/stderr.log b/src/tools/cargo/tests/testsuite/cargo_init/unknown_flags/stderr.log index 980e8acd8..980e8acd8 100644 --- a/src/tools/cargo/tests/testsuite/init/unknown_flags/stderr.log +++ b/src/tools/cargo/tests/testsuite/cargo_init/unknown_flags/stderr.log diff --git a/src/tools/cargo/tests/testsuite/cargo_init/unknown_flags/stdout.log b/src/tools/cargo/tests/testsuite/cargo_init/unknown_flags/stdout.log new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_init/unknown_flags/stdout.log diff --git a/src/tools/cargo/tests/testsuite/cargo_init/with_argument/in/foo/.keep b/src/tools/cargo/tests/testsuite/cargo_init/with_argument/in/foo/.keep new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_init/with_argument/in/foo/.keep diff --git a/src/tools/cargo/tests/testsuite/init/with_argument/mod.rs b/src/tools/cargo/tests/testsuite/cargo_init/with_argument/mod.rs index 0b5e342a1..0b5e342a1 100644 --- a/src/tools/cargo/tests/testsuite/init/with_argument/mod.rs +++ b/src/tools/cargo/tests/testsuite/cargo_init/with_argument/mod.rs diff --git a/src/tools/cargo/tests/testsuite/init/with_argument/out/foo/Cargo.toml b/src/tools/cargo/tests/testsuite/cargo_init/with_argument/out/foo/Cargo.toml index 1d9cfe317..1d9cfe317 100644 --- a/src/tools/cargo/tests/testsuite/init/with_argument/out/foo/Cargo.toml +++ b/src/tools/cargo/tests/testsuite/cargo_init/with_argument/out/foo/Cargo.toml diff --git a/src/tools/cargo/tests/testsuite/init/with_argument/out/foo/src/main.rs b/src/tools/cargo/tests/testsuite/cargo_init/with_argument/out/foo/src/main.rs index e7a11a969..e7a11a969 100644 --- a/src/tools/cargo/tests/testsuite/init/with_argument/out/foo/src/main.rs +++ b/src/tools/cargo/tests/testsuite/cargo_init/with_argument/out/foo/src/main.rs diff --git a/src/tools/cargo/tests/testsuite/init/with_argument/stderr.log b/src/tools/cargo/tests/testsuite/cargo_init/with_argument/stderr.log index 3847e4e4a..3847e4e4a 100644 --- a/src/tools/cargo/tests/testsuite/init/with_argument/stderr.log +++ b/src/tools/cargo/tests/testsuite/cargo_init/with_argument/stderr.log diff --git a/src/tools/cargo/tests/testsuite/cargo_init/with_argument/stdout.log b/src/tools/cargo/tests/testsuite/cargo_init/with_argument/stdout.log new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_init/with_argument/stdout.log diff --git a/src/tools/cargo/tests/testsuite/cargo_install/help/mod.rs b/src/tools/cargo/tests/testsuite/cargo_install/help/mod.rs new file mode 100644 index 000000000..a2c1c724b --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_install/help/mod.rs @@ -0,0 +1,13 @@ +use cargo_test_support::curr_dir; +use cargo_test_support::prelude::*; + +#[cargo_test] +fn case() { + snapbox::cmd::Command::cargo_ui() + .arg("install") + .arg("--help") + .assert() + .success() + .stdout_matches_path(curr_dir!().join("stdout.log")) + .stderr_matches_path(curr_dir!().join("stderr.log")); +} diff --git a/src/tools/cargo/tests/testsuite/cargo_install/help/stderr.log b/src/tools/cargo/tests/testsuite/cargo_install/help/stderr.log new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_install/help/stderr.log diff --git a/src/tools/cargo/tests/testsuite/cargo_install/help/stdout.log b/src/tools/cargo/tests/testsuite/cargo_install/help/stdout.log new file mode 100644 index 000000000..a07fa47f6 --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_install/help/stdout.log @@ -0,0 +1,56 @@ +Install a Rust binary. Default location is $HOME/.cargo/bin + +Usage: cargo[EXE] install [OPTIONS] [crate]... + +Arguments: + [crate]... + +Options: + --version <VERSION> Specify a version to install + --index <INDEX> Registry index to install from + --registry <REGISTRY> Registry to use + --git <URL> Git URL to install the specified crate from + --branch <BRANCH> Branch to use when installing from git + --tag <TAG> Tag to use when installing from git + --rev <SHA> Specific commit to use when installing from git + --path <PATH> Filesystem path to local crate to install + --root <DIR> Directory to install packages into + -f, --force Force overwriting existing crates or binaries + --no-track Do not save tracking information + --list list all installed packages and their versions + --ignore-rust-version Ignore `rust-version` specification in packages + --message-format <FMT> Error format + -q, --quiet Do not print cargo log messages + --debug Build in debug mode (with the 'dev' profile) instead of release mode + -v, --verbose... Use verbose output (-vv very verbose/build.rs output) + --color <WHEN> Coloring: auto, always, never + --config <KEY=VALUE> Override a configuration value + -Z <FLAG> Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for + details + -h, --help Print help + +Target Selection: + --bin [<NAME>] Install only the specified binary + --bins Install all binaries + --example [<NAME>] Install only the specified example + --examples Install all examples + +Feature Selection: + -F, --features <FEATURES> Space or comma separated list of features to activate + --all-features Activate all available features + --no-default-features Do not activate the `default` feature + +Compilation Options: + -j, --jobs <N> Number of parallel jobs, defaults to # of CPUs. + --keep-going Do not abort the build as soon as there is an error (unstable) + --profile <PROFILE-NAME> Install artifacts with the specified profile + --target <TRIPLE> Build for the target triple + --target-dir <DIRECTORY> Directory for all generated artifacts + --timings[=<FMTS>] Timing output formats (unstable) (comma separated): html, json + +Manifest Options: + --frozen Require Cargo.lock and cache are up to date + --locked Require Cargo.lock is up to date + --offline Run without accessing the network + +Run `cargo help install` for more detailed information. diff --git a/src/tools/cargo/tests/testsuite/cargo_install/mod.rs b/src/tools/cargo/tests/testsuite/cargo_install/mod.rs new file mode 100644 index 000000000..c0ce11180 --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_install/mod.rs @@ -0,0 +1 @@ +mod help; diff --git a/src/tools/cargo/tests/testsuite/cargo_locate_project/help/mod.rs b/src/tools/cargo/tests/testsuite/cargo_locate_project/help/mod.rs new file mode 100644 index 000000000..f6b7e8eaf --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_locate_project/help/mod.rs @@ -0,0 +1,13 @@ +use cargo_test_support::curr_dir; +use cargo_test_support::prelude::*; + +#[cargo_test] +fn case() { + snapbox::cmd::Command::cargo_ui() + .arg("locate-project") + .arg("--help") + .assert() + .success() + .stdout_matches_path(curr_dir!().join("stdout.log")) + .stderr_matches_path(curr_dir!().join("stderr.log")); +} diff --git a/src/tools/cargo/tests/testsuite/cargo_locate_project/help/stderr.log b/src/tools/cargo/tests/testsuite/cargo_locate_project/help/stderr.log new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_locate_project/help/stderr.log diff --git a/src/tools/cargo/tests/testsuite/cargo_locate_project/help/stdout.log b/src/tools/cargo/tests/testsuite/cargo_locate_project/help/stdout.log new file mode 100644 index 000000000..1c6ea7b25 --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_locate_project/help/stdout.log @@ -0,0 +1,22 @@ +Print a JSON representation of a Cargo.toml file's location + +Usage: cargo[EXE] locate-project [OPTIONS] + +Options: + --workspace Locate Cargo.toml of the workspace root + --message-format <FMT> Output representation [possible values: json, plain] + -q, --quiet Do not print cargo log messages + -v, --verbose... Use verbose output (-vv very verbose/build.rs output) + --color <WHEN> Coloring: auto, always, never + --config <KEY=VALUE> Override a configuration value + -Z <FLAG> Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for + details + -h, --help Print help + +Manifest Options: + --manifest-path <PATH> Path to Cargo.toml + --frozen Require Cargo.lock and cache are up to date + --locked Require Cargo.lock is up to date + --offline Run without accessing the network + +Run `cargo help locate-project` for more detailed information. diff --git a/src/tools/cargo/tests/testsuite/cargo_locate_project/mod.rs b/src/tools/cargo/tests/testsuite/cargo_locate_project/mod.rs new file mode 100644 index 000000000..c0ce11180 --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_locate_project/mod.rs @@ -0,0 +1 @@ +mod help; diff --git a/src/tools/cargo/tests/testsuite/cargo_login/help/mod.rs b/src/tools/cargo/tests/testsuite/cargo_login/help/mod.rs new file mode 100644 index 000000000..86b95da15 --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_login/help/mod.rs @@ -0,0 +1,13 @@ +use cargo_test_support::curr_dir; +use cargo_test_support::prelude::*; + +#[cargo_test] +fn case() { + snapbox::cmd::Command::cargo_ui() + .arg("login") + .arg("--help") + .assert() + .success() + .stdout_matches_path(curr_dir!().join("stdout.log")) + .stderr_matches_path(curr_dir!().join("stderr.log")); +} diff --git a/src/tools/cargo/tests/testsuite/cargo_login/help/stderr.log b/src/tools/cargo/tests/testsuite/cargo_login/help/stderr.log new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_login/help/stderr.log diff --git a/src/tools/cargo/tests/testsuite/cargo_login/help/stdout.log b/src/tools/cargo/tests/testsuite/cargo_login/help/stdout.log new file mode 100644 index 000000000..faec55c18 --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_login/help/stdout.log @@ -0,0 +1,23 @@ +Log in to a registry. + +Usage: cargo[EXE] login [OPTIONS] [token] [-- [args]...] + +Arguments: + [token] + [args]... Arguments for the credential provider (unstable) + +Options: + --registry <REGISTRY> Registry to use + -q, --quiet Do not print cargo log messages + -v, --verbose... Use verbose output (-vv very verbose/build.rs output) + --color <WHEN> Coloring: auto, always, never + --config <KEY=VALUE> Override a configuration value + -Z <FLAG> Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for details + -h, --help Print help + +Manifest Options: + --frozen Require Cargo.lock and cache are up to date + --locked Require Cargo.lock is up to date + --offline Run without accessing the network + +Run `cargo help login` for more detailed information. diff --git a/src/tools/cargo/tests/testsuite/cargo_login/mod.rs b/src/tools/cargo/tests/testsuite/cargo_login/mod.rs new file mode 100644 index 000000000..c0ce11180 --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_login/mod.rs @@ -0,0 +1 @@ +mod help; diff --git a/src/tools/cargo/tests/testsuite/cargo_logout/help/mod.rs b/src/tools/cargo/tests/testsuite/cargo_logout/help/mod.rs new file mode 100644 index 000000000..f895b60dd --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_logout/help/mod.rs @@ -0,0 +1,13 @@ +use cargo_test_support::curr_dir; +use cargo_test_support::prelude::*; + +#[cargo_test] +fn case() { + snapbox::cmd::Command::cargo_ui() + .arg("logout") + .arg("--help") + .assert() + .success() + .stdout_matches_path(curr_dir!().join("stdout.log")) + .stderr_matches_path(curr_dir!().join("stderr.log")); +} diff --git a/src/tools/cargo/tests/testsuite/cargo_logout/help/stderr.log b/src/tools/cargo/tests/testsuite/cargo_logout/help/stderr.log new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_logout/help/stderr.log diff --git a/src/tools/cargo/tests/testsuite/cargo_logout/help/stdout.log b/src/tools/cargo/tests/testsuite/cargo_logout/help/stdout.log new file mode 100644 index 000000000..fe328d765 --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_logout/help/stdout.log @@ -0,0 +1,19 @@ +Remove an API token from the registry locally + +Usage: cargo[EXE] logout [OPTIONS] + +Options: + --registry <REGISTRY> Registry to use + -q, --quiet Do not print cargo log messages + -v, --verbose... Use verbose output (-vv very verbose/build.rs output) + --color <WHEN> Coloring: auto, always, never + --config <KEY=VALUE> Override a configuration value + -Z <FLAG> Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for details + -h, --help Print help + +Manifest Options: + --frozen Require Cargo.lock and cache are up to date + --locked Require Cargo.lock is up to date + --offline Run without accessing the network + +Run `cargo help logout` for more detailed information. diff --git a/src/tools/cargo/tests/testsuite/cargo_logout/mod.rs b/src/tools/cargo/tests/testsuite/cargo_logout/mod.rs new file mode 100644 index 000000000..c0ce11180 --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_logout/mod.rs @@ -0,0 +1 @@ +mod help; diff --git a/src/tools/cargo/tests/testsuite/cargo_metadata/help/mod.rs b/src/tools/cargo/tests/testsuite/cargo_metadata/help/mod.rs new file mode 100644 index 000000000..a88c374fe --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_metadata/help/mod.rs @@ -0,0 +1,13 @@ +use cargo_test_support::curr_dir; +use cargo_test_support::prelude::*; + +#[cargo_test] +fn case() { + snapbox::cmd::Command::cargo_ui() + .arg("metadata") + .arg("--help") + .assert() + .success() + .stdout_matches_path(curr_dir!().join("stdout.log")) + .stderr_matches_path(curr_dir!().join("stderr.log")); +} diff --git a/src/tools/cargo/tests/testsuite/cargo_metadata/help/stderr.log b/src/tools/cargo/tests/testsuite/cargo_metadata/help/stderr.log new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_metadata/help/stderr.log diff --git a/src/tools/cargo/tests/testsuite/cargo_metadata/help/stdout.log b/src/tools/cargo/tests/testsuite/cargo_metadata/help/stdout.log new file mode 100644 index 000000000..939fc40c9 --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_metadata/help/stdout.log @@ -0,0 +1,30 @@ +Output the resolved dependencies of a package, the concrete used versions including overrides, in +machine-readable format + +Usage: cargo[EXE] metadata [OPTIONS] + +Options: + --filter-platform <TRIPLE> Only include resolve dependencies matching the given target-triple + --no-deps Output information only about the workspace members and don't + fetch dependencies + --format-version <VERSION> Format version [possible values: 1] + -q, --quiet Do not print cargo log messages + -v, --verbose... Use verbose output (-vv very verbose/build.rs output) + --color <WHEN> Coloring: auto, always, never + --config <KEY=VALUE> Override a configuration value + -Z <FLAG> Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for + details + -h, --help Print help + +Feature Selection: + -F, --features <FEATURES> Space or comma separated list of features to activate + --all-features Activate all available features + --no-default-features Do not activate the `default` feature + +Manifest Options: + --manifest-path <PATH> Path to Cargo.toml + --frozen Require Cargo.lock and cache are up to date + --locked Require Cargo.lock is up to date + --offline Run without accessing the network + +Run `cargo help metadata` for more detailed information. diff --git a/src/tools/cargo/tests/testsuite/cargo_metadata/mod.rs b/src/tools/cargo/tests/testsuite/cargo_metadata/mod.rs new file mode 100644 index 000000000..c0ce11180 --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_metadata/mod.rs @@ -0,0 +1 @@ +mod help; diff --git a/src/tools/cargo/tests/testsuite/cargo_new/help/mod.rs b/src/tools/cargo/tests/testsuite/cargo_new/help/mod.rs new file mode 100644 index 000000000..6a1721deb --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_new/help/mod.rs @@ -0,0 +1,13 @@ +use cargo_test_support::curr_dir; +use cargo_test_support::prelude::*; + +#[cargo_test] +fn case() { + snapbox::cmd::Command::cargo_ui() + .arg("new") + .arg("--help") + .assert() + .success() + .stdout_matches_path(curr_dir!().join("stdout.log")) + .stderr_matches_path(curr_dir!().join("stderr.log")); +} diff --git a/src/tools/cargo/tests/testsuite/cargo_new/help/stderr.log b/src/tools/cargo/tests/testsuite/cargo_new/help/stderr.log new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_new/help/stderr.log diff --git a/src/tools/cargo/tests/testsuite/cargo_new/help/stdout.log b/src/tools/cargo/tests/testsuite/cargo_new/help/stdout.log new file mode 100644 index 000000000..7252e0da1 --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_new/help/stdout.log @@ -0,0 +1,31 @@ +Create a new cargo package at <path> + +Usage: cargo[EXE] new [OPTIONS] <path> + +Arguments: + <path> + +Options: + --vcs <VCS> Initialize a new repository for the given version control system (git, + hg, pijul, or fossil) or do not initialize any version control at all + (none), overriding a global configuration. [possible values: git, hg, + pijul, fossil, none] + --bin Use a binary (application) template [default] + --lib Use a library template + --edition <YEAR> Edition to set for the crate generated [possible values: 2015, 2018, + 2021] + --name <NAME> Set the resulting package name, defaults to the directory name + --registry <REGISTRY> Registry to use + -q, --quiet Do not print cargo log messages + -v, --verbose... Use verbose output (-vv very verbose/build.rs output) + --color <WHEN> Coloring: auto, always, never + --config <KEY=VALUE> Override a configuration value + -Z <FLAG> Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for details + -h, --help Print help + +Manifest Options: + --frozen Require Cargo.lock and cache are up to date + --locked Require Cargo.lock is up to date + --offline Run without accessing the network + +Run `cargo help new` for more detailed information. diff --git a/src/tools/cargo/tests/testsuite/cargo_new/mod.rs b/src/tools/cargo/tests/testsuite/cargo_new/mod.rs index e895cf883..887316395 100644 --- a/src/tools/cargo/tests/testsuite/cargo_new/mod.rs +++ b/src/tools/cargo/tests/testsuite/cargo_new/mod.rs @@ -1,3 +1,4 @@ +mod help; mod inherit_workspace_lints; mod inherit_workspace_package_table; mod inherit_workspace_package_table_with_edition; diff --git a/src/tools/cargo/tests/testsuite/cargo_owner/help/mod.rs b/src/tools/cargo/tests/testsuite/cargo_owner/help/mod.rs new file mode 100644 index 000000000..20583e5b1 --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_owner/help/mod.rs @@ -0,0 +1,13 @@ +use cargo_test_support::curr_dir; +use cargo_test_support::prelude::*; + +#[cargo_test] +fn case() { + snapbox::cmd::Command::cargo_ui() + .arg("owner") + .arg("--help") + .assert() + .success() + .stdout_matches_path(curr_dir!().join("stdout.log")) + .stderr_matches_path(curr_dir!().join("stderr.log")); +} diff --git a/src/tools/cargo/tests/testsuite/cargo_owner/help/stderr.log b/src/tools/cargo/tests/testsuite/cargo_owner/help/stderr.log new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_owner/help/stderr.log diff --git a/src/tools/cargo/tests/testsuite/cargo_owner/help/stdout.log b/src/tools/cargo/tests/testsuite/cargo_owner/help/stdout.log new file mode 100644 index 000000000..3c8495ff0 --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_owner/help/stdout.log @@ -0,0 +1,27 @@ +Manage the owners of a crate on the registry + +Usage: cargo[EXE] owner [OPTIONS] [crate] + +Arguments: + [crate] + +Options: + -a, --add <LOGIN> Name of a user or team to invite as an owner + -r, --remove <LOGIN> Name of a user or team to remove as an owner + -l, --list List owners of a crate + --index <INDEX> Registry index to modify owners for + --token <TOKEN> API token to use when authenticating + --registry <REGISTRY> Registry to use + -q, --quiet Do not print cargo log messages + -v, --verbose... Use verbose output (-vv very verbose/build.rs output) + --color <WHEN> Coloring: auto, always, never + --config <KEY=VALUE> Override a configuration value + -Z <FLAG> Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for details + -h, --help Print help + +Manifest Options: + --frozen Require Cargo.lock and cache are up to date + --locked Require Cargo.lock is up to date + --offline Run without accessing the network + +Run `cargo help owner` for more detailed information. diff --git a/src/tools/cargo/tests/testsuite/cargo_owner/mod.rs b/src/tools/cargo/tests/testsuite/cargo_owner/mod.rs new file mode 100644 index 000000000..c0ce11180 --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_owner/mod.rs @@ -0,0 +1 @@ +mod help; diff --git a/src/tools/cargo/tests/testsuite/cargo_package/help/mod.rs b/src/tools/cargo/tests/testsuite/cargo_package/help/mod.rs new file mode 100644 index 000000000..4e2f28e4f --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_package/help/mod.rs @@ -0,0 +1,13 @@ +use cargo_test_support::curr_dir; +use cargo_test_support::prelude::*; + +#[cargo_test] +fn case() { + snapbox::cmd::Command::cargo_ui() + .arg("package") + .arg("--help") + .assert() + .success() + .stdout_matches_path(curr_dir!().join("stdout.log")) + .stderr_matches_path(curr_dir!().join("stderr.log")); +} diff --git a/src/tools/cargo/tests/testsuite/cargo_package/help/stderr.log b/src/tools/cargo/tests/testsuite/cargo_package/help/stderr.log new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_package/help/stderr.log diff --git a/src/tools/cargo/tests/testsuite/cargo_package/help/stdout.log b/src/tools/cargo/tests/testsuite/cargo_package/help/stdout.log new file mode 100644 index 000000000..35e32f313 --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_package/help/stdout.log @@ -0,0 +1,39 @@ +Assemble the local package into a distributable tarball + +Usage: cargo[EXE] package [OPTIONS] + +Options: + -l, --list Print files included in a package without making one + --no-verify Don't verify the contents by building them + --no-metadata Ignore warnings about a lack of human-usable metadata + --allow-dirty Allow dirty working directories to be packaged + -q, --quiet Do not print cargo log messages + -v, --verbose... Use verbose output (-vv very verbose/build.rs output) + --color <WHEN> Coloring: auto, always, never + --config <KEY=VALUE> Override a configuration value + -Z <FLAG> Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for details + -h, --help Print help + +Package Selection: + -p, --package [<SPEC>] Package(s) to assemble + --workspace Assemble all packages in the workspace + --exclude <SPEC> Don't assemble specified packages + +Feature Selection: + -F, --features <FEATURES> Space or comma separated list of features to activate + --all-features Activate all available features + --no-default-features Do not activate the `default` feature + +Compilation Options: + --target <TRIPLE> Build for the target triple + --target-dir <DIRECTORY> Directory for all generated artifacts + -j, --jobs <N> Number of parallel jobs, defaults to # of CPUs. + --keep-going Do not abort the build as soon as there is an error (unstable) + +Manifest Options: + --manifest-path <PATH> Path to Cargo.toml + --frozen Require Cargo.lock and cache are up to date + --locked Require Cargo.lock is up to date + --offline Run without accessing the network + +Run `cargo help package` for more detailed information. diff --git a/src/tools/cargo/tests/testsuite/cargo_package/mod.rs b/src/tools/cargo/tests/testsuite/cargo_package/mod.rs new file mode 100644 index 000000000..c0ce11180 --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_package/mod.rs @@ -0,0 +1 @@ +mod help; diff --git a/src/tools/cargo/tests/testsuite/cargo_pkgid/help/mod.rs b/src/tools/cargo/tests/testsuite/cargo_pkgid/help/mod.rs new file mode 100644 index 000000000..6d182d116 --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_pkgid/help/mod.rs @@ -0,0 +1,13 @@ +use cargo_test_support::curr_dir; +use cargo_test_support::prelude::*; + +#[cargo_test] +fn case() { + snapbox::cmd::Command::cargo_ui() + .arg("pkgid") + .arg("--help") + .assert() + .success() + .stdout_matches_path(curr_dir!().join("stdout.log")) + .stderr_matches_path(curr_dir!().join("stderr.log")); +} diff --git a/src/tools/cargo/tests/testsuite/cargo_pkgid/help/stderr.log b/src/tools/cargo/tests/testsuite/cargo_pkgid/help/stderr.log new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_pkgid/help/stderr.log diff --git a/src/tools/cargo/tests/testsuite/cargo_pkgid/help/stdout.log b/src/tools/cargo/tests/testsuite/cargo_pkgid/help/stdout.log new file mode 100644 index 000000000..ed48bb7ea --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_pkgid/help/stdout.log @@ -0,0 +1,25 @@ +Print a fully qualified package specification + +Usage: cargo[EXE] pkgid [OPTIONS] [spec] + +Arguments: + [spec] + +Options: + -q, --quiet Do not print cargo log messages + -v, --verbose... Use verbose output (-vv very verbose/build.rs output) + --color <WHEN> Coloring: auto, always, never + --config <KEY=VALUE> Override a configuration value + -Z <FLAG> Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for details + -h, --help Print help + +Package Selection: + -p, --package [<SPEC>] Argument to get the package ID specifier for + +Manifest Options: + --manifest-path <PATH> Path to Cargo.toml + --frozen Require Cargo.lock and cache are up to date + --locked Require Cargo.lock is up to date + --offline Run without accessing the network + +Run `cargo help pkgid` for more detailed information. diff --git a/src/tools/cargo/tests/testsuite/cargo_pkgid/mod.rs b/src/tools/cargo/tests/testsuite/cargo_pkgid/mod.rs new file mode 100644 index 000000000..c0ce11180 --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_pkgid/mod.rs @@ -0,0 +1 @@ +mod help; diff --git a/src/tools/cargo/tests/testsuite/cargo_publish/help/mod.rs b/src/tools/cargo/tests/testsuite/cargo_publish/help/mod.rs new file mode 100644 index 000000000..183b6aac4 --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_publish/help/mod.rs @@ -0,0 +1,13 @@ +use cargo_test_support::curr_dir; +use cargo_test_support::prelude::*; + +#[cargo_test] +fn case() { + snapbox::cmd::Command::cargo_ui() + .arg("publish") + .arg("--help") + .assert() + .success() + .stdout_matches_path(curr_dir!().join("stdout.log")) + .stderr_matches_path(curr_dir!().join("stderr.log")); +} diff --git a/src/tools/cargo/tests/testsuite/cargo_publish/help/stderr.log b/src/tools/cargo/tests/testsuite/cargo_publish/help/stderr.log new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_publish/help/stderr.log diff --git a/src/tools/cargo/tests/testsuite/cargo_publish/help/stdout.log b/src/tools/cargo/tests/testsuite/cargo_publish/help/stdout.log new file mode 100644 index 000000000..c02522887 --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_publish/help/stdout.log @@ -0,0 +1,39 @@ +Upload a package to the registry + +Usage: cargo[EXE] publish [OPTIONS] + +Options: + --dry-run Perform all checks without uploading + --index <INDEX> Registry index URL to upload the package to + --registry <REGISTRY> Registry to publish to + --token <TOKEN> Token to use when uploading + --no-verify Don't verify the contents by building them + --allow-dirty Allow dirty working directories to be packaged + -q, --quiet Do not print cargo log messages + -v, --verbose... Use verbose output (-vv very verbose/build.rs output) + --color <WHEN> Coloring: auto, always, never + --config <KEY=VALUE> Override a configuration value + -Z <FLAG> Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for details + -h, --help Print help + +Package Selection: + -p, --package [<SPEC>] Package to publish + +Feature Selection: + -F, --features <FEATURES> Space or comma separated list of features to activate + --all-features Activate all available features + --no-default-features Do not activate the `default` feature + +Compilation Options: + -j, --jobs <N> Number of parallel jobs, defaults to # of CPUs. + --keep-going Do not abort the build as soon as there is an error (unstable) + --target <TRIPLE> Build for the target triple + --target-dir <DIRECTORY> Directory for all generated artifacts + +Manifest Options: + --manifest-path <PATH> Path to Cargo.toml + --frozen Require Cargo.lock and cache are up to date + --locked Require Cargo.lock is up to date + --offline Run without accessing the network + +Run `cargo help publish` for more detailed information. diff --git a/src/tools/cargo/tests/testsuite/cargo_publish/mod.rs b/src/tools/cargo/tests/testsuite/cargo_publish/mod.rs new file mode 100644 index 000000000..c0ce11180 --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_publish/mod.rs @@ -0,0 +1 @@ +mod help; diff --git a/src/tools/cargo/tests/testsuite/cargo_read_manifest/help/mod.rs b/src/tools/cargo/tests/testsuite/cargo_read_manifest/help/mod.rs new file mode 100644 index 000000000..d0055f6d8 --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_read_manifest/help/mod.rs @@ -0,0 +1,13 @@ +use cargo_test_support::curr_dir; +use cargo_test_support::prelude::*; + +#[cargo_test] +fn case() { + snapbox::cmd::Command::cargo_ui() + .arg("read-manifest") + .arg("--help") + .assert() + .success() + .stdout_matches_path(curr_dir!().join("stdout.log")) + .stderr_matches_path(curr_dir!().join("stderr.log")); +} diff --git a/src/tools/cargo/tests/testsuite/cargo_read_manifest/help/stderr.log b/src/tools/cargo/tests/testsuite/cargo_read_manifest/help/stderr.log new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_read_manifest/help/stderr.log diff --git a/src/tools/cargo/tests/testsuite/cargo_read_manifest/help/stdout.log b/src/tools/cargo/tests/testsuite/cargo_read_manifest/help/stdout.log new file mode 100644 index 000000000..83db5413d --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_read_manifest/help/stdout.log @@ -0,0 +1,19 @@ +Print a JSON representation of a Cargo.toml manifest. + +Deprecated, use `cargo metadata --no-deps` instead. + +Usage: cargo[EXE] read-manifest [OPTIONS] + +Options: + -q, --quiet Do not print cargo log messages + -v, --verbose... Use verbose output (-vv very verbose/build.rs output) + --color <WHEN> Coloring: auto, always, never + --config <KEY=VALUE> Override a configuration value + -Z <FLAG> Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for details + -h, --help Print help + +Manifest Options: + --manifest-path <PATH> Path to Cargo.toml + --frozen Require Cargo.lock and cache are up to date + --locked Require Cargo.lock is up to date + --offline Run without accessing the network diff --git a/src/tools/cargo/tests/testsuite/cargo_read_manifest/mod.rs b/src/tools/cargo/tests/testsuite/cargo_read_manifest/mod.rs new file mode 100644 index 000000000..c0ce11180 --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_read_manifest/mod.rs @@ -0,0 +1 @@ +mod help; diff --git a/src/tools/cargo/tests/testsuite/cargo_remove/avoid_empty_tables/stderr.log b/src/tools/cargo/tests/testsuite/cargo_remove/avoid_empty_tables/stderr.log index dd71023a8..486ef359f 100644 --- a/src/tools/cargo/tests/testsuite/cargo_remove/avoid_empty_tables/stderr.log +++ b/src/tools/cargo/tests/testsuite/cargo_remove/avoid_empty_tables/stderr.log @@ -1,2 +1 @@ Removing clippy from dependencies - Updating `dummy-registry` index diff --git a/src/tools/cargo/tests/testsuite/cargo_remove/build/stderr.log b/src/tools/cargo/tests/testsuite/cargo_remove/build/stderr.log index f037ebe28..a51bea48c 100644 --- a/src/tools/cargo/tests/testsuite/cargo_remove/build/stderr.log +++ b/src/tools/cargo/tests/testsuite/cargo_remove/build/stderr.log @@ -1,2 +1 @@ Removing semver from build-dependencies - Updating `dummy-registry` index diff --git a/src/tools/cargo/tests/testsuite/cargo_remove/dev/stderr.log b/src/tools/cargo/tests/testsuite/cargo_remove/dev/stderr.log index c629b26b1..ccabdb193 100644 --- a/src/tools/cargo/tests/testsuite/cargo_remove/dev/stderr.log +++ b/src/tools/cargo/tests/testsuite/cargo_remove/dev/stderr.log @@ -1,2 +1 @@ Removing regex from dev-dependencies - Updating `dummy-registry` index diff --git a/src/tools/cargo/tests/testsuite/cargo_remove/gc_keep_used_patch/in/Cargo.toml b/src/tools/cargo/tests/testsuite/cargo_remove/gc_keep_used_patch/in/Cargo.toml new file mode 100644 index 000000000..28b028417 --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_remove/gc_keep_used_patch/in/Cargo.toml @@ -0,0 +1,8 @@ +# Cargo.toml + +[workspace] +members = ["serde", "serde_derive"] + +[patch.crates-io] +serde = { path = "serde" } + diff --git a/src/tools/cargo/tests/testsuite/cargo_remove/gc_keep_used_patch/in/serde/Cargo.toml b/src/tools/cargo/tests/testsuite/cargo_remove/gc_keep_used_patch/in/serde/Cargo.toml new file mode 100644 index 000000000..c05589aba --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_remove/gc_keep_used_patch/in/serde/Cargo.toml @@ -0,0 +1,9 @@ +# serde/Cargo.toml + +[package] +name = "serde" +version = "1.0.0" + +[dependencies] +serde_derive = { path = "../serde_derive" } + diff --git a/src/tools/cargo/tests/testsuite/cargo_remove/gc_keep_used_patch/in/serde/src/lib.rs b/src/tools/cargo/tests/testsuite/cargo_remove/gc_keep_used_patch/in/serde/src/lib.rs new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_remove/gc_keep_used_patch/in/serde/src/lib.rs diff --git a/src/tools/cargo/tests/testsuite/cargo_remove/gc_keep_used_patch/in/serde_derive/Cargo.toml b/src/tools/cargo/tests/testsuite/cargo_remove/gc_keep_used_patch/in/serde_derive/Cargo.toml new file mode 100644 index 000000000..2b9b48b50 --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_remove/gc_keep_used_patch/in/serde_derive/Cargo.toml @@ -0,0 +1,8 @@ +# serde_derive/Cargo.toml + +[package] +name = "serde_derive" +version = "1.0.0" + +[dev-dependencies] +serde_json = "1.0.0" diff --git a/src/tools/cargo/tests/testsuite/cargo_remove/gc_keep_used_patch/in/serde_derive/src/lib.rs b/src/tools/cargo/tests/testsuite/cargo_remove/gc_keep_used_patch/in/serde_derive/src/lib.rs new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_remove/gc_keep_used_patch/in/serde_derive/src/lib.rs diff --git a/src/tools/cargo/tests/testsuite/cargo_remove/gc_keep_used_patch/mod.rs b/src/tools/cargo/tests/testsuite/cargo_remove/gc_keep_used_patch/mod.rs new file mode 100644 index 000000000..f66478c5d --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_remove/gc_keep_used_patch/mod.rs @@ -0,0 +1,27 @@ +use cargo_test_support::compare::assert_ui; +use cargo_test_support::curr_dir; +use cargo_test_support::CargoCommand; +use cargo_test_support::Project; + +#[cargo_test] +fn case() { + cargo_test_support::registry::init(); + cargo_test_support::registry::Package::new("serde", "1.0.0").publish(); + cargo_test_support::registry::Package::new("serde_json", "1.0.0") + .dep("serde", "1.0.0") + .publish(); + + let project = Project::from_template(curr_dir!().join("in")); + let project_root = project.root(); + + snapbox::cmd::Command::cargo_ui() + .current_dir(&project_root) + .arg("remove") + .args(["--package", "serde", "serde_derive"]) + .assert() + .code(0) + .stdout_matches_path(curr_dir!().join("stdout.log")) + .stderr_matches_path(curr_dir!().join("stderr.log")); + + assert_ui().subset_matches(curr_dir!().join("out"), &project_root); +} diff --git a/src/tools/cargo/tests/testsuite/cargo_remove/gc_keep_used_patch/out/Cargo.toml b/src/tools/cargo/tests/testsuite/cargo_remove/gc_keep_used_patch/out/Cargo.toml new file mode 100644 index 000000000..28b028417 --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_remove/gc_keep_used_patch/out/Cargo.toml @@ -0,0 +1,8 @@ +# Cargo.toml + +[workspace] +members = ["serde", "serde_derive"] + +[patch.crates-io] +serde = { path = "serde" } + diff --git a/src/tools/cargo/tests/testsuite/cargo_remove/gc_keep_used_patch/out/serde/Cargo.toml b/src/tools/cargo/tests/testsuite/cargo_remove/gc_keep_used_patch/out/serde/Cargo.toml new file mode 100644 index 000000000..a91d8ebd5 --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_remove/gc_keep_used_patch/out/serde/Cargo.toml @@ -0,0 +1,6 @@ +# serde/Cargo.toml + +[package] +name = "serde" +version = "1.0.0" + diff --git a/src/tools/cargo/tests/testsuite/cargo_remove/gc_keep_used_patch/out/serde/src/lib.rs b/src/tools/cargo/tests/testsuite/cargo_remove/gc_keep_used_patch/out/serde/src/lib.rs new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_remove/gc_keep_used_patch/out/serde/src/lib.rs diff --git a/src/tools/cargo/tests/testsuite/cargo_remove/gc_keep_used_patch/out/serde_derive/Cargo.toml b/src/tools/cargo/tests/testsuite/cargo_remove/gc_keep_used_patch/out/serde_derive/Cargo.toml new file mode 100644 index 000000000..2b9b48b50 --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_remove/gc_keep_used_patch/out/serde_derive/Cargo.toml @@ -0,0 +1,8 @@ +# serde_derive/Cargo.toml + +[package] +name = "serde_derive" +version = "1.0.0" + +[dev-dependencies] +serde_json = "1.0.0" diff --git a/src/tools/cargo/tests/testsuite/cargo_remove/gc_keep_used_patch/out/serde_derive/src/lib.rs b/src/tools/cargo/tests/testsuite/cargo_remove/gc_keep_used_patch/out/serde_derive/src/lib.rs new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_remove/gc_keep_used_patch/out/serde_derive/src/lib.rs diff --git a/src/tools/cargo/tests/testsuite/cargo_remove/gc_keep_used_patch/stderr.log b/src/tools/cargo/tests/testsuite/cargo_remove/gc_keep_used_patch/stderr.log new file mode 100644 index 000000000..b4377b3a4 --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_remove/gc_keep_used_patch/stderr.log @@ -0,0 +1 @@ + Removing serde_derive from dependencies diff --git a/src/tools/cargo/tests/testsuite/cargo_remove/gc_keep_used_patch/stdout.log b/src/tools/cargo/tests/testsuite/cargo_remove/gc_keep_used_patch/stdout.log new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_remove/gc_keep_used_patch/stdout.log diff --git a/src/tools/cargo/tests/testsuite/cargo_remove/gc_patch/mod.rs b/src/tools/cargo/tests/testsuite/cargo_remove/gc_patch/mod.rs index ec521a5bb..d4d305323 100644 --- a/src/tools/cargo/tests/testsuite/cargo_remove/gc_patch/mod.rs +++ b/src/tools/cargo/tests/testsuite/cargo_remove/gc_patch/mod.rs @@ -23,6 +23,13 @@ fn case() { }) .url(); + let git_project3 = git::new("bar3", |project| { + project + .file("Cargo.toml", &basic_manifest("bar", "0.1.0")) + .file("src/lib.rs", "") + }) + .url(); + let in_project = project() .file( "Cargo.toml", @@ -38,7 +45,7 @@ fn case() { bar = {{ git = \"{git_project1}\" }}\n\ \n\ [patch.\"{git_project1}\"]\n\ - bar = {{ git = \"{git_project2}\" }}\n\ + bar = {{ git = \"{git_project3}\" }}\n\ \n\ [patch.crates-io]\n\ bar = {{ git = \"{git_project2}\" }}\n", diff --git a/src/tools/cargo/tests/testsuite/cargo_remove/gc_patch/out/Cargo.lock b/src/tools/cargo/tests/testsuite/cargo_remove/gc_patch/out/Cargo.lock new file mode 100644 index 000000000..4a1467ba1 --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_remove/gc_patch/out/Cargo.lock @@ -0,0 +1,19 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "bar" +version = "0.1.0" +source = "git+[..]" + +[[package]] +name = "my-member" +version = "0.1.0" +dependencies = [ + "bar", +] + +[[package]] +name = "my-project" +version = "0.1.0" diff --git a/src/tools/cargo/tests/testsuite/cargo_remove/gc_patch/stderr.log b/src/tools/cargo/tests/testsuite/cargo_remove/gc_patch/stderr.log index 1dd2e7757..ba519ba1b 100644 --- a/src/tools/cargo/tests/testsuite/cargo_remove/gc_patch/stderr.log +++ b/src/tools/cargo/tests/testsuite/cargo_remove/gc_patch/stderr.log @@ -1,3 +1 @@ Removing bar from dependencies - Updating git repository `[ROOTURL]/bar2` - Updating `dummy-registry` index diff --git a/src/tools/cargo/tests/testsuite/cargo_remove/gc_profile/stderr.log b/src/tools/cargo/tests/testsuite/cargo_remove/gc_profile/stderr.log index 0e2e38f26..9dee9e2b7 100644 --- a/src/tools/cargo/tests/testsuite/cargo_remove/gc_profile/stderr.log +++ b/src/tools/cargo/tests/testsuite/cargo_remove/gc_profile/stderr.log @@ -1,2 +1 @@ Removing toml from dependencies - Updating `dummy-registry` index diff --git a/src/tools/cargo/tests/testsuite/cargo_remove/gc_replace/stderr.log b/src/tools/cargo/tests/testsuite/cargo_remove/gc_replace/stderr.log index 0e2e38f26..9dee9e2b7 100644 --- a/src/tools/cargo/tests/testsuite/cargo_remove/gc_replace/stderr.log +++ b/src/tools/cargo/tests/testsuite/cargo_remove/gc_replace/stderr.log @@ -1,2 +1 @@ Removing toml from dependencies - Updating `dummy-registry` index diff --git a/src/tools/cargo/tests/testsuite/cargo_remove/help/mod.rs b/src/tools/cargo/tests/testsuite/cargo_remove/help/mod.rs new file mode 100644 index 000000000..69fb60f03 --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_remove/help/mod.rs @@ -0,0 +1,13 @@ +use cargo_test_support::curr_dir; +use cargo_test_support::prelude::*; + +#[cargo_test] +fn case() { + snapbox::cmd::Command::cargo_ui() + .arg("remove") + .arg("--help") + .assert() + .success() + .stdout_matches_path(curr_dir!().join("stdout.log")) + .stderr_matches_path(curr_dir!().join("stderr.log")); +} diff --git a/src/tools/cargo/tests/testsuite/cargo_remove/help/stderr.log b/src/tools/cargo/tests/testsuite/cargo_remove/help/stderr.log new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_remove/help/stderr.log diff --git a/src/tools/cargo/tests/testsuite/cargo_remove/help/stdout.log b/src/tools/cargo/tests/testsuite/cargo_remove/help/stdout.log new file mode 100644 index 000000000..81a2d78b6 --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_remove/help/stdout.log @@ -0,0 +1,29 @@ +Remove dependencies from a Cargo.toml manifest file + +Usage: cargo[EXE] remove [OPTIONS] <DEP_ID>... + +Arguments: + <DEP_ID>... Dependencies to be removed + +Options: + --dry-run Don't actually write the manifest + -q, --quiet Do not print cargo log messages + -v, --verbose... Use verbose output (-vv very verbose/build.rs output) + --color <WHEN> Coloring: auto, always, never + --config <KEY=VALUE> Override a configuration value + -Z <FLAG> Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for details + -h, --help Print help + +Section: + --dev Remove as development dependency + --build Remove as build dependency + --target <TARGET> Remove as dependency from the given target platform + +Package Selection: + -p, --package [<SPEC>] Package to remove from + +Manifest Options: + --manifest-path <PATH> Path to Cargo.toml + --frozen Require Cargo.lock and cache are up to date + --locked Require Cargo.lock is up to date + --offline Run without accessing the network diff --git a/src/tools/cargo/tests/testsuite/cargo_remove/mod.rs b/src/tools/cargo/tests/testsuite/cargo_remove/mod.rs index feb08cea4..ea7902bd8 100644 --- a/src/tools/cargo/tests/testsuite/cargo_remove/mod.rs +++ b/src/tools/cargo/tests/testsuite/cargo_remove/mod.rs @@ -2,9 +2,11 @@ mod avoid_empty_tables; mod build; mod dev; mod dry_run; +mod gc_keep_used_patch; mod gc_patch; mod gc_profile; mod gc_replace; +mod help; mod invalid_arg; mod invalid_dep; mod invalid_package; diff --git a/src/tools/cargo/tests/testsuite/cargo_remove/multiple_deps/stderr.log b/src/tools/cargo/tests/testsuite/cargo_remove/multiple_deps/stderr.log index 1eb59aca1..111b1e94a 100644 --- a/src/tools/cargo/tests/testsuite/cargo_remove/multiple_deps/stderr.log +++ b/src/tools/cargo/tests/testsuite/cargo_remove/multiple_deps/stderr.log @@ -1,3 +1,2 @@ Removing docopt from dependencies Removing semver from dependencies - Updating `dummy-registry` index diff --git a/src/tools/cargo/tests/testsuite/cargo_remove/multiple_dev/stderr.log b/src/tools/cargo/tests/testsuite/cargo_remove/multiple_dev/stderr.log index a3042dcc3..8a69c94f5 100644 --- a/src/tools/cargo/tests/testsuite/cargo_remove/multiple_dev/stderr.log +++ b/src/tools/cargo/tests/testsuite/cargo_remove/multiple_dev/stderr.log @@ -1,3 +1,2 @@ Removing regex from dev-dependencies Removing serde from dev-dependencies - Updating `dummy-registry` index diff --git a/src/tools/cargo/tests/testsuite/cargo_remove/optional_dep_feature/stderr.log b/src/tools/cargo/tests/testsuite/cargo_remove/optional_dep_feature/stderr.log index 72c9f9217..d3656ec54 100644 --- a/src/tools/cargo/tests/testsuite/cargo_remove/optional_dep_feature/stderr.log +++ b/src/tools/cargo/tests/testsuite/cargo_remove/optional_dep_feature/stderr.log @@ -1,2 +1 @@ Removing serde from dev-dependencies - Updating `dummy-registry` index diff --git a/src/tools/cargo/tests/testsuite/cargo_remove/optional_feature/stderr.log b/src/tools/cargo/tests/testsuite/cargo_remove/optional_feature/stderr.log index 2dc546fa7..ef7354ef1 100644 --- a/src/tools/cargo/tests/testsuite/cargo_remove/optional_feature/stderr.log +++ b/src/tools/cargo/tests/testsuite/cargo_remove/optional_feature/stderr.log @@ -1,2 +1 @@ Removing semver from dependencies - Updating `dummy-registry` index diff --git a/src/tools/cargo/tests/testsuite/cargo_remove/package/stderr.log b/src/tools/cargo/tests/testsuite/cargo_remove/package/stderr.log index 231026f2b..7083976b1 100644 --- a/src/tools/cargo/tests/testsuite/cargo_remove/package/stderr.log +++ b/src/tools/cargo/tests/testsuite/cargo_remove/package/stderr.log @@ -1,2 +1 @@ Removing docopt from dependencies - Updating `dummy-registry` index diff --git a/src/tools/cargo/tests/testsuite/cargo_remove/remove_basic/stderr.log b/src/tools/cargo/tests/testsuite/cargo_remove/remove_basic/stderr.log index 231026f2b..7083976b1 100644 --- a/src/tools/cargo/tests/testsuite/cargo_remove/remove_basic/stderr.log +++ b/src/tools/cargo/tests/testsuite/cargo_remove/remove_basic/stderr.log @@ -1,2 +1 @@ Removing docopt from dependencies - Updating `dummy-registry` index diff --git a/src/tools/cargo/tests/testsuite/cargo_remove/target/stderr.log b/src/tools/cargo/tests/testsuite/cargo_remove/target/stderr.log index 810abd994..8fb1b5000 100644 --- a/src/tools/cargo/tests/testsuite/cargo_remove/target/stderr.log +++ b/src/tools/cargo/tests/testsuite/cargo_remove/target/stderr.log @@ -1,2 +1 @@ Removing dbus from dependencies for target `x86_64-unknown-linux-gnu` - Updating `dummy-registry` index diff --git a/src/tools/cargo/tests/testsuite/cargo_remove/target_build/stderr.log b/src/tools/cargo/tests/testsuite/cargo_remove/target_build/stderr.log index b06f8f319..673a47ceb 100644 --- a/src/tools/cargo/tests/testsuite/cargo_remove/target_build/stderr.log +++ b/src/tools/cargo/tests/testsuite/cargo_remove/target_build/stderr.log @@ -1,2 +1 @@ Removing semver from build-dependencies for target `x86_64-unknown-linux-gnu` - Updating `dummy-registry` index diff --git a/src/tools/cargo/tests/testsuite/cargo_remove/target_dev/stderr.log b/src/tools/cargo/tests/testsuite/cargo_remove/target_dev/stderr.log index 68553a3bd..854aff44a 100644 --- a/src/tools/cargo/tests/testsuite/cargo_remove/target_dev/stderr.log +++ b/src/tools/cargo/tests/testsuite/cargo_remove/target_dev/stderr.log @@ -1,2 +1 @@ Removing ncurses from dev-dependencies for target `x86_64-unknown-linux-gnu` - Updating `dummy-registry` index diff --git a/src/tools/cargo/tests/testsuite/cargo_remove/update_lock_file/stderr.log b/src/tools/cargo/tests/testsuite/cargo_remove/update_lock_file/stderr.log index 164f8f4b9..1494b0fc5 100644 --- a/src/tools/cargo/tests/testsuite/cargo_remove/update_lock_file/stderr.log +++ b/src/tools/cargo/tests/testsuite/cargo_remove/update_lock_file/stderr.log @@ -1,2 +1 @@ Removing rustc-serialize from dependencies - Updating `dummy-registry` index diff --git a/src/tools/cargo/tests/testsuite/cargo_remove/workspace/stderr.log b/src/tools/cargo/tests/testsuite/cargo_remove/workspace/stderr.log index f037ebe28..a51bea48c 100644 --- a/src/tools/cargo/tests/testsuite/cargo_remove/workspace/stderr.log +++ b/src/tools/cargo/tests/testsuite/cargo_remove/workspace/stderr.log @@ -1,2 +1 @@ Removing semver from build-dependencies - Updating `dummy-registry` index diff --git a/src/tools/cargo/tests/testsuite/cargo_remove/workspace_non_virtual/stderr.log b/src/tools/cargo/tests/testsuite/cargo_remove/workspace_non_virtual/stderr.log index f037ebe28..a51bea48c 100644 --- a/src/tools/cargo/tests/testsuite/cargo_remove/workspace_non_virtual/stderr.log +++ b/src/tools/cargo/tests/testsuite/cargo_remove/workspace_non_virtual/stderr.log @@ -1,2 +1 @@ Removing semver from build-dependencies - Updating `dummy-registry` index diff --git a/src/tools/cargo/tests/testsuite/cargo_remove/workspace_preserved/stderr.log b/src/tools/cargo/tests/testsuite/cargo_remove/workspace_preserved/stderr.log index f037ebe28..a51bea48c 100644 --- a/src/tools/cargo/tests/testsuite/cargo_remove/workspace_preserved/stderr.log +++ b/src/tools/cargo/tests/testsuite/cargo_remove/workspace_preserved/stderr.log @@ -1,2 +1 @@ Removing semver from build-dependencies - Updating `dummy-registry` index diff --git a/src/tools/cargo/tests/testsuite/cargo_report/help/mod.rs b/src/tools/cargo/tests/testsuite/cargo_report/help/mod.rs new file mode 100644 index 000000000..3d2975769 --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_report/help/mod.rs @@ -0,0 +1,13 @@ +use cargo_test_support::curr_dir; +use cargo_test_support::prelude::*; + +#[cargo_test] +fn case() { + snapbox::cmd::Command::cargo_ui() + .arg("report") + .arg("--help") + .assert() + .success() + .stdout_matches_path(curr_dir!().join("stdout.log")) + .stderr_matches_path(curr_dir!().join("stderr.log")); +} diff --git a/src/tools/cargo/tests/testsuite/cargo_report/help/stderr.log b/src/tools/cargo/tests/testsuite/cargo_report/help/stderr.log new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_report/help/stderr.log diff --git a/src/tools/cargo/tests/testsuite/cargo_report/help/stdout.log b/src/tools/cargo/tests/testsuite/cargo_report/help/stdout.log new file mode 100644 index 000000000..67819de55 --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_report/help/stdout.log @@ -0,0 +1,20 @@ +Generate and display various kinds of reports + +Usage: cargo[EXE] report [OPTIONS] <COMMAND> + +Commands: + future-incompatibilities Reports any crates which will eventually stop compiling + +Options: + -v, --verbose... Use verbose output (-vv very verbose/build.rs output) + --color <WHEN> Coloring: auto, always, never + --config <KEY=VALUE> Override a configuration value + -Z <FLAG> Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for details + -h, --help Print help + +Manifest Options: + --frozen Require Cargo.lock and cache are up to date + --locked Require Cargo.lock is up to date + --offline Run without accessing the network + +Run `cargo help report` for more detailed information. diff --git a/src/tools/cargo/tests/testsuite/cargo_report/mod.rs b/src/tools/cargo/tests/testsuite/cargo_report/mod.rs new file mode 100644 index 000000000..c0ce11180 --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_report/mod.rs @@ -0,0 +1 @@ +mod help; diff --git a/src/tools/cargo/tests/testsuite/cargo_run/help/mod.rs b/src/tools/cargo/tests/testsuite/cargo_run/help/mod.rs new file mode 100644 index 000000000..0a8a6bde0 --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_run/help/mod.rs @@ -0,0 +1,13 @@ +use cargo_test_support::curr_dir; +use cargo_test_support::prelude::*; + +#[cargo_test] +fn case() { + snapbox::cmd::Command::cargo_ui() + .arg("run") + .arg("--help") + .assert() + .success() + .stdout_matches_path(curr_dir!().join("stdout.log")) + .stderr_matches_path(curr_dir!().join("stderr.log")); +} diff --git a/src/tools/cargo/tests/testsuite/cargo_run/help/stderr.log b/src/tools/cargo/tests/testsuite/cargo_run/help/stderr.log new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_run/help/stderr.log diff --git a/src/tools/cargo/tests/testsuite/cargo_run/help/stdout.log b/src/tools/cargo/tests/testsuite/cargo_run/help/stdout.log new file mode 100644 index 000000000..6ab0e76b1 --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_run/help/stdout.log @@ -0,0 +1,47 @@ +Run a binary or example of the local package + +Usage: cargo[EXE] run [OPTIONS] [args]... + +Arguments: + [args]... Arguments for the binary or example to run + +Options: + --ignore-rust-version Ignore `rust-version` specification in packages + --message-format <FMT> Error format + -q, --quiet Do not print cargo log messages + -v, --verbose... Use verbose output (-vv very verbose/build.rs output) + --color <WHEN> Coloring: auto, always, never + --config <KEY=VALUE> Override a configuration value + -Z <FLAG> Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for + details + -h, --help Print help + +Package Selection: + -p, --package [<SPEC>] Package with the target to run + +Target Selection: + --bin [<NAME>] Name of the bin target to run + --example [<NAME>] Name of the example target to run + +Feature Selection: + -F, --features <FEATURES> Space or comma separated list of features to activate + --all-features Activate all available features + --no-default-features Do not activate the `default` feature + +Compilation Options: + -j, --jobs <N> Number of parallel jobs, defaults to # of CPUs. + --keep-going Do not abort the build as soon as there is an error (unstable) + -r, --release Build artifacts in release mode, with optimizations + --profile <PROFILE-NAME> Build artifacts with the specified profile + --target <TRIPLE> Build for the target triple + --target-dir <DIRECTORY> Directory for all generated artifacts + --unit-graph Output build graph in JSON (unstable) + --timings[=<FMTS>] Timing output formats (unstable) (comma separated): html, json + +Manifest Options: + --manifest-path <PATH> Path to Cargo.toml + --frozen Require Cargo.lock and cache are up to date + --locked Require Cargo.lock is up to date + --offline Run without accessing the network + +Run `cargo help run` for more detailed information. diff --git a/src/tools/cargo/tests/testsuite/cargo_run/mod.rs b/src/tools/cargo/tests/testsuite/cargo_run/mod.rs new file mode 100644 index 000000000..c0ce11180 --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_run/mod.rs @@ -0,0 +1 @@ +mod help; diff --git a/src/tools/cargo/tests/testsuite/cargo_rustc/help/mod.rs b/src/tools/cargo/tests/testsuite/cargo_rustc/help/mod.rs new file mode 100644 index 000000000..0a3b31686 --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_rustc/help/mod.rs @@ -0,0 +1,13 @@ +use cargo_test_support::curr_dir; +use cargo_test_support::prelude::*; + +#[cargo_test] +fn case() { + snapbox::cmd::Command::cargo_ui() + .arg("rustc") + .arg("--help") + .assert() + .success() + .stdout_matches_path(curr_dir!().join("stdout.log")) + .stderr_matches_path(curr_dir!().join("stderr.log")); +} diff --git a/src/tools/cargo/tests/testsuite/cargo_rustc/help/stderr.log b/src/tools/cargo/tests/testsuite/cargo_rustc/help/stderr.log new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_rustc/help/stderr.log diff --git a/src/tools/cargo/tests/testsuite/cargo_rustc/help/stdout.log b/src/tools/cargo/tests/testsuite/cargo_rustc/help/stdout.log new file mode 100644 index 000000000..f587c3276 --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_rustc/help/stdout.log @@ -0,0 +1,58 @@ +Compile a package, and pass extra options to the compiler + +Usage: cargo[EXE] rustc [OPTIONS] [args]... + +Arguments: + [args]... Extra rustc flags + +Options: + --print <INFO> Output compiler information without compiling + --crate-type <CRATE-TYPE> Comma separated list of types of crates for the compiler to emit + --future-incompat-report Outputs a future incompatibility report at the end of the build + --ignore-rust-version Ignore `rust-version` specification in packages + --message-format <FMT> Error format + -q, --quiet Do not print cargo log messages + -v, --verbose... Use verbose output (-vv very verbose/build.rs output) + --color <WHEN> Coloring: auto, always, never + --config <KEY=VALUE> Override a configuration value + -Z <FLAG> Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for + details + -h, --help Print help + +Package Selection: + -p, --package [<SPEC>] Package to build + +Target Selection: + --lib Build only this package's library + --bins Build all binaries + --bin [<NAME>] Build only the specified binary + --examples Build all examples + --example [<NAME>] Build only the specified example + --tests Build all tests + --test [<NAME>] Build only the specified test target + --benches Build all benches + --bench [<NAME>] Build only the specified bench target + --all-targets Build all targets + +Feature Selection: + -F, --features <FEATURES> Space or comma separated list of features to activate + --all-features Activate all available features + --no-default-features Do not activate the `default` feature + +Compilation Options: + -j, --jobs <N> Number of parallel jobs, defaults to # of CPUs. + --keep-going Do not abort the build as soon as there is an error (unstable) + -r, --release Build artifacts in release mode, with optimizations + --profile <PROFILE-NAME> Build artifacts with the specified profile + --target <TRIPLE> Target triple which compiles will be for + --target-dir <DIRECTORY> Directory for all generated artifacts + --unit-graph Output build graph in JSON (unstable) + --timings[=<FMTS>] Timing output formats (unstable) (comma separated): html, json + +Manifest Options: + --manifest-path <PATH> Path to Cargo.toml + --frozen Require Cargo.lock and cache are up to date + --locked Require Cargo.lock is up to date + --offline Run without accessing the network + +Run `cargo help rustc` for more detailed information. diff --git a/src/tools/cargo/tests/testsuite/cargo_rustc/mod.rs b/src/tools/cargo/tests/testsuite/cargo_rustc/mod.rs new file mode 100644 index 000000000..c0ce11180 --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_rustc/mod.rs @@ -0,0 +1 @@ +mod help; diff --git a/src/tools/cargo/tests/testsuite/cargo_rustdoc/help/mod.rs b/src/tools/cargo/tests/testsuite/cargo_rustdoc/help/mod.rs new file mode 100644 index 000000000..88652749f --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_rustdoc/help/mod.rs @@ -0,0 +1,13 @@ +use cargo_test_support::curr_dir; +use cargo_test_support::prelude::*; + +#[cargo_test] +fn case() { + snapbox::cmd::Command::cargo_ui() + .arg("rustdoc") + .arg("--help") + .assert() + .success() + .stdout_matches_path(curr_dir!().join("stdout.log")) + .stderr_matches_path(curr_dir!().join("stderr.log")); +} diff --git a/src/tools/cargo/tests/testsuite/cargo_rustdoc/help/stderr.log b/src/tools/cargo/tests/testsuite/cargo_rustdoc/help/stderr.log new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_rustdoc/help/stderr.log diff --git a/src/tools/cargo/tests/testsuite/cargo_rustdoc/help/stdout.log b/src/tools/cargo/tests/testsuite/cargo_rustdoc/help/stdout.log new file mode 100644 index 000000000..4cac29e0a --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_rustdoc/help/stdout.log @@ -0,0 +1,56 @@ +Build a package's documentation, using specified custom flags. + +Usage: cargo[EXE] rustdoc [OPTIONS] [args]... + +Arguments: + [args]... Extra rustdoc flags + +Options: + --open Opens the docs in a browser after the operation + --ignore-rust-version Ignore `rust-version` specification in packages + --message-format <FMT> Error format + -q, --quiet Do not print cargo log messages + -v, --verbose... Use verbose output (-vv very verbose/build.rs output) + --color <WHEN> Coloring: auto, always, never + --config <KEY=VALUE> Override a configuration value + -Z <FLAG> Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for + details + -h, --help Print help + +Package Selection: + -p, --package [<SPEC>] Package to document + +Target Selection: + --lib Build only this package's library + --bins Build all binaries + --bin [<NAME>] Build only the specified binary + --examples Build all examples + --example [<NAME>] Build only the specified example + --tests Build all tests + --test [<NAME>] Build only the specified test target + --benches Build all benches + --bench [<NAME>] Build only the specified bench target + --all-targets Build all targets + +Feature Selection: + -F, --features <FEATURES> Space or comma separated list of features to activate + --all-features Activate all available features + --no-default-features Do not activate the `default` feature + +Compilation Options: + -j, --jobs <N> Number of parallel jobs, defaults to # of CPUs. + --keep-going Do not abort the build as soon as there is an error (unstable) + -r, --release Build artifacts in release mode, with optimizations + --profile <PROFILE-NAME> Build artifacts with the specified profile + --target <TRIPLE> Build for the target triple + --target-dir <DIRECTORY> Directory for all generated artifacts + --unit-graph Output build graph in JSON (unstable) + --timings[=<FMTS>] Timing output formats (unstable) (comma separated): html, json + +Manifest Options: + --manifest-path <PATH> Path to Cargo.toml + --frozen Require Cargo.lock and cache are up to date + --locked Require Cargo.lock is up to date + --offline Run without accessing the network + +Run `cargo help rustdoc` for more detailed information. diff --git a/src/tools/cargo/tests/testsuite/cargo_rustdoc/mod.rs b/src/tools/cargo/tests/testsuite/cargo_rustdoc/mod.rs new file mode 100644 index 000000000..c0ce11180 --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_rustdoc/mod.rs @@ -0,0 +1 @@ +mod help; diff --git a/src/tools/cargo/tests/testsuite/cargo_search/help/mod.rs b/src/tools/cargo/tests/testsuite/cargo_search/help/mod.rs new file mode 100644 index 000000000..b580816e7 --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_search/help/mod.rs @@ -0,0 +1,13 @@ +use cargo_test_support::curr_dir; +use cargo_test_support::prelude::*; + +#[cargo_test] +fn case() { + snapbox::cmd::Command::cargo_ui() + .arg("search") + .arg("--help") + .assert() + .success() + .stdout_matches_path(curr_dir!().join("stdout.log")) + .stderr_matches_path(curr_dir!().join("stderr.log")); +} diff --git a/src/tools/cargo/tests/testsuite/cargo_search/help/stderr.log b/src/tools/cargo/tests/testsuite/cargo_search/help/stderr.log new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_search/help/stderr.log diff --git a/src/tools/cargo/tests/testsuite/cargo_search/help/stdout.log b/src/tools/cargo/tests/testsuite/cargo_search/help/stdout.log new file mode 100644 index 000000000..8572064e3 --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_search/help/stdout.log @@ -0,0 +1,24 @@ +Search packages in crates.io + +Usage: cargo[EXE] search [OPTIONS] [query]... + +Arguments: + [query]... + +Options: + --limit <LIMIT> Limit the number of results (default: 10, max: 100) + --index <INDEX> Registry index URL to upload the package to + --registry <REGISTRY> Registry to use + -q, --quiet Do not print cargo log messages + -v, --verbose... Use verbose output (-vv very verbose/build.rs output) + --color <WHEN> Coloring: auto, always, never + --config <KEY=VALUE> Override a configuration value + -Z <FLAG> Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for details + -h, --help Print help + +Manifest Options: + --frozen Require Cargo.lock and cache are up to date + --locked Require Cargo.lock is up to date + --offline Run without accessing the network + +Run `cargo help search` for more detailed information. diff --git a/src/tools/cargo/tests/testsuite/cargo_search/mod.rs b/src/tools/cargo/tests/testsuite/cargo_search/mod.rs new file mode 100644 index 000000000..c0ce11180 --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_search/mod.rs @@ -0,0 +1 @@ +mod help; diff --git a/src/tools/cargo/tests/testsuite/cargo_test/help/mod.rs b/src/tools/cargo/tests/testsuite/cargo_test/help/mod.rs new file mode 100644 index 000000000..ae5b092b7 --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_test/help/mod.rs @@ -0,0 +1,13 @@ +use cargo_test_support::curr_dir; +use cargo_test_support::prelude::*; + +#[cargo_test] +fn case() { + snapbox::cmd::Command::cargo_ui() + .arg("test") + .arg("--help") + .assert() + .success() + .stdout_matches_path(curr_dir!().join("stdout.log")) + .stderr_matches_path(curr_dir!().join("stderr.log")); +} diff --git a/src/tools/cargo/tests/testsuite/cargo_test/help/stderr.log b/src/tools/cargo/tests/testsuite/cargo_test/help/stderr.log new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_test/help/stderr.log diff --git a/src/tools/cargo/tests/testsuite/cargo_test/help/stdout.log b/src/tools/cargo/tests/testsuite/cargo_test/help/stdout.log new file mode 100644 index 000000000..d693dc3c9 --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_test/help/stdout.log @@ -0,0 +1,63 @@ +Execute all unit and integration tests and build examples of a local package + +Usage: cargo[EXE] test [OPTIONS] [TESTNAME] [-- [args]...] + +Arguments: + [TESTNAME] If specified, only run tests containing this string in their names + [args]... Arguments for the test binary + +Options: + --doc Test only this library's documentation + --no-run Compile, but don't run tests + --no-fail-fast Run all tests regardless of failure + --ignore-rust-version Ignore `rust-version` specification in packages + --future-incompat-report Outputs a future incompatibility report at the end of the build + --message-format <FMT> Error format + -q, --quiet Display one character per test instead of one line + -v, --verbose... Use verbose output (-vv very verbose/build.rs output) + --color <WHEN> Coloring: auto, always, never + --config <KEY=VALUE> Override a configuration value + -Z <FLAG> Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for + details + -h, --help Print help + +Package Selection: + -p, --package [<SPEC>] Package to run tests for + --workspace Test all packages in the workspace + --exclude <SPEC> Exclude packages from the test + --all Alias for --workspace (deprecated) + +Target Selection: + --lib Test only this package's library unit tests + --bins Test all binaries + --bin [<NAME>] Test only the specified binary + --examples Test all examples + --example [<NAME>] Test only the specified example + --tests Test all tests + --test [<NAME>] Test only the specified test target + --benches Test all benches + --bench [<NAME>] Test only the specified bench target + --all-targets Test all targets (does not include doctests) + +Feature Selection: + -F, --features <FEATURES> Space or comma separated list of features to activate + --all-features Activate all available features + --no-default-features Do not activate the `default` feature + +Compilation Options: + -j, --jobs <N> Number of parallel jobs, defaults to # of CPUs. + -r, --release Build artifacts in release mode, with optimizations + --profile <PROFILE-NAME> Build artifacts with the specified profile + --target <TRIPLE> Build for the target triple + --target-dir <DIRECTORY> Directory for all generated artifacts + --unit-graph Output build graph in JSON (unstable) + --timings[=<FMTS>] Timing output formats (unstable) (comma separated): html, json + +Manifest Options: + --manifest-path <PATH> Path to Cargo.toml + --frozen Require Cargo.lock and cache are up to date + --locked Require Cargo.lock is up to date + --offline Run without accessing the network + +Run `cargo help test` for more detailed information. +Run `cargo test -- --help` for test binary options. diff --git a/src/tools/cargo/tests/testsuite/cargo_test/mod.rs b/src/tools/cargo/tests/testsuite/cargo_test/mod.rs new file mode 100644 index 000000000..c0ce11180 --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_test/mod.rs @@ -0,0 +1 @@ +mod help; diff --git a/src/tools/cargo/tests/testsuite/cargo_tree/help/mod.rs b/src/tools/cargo/tests/testsuite/cargo_tree/help/mod.rs new file mode 100644 index 000000000..269ac2cdc --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_tree/help/mod.rs @@ -0,0 +1,13 @@ +use cargo_test_support::curr_dir; +use cargo_test_support::prelude::*; + +#[cargo_test] +fn case() { + snapbox::cmd::Command::cargo_ui() + .arg("tree") + .arg("--help") + .assert() + .success() + .stdout_matches_path(curr_dir!().join("stdout.log")) + .stderr_matches_path(curr_dir!().join("stderr.log")); +} diff --git a/src/tools/cargo/tests/testsuite/cargo_tree/help/stderr.log b/src/tools/cargo/tests/testsuite/cargo_tree/help/stderr.log new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_tree/help/stderr.log diff --git a/src/tools/cargo/tests/testsuite/cargo_tree/help/stdout.log b/src/tools/cargo/tests/testsuite/cargo_tree/help/stdout.log new file mode 100644 index 000000000..268b6b2ad --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_tree/help/stdout.log @@ -0,0 +1,45 @@ +Display a tree visualization of a dependency graph + +Usage: cargo[EXE] tree [OPTIONS] + +Options: + -q, --quiet Do not print cargo log messages + -e, --edges <KINDS> The kinds of dependencies to display (features, normal, build, dev, all, + no-normal, no-build, no-dev, no-proc-macro) + -i, --invert [<SPEC>] Invert the tree direction and focus on the given package + --prune <SPEC> Prune the given package from the display of the dependency tree + --depth <DEPTH> Maximum display depth of the dependency tree + --prefix <PREFIX> Change the prefix (indentation) of how each entry is displayed [default: + indent] [possible values: depth, indent, none] + --no-dedupe Do not de-duplicate (repeats all shared dependencies) + -d, --duplicates Show only dependencies which come in multiple versions (implies -i) + --charset <CHARSET> Character set to use in output [default: utf8] [possible values: utf8, + ascii] + -f, --format <FORMAT> Format string used for printing dependencies [default: {p}] + -v, --verbose... Use verbose output (-vv very verbose/build.rs output) + --color <WHEN> Coloring: auto, always, never + --config <KEY=VALUE> Override a configuration value + -Z <FLAG> Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for details + -h, --help Print help + +Package Selection: + -p, --package [<SPEC>] Package to be used as the root of the tree + --workspace Display the tree for all packages in the workspace + --exclude <SPEC> Exclude specific workspace members + +Feature Selection: + -F, --features <FEATURES> Space or comma separated list of features to activate + --all-features Activate all available features + --no-default-features Do not activate the `default` feature + +Compilation Options: + --target <TRIPLE> Filter dependencies matching the given target-triple (default host + platform). Pass `all` to include all targets. + +Manifest Options: + --manifest-path <PATH> Path to Cargo.toml + --frozen Require Cargo.lock and cache are up to date + --locked Require Cargo.lock is up to date + --offline Run without accessing the network + +Run `cargo help tree` for more detailed information. diff --git a/src/tools/cargo/tests/testsuite/cargo_tree/mod.rs b/src/tools/cargo/tests/testsuite/cargo_tree/mod.rs new file mode 100644 index 000000000..c0ce11180 --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_tree/mod.rs @@ -0,0 +1 @@ +mod help; diff --git a/src/tools/cargo/tests/testsuite/cargo_uninstall/help/mod.rs b/src/tools/cargo/tests/testsuite/cargo_uninstall/help/mod.rs new file mode 100644 index 000000000..60c4faed0 --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_uninstall/help/mod.rs @@ -0,0 +1,13 @@ +use cargo_test_support::curr_dir; +use cargo_test_support::prelude::*; + +#[cargo_test] +fn case() { + snapbox::cmd::Command::cargo_ui() + .arg("uninstall") + .arg("--help") + .assert() + .success() + .stdout_matches_path(curr_dir!().join("stdout.log")) + .stderr_matches_path(curr_dir!().join("stderr.log")); +} diff --git a/src/tools/cargo/tests/testsuite/cargo_uninstall/help/stderr.log b/src/tools/cargo/tests/testsuite/cargo_uninstall/help/stderr.log new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_uninstall/help/stderr.log diff --git a/src/tools/cargo/tests/testsuite/cargo_uninstall/help/stdout.log b/src/tools/cargo/tests/testsuite/cargo_uninstall/help/stdout.log new file mode 100644 index 000000000..2da1a5d57 --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_uninstall/help/stdout.log @@ -0,0 +1,28 @@ +Remove a Rust binary + +Usage: cargo[EXE] uninstall [OPTIONS] [spec]... + +Arguments: + [spec]... + +Options: + --root <DIR> Directory to uninstall packages from + -q, --quiet Do not print cargo log messages + -v, --verbose... Use verbose output (-vv very verbose/build.rs output) + --color <WHEN> Coloring: auto, always, never + --config <KEY=VALUE> Override a configuration value + -Z <FLAG> Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for details + -h, --help Print help + +Package Selection: + -p, --package [<SPEC>] Package to uninstall + +Target Selection: + --bin <NAME> Only uninstall the binary NAME + +Manifest Options: + --frozen Require Cargo.lock and cache are up to date + --locked Require Cargo.lock is up to date + --offline Run without accessing the network + +Run `cargo help uninstall` for more detailed information. diff --git a/src/tools/cargo/tests/testsuite/cargo_uninstall/mod.rs b/src/tools/cargo/tests/testsuite/cargo_uninstall/mod.rs new file mode 100644 index 000000000..c0ce11180 --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_uninstall/mod.rs @@ -0,0 +1 @@ +mod help; diff --git a/src/tools/cargo/tests/testsuite/cargo_update/help/mod.rs b/src/tools/cargo/tests/testsuite/cargo_update/help/mod.rs new file mode 100644 index 000000000..ae310977c --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_update/help/mod.rs @@ -0,0 +1,13 @@ +use cargo_test_support::curr_dir; +use cargo_test_support::prelude::*; + +#[cargo_test] +fn case() { + snapbox::cmd::Command::cargo_ui() + .arg("update") + .arg("--help") + .assert() + .success() + .stdout_matches_path(curr_dir!().join("stdout.log")) + .stderr_matches_path(curr_dir!().join("stderr.log")); +} diff --git a/src/tools/cargo/tests/testsuite/cargo_update/help/stderr.log b/src/tools/cargo/tests/testsuite/cargo_update/help/stderr.log new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_update/help/stderr.log diff --git a/src/tools/cargo/tests/testsuite/cargo_update/help/stdout.log b/src/tools/cargo/tests/testsuite/cargo_update/help/stdout.log new file mode 100644 index 000000000..6cc109151 --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_update/help/stdout.log @@ -0,0 +1,26 @@ +Update dependencies as recorded in the local lock file + +Usage: cargo[EXE] update [OPTIONS] + +Options: + --dry-run Don't actually write the lockfile + --aggressive Force updating all dependencies of SPEC as well when used with -p + --precise <PRECISE> Update a single dependency to exactly PRECISE when used with -p + -q, --quiet Do not print cargo log messages + -v, --verbose... Use verbose output (-vv very verbose/build.rs output) + --color <WHEN> Coloring: auto, always, never + --config <KEY=VALUE> Override a configuration value + -Z <FLAG> Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for details + -h, --help Print help + +Package Selection: + -w, --workspace Only update the workspace packages + -p, --package [<SPEC>] Package to update + +Manifest Options: + --manifest-path <PATH> Path to Cargo.toml + --frozen Require Cargo.lock and cache are up to date + --locked Require Cargo.lock is up to date + --offline Run without accessing the network + +Run `cargo help update` for more detailed information. diff --git a/src/tools/cargo/tests/testsuite/cargo_update/mod.rs b/src/tools/cargo/tests/testsuite/cargo_update/mod.rs new file mode 100644 index 000000000..c0ce11180 --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_update/mod.rs @@ -0,0 +1 @@ +mod help; diff --git a/src/tools/cargo/tests/testsuite/cargo_vendor/help/mod.rs b/src/tools/cargo/tests/testsuite/cargo_vendor/help/mod.rs new file mode 100644 index 000000000..c111b99c0 --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_vendor/help/mod.rs @@ -0,0 +1,13 @@ +use cargo_test_support::curr_dir; +use cargo_test_support::prelude::*; + +#[cargo_test] +fn case() { + snapbox::cmd::Command::cargo_ui() + .arg("vendor") + .arg("--help") + .assert() + .success() + .stdout_matches_path(curr_dir!().join("stdout.log")) + .stderr_matches_path(curr_dir!().join("stderr.log")); +} diff --git a/src/tools/cargo/tests/testsuite/cargo_vendor/help/stderr.log b/src/tools/cargo/tests/testsuite/cargo_vendor/help/stderr.log new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_vendor/help/stderr.log diff --git a/src/tools/cargo/tests/testsuite/cargo_vendor/help/stdout.log b/src/tools/cargo/tests/testsuite/cargo_vendor/help/stdout.log new file mode 100644 index 000000000..7f37ab56e --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_vendor/help/stdout.log @@ -0,0 +1,27 @@ +Vendor all dependencies for a project locally + +Usage: cargo[EXE] vendor [OPTIONS] [path] + +Arguments: + [path] Where to vendor crates (`vendor` by default) + +Options: + --no-delete Don't delete older crates in the vendor directory + -s, --sync <TOML> Additional `Cargo.toml` to sync and vendor + --respect-source-config Respect `[source]` config in `.cargo/config` + --versioned-dirs Always include version in subdir name + -q, --quiet Do not print cargo log messages + -v, --verbose... Use verbose output (-vv very verbose/build.rs output) + --color <WHEN> Coloring: auto, always, never + --config <KEY=VALUE> Override a configuration value + -Z <FLAG> Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for + details + -h, --help Print help + +Manifest Options: + --manifest-path <PATH> Path to Cargo.toml + --frozen Require Cargo.lock and cache are up to date + --locked Require Cargo.lock is up to date + --offline Run without accessing the network + +Run `cargo help vendor` for more detailed information. diff --git a/src/tools/cargo/tests/testsuite/cargo_vendor/mod.rs b/src/tools/cargo/tests/testsuite/cargo_vendor/mod.rs new file mode 100644 index 000000000..c0ce11180 --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_vendor/mod.rs @@ -0,0 +1 @@ +mod help; diff --git a/src/tools/cargo/tests/testsuite/cargo_verify_project/help/mod.rs b/src/tools/cargo/tests/testsuite/cargo_verify_project/help/mod.rs new file mode 100644 index 000000000..8f6c9bab1 --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_verify_project/help/mod.rs @@ -0,0 +1,13 @@ +use cargo_test_support::curr_dir; +use cargo_test_support::prelude::*; + +#[cargo_test] +fn case() { + snapbox::cmd::Command::cargo_ui() + .arg("verify-project") + .arg("--help") + .assert() + .success() + .stdout_matches_path(curr_dir!().join("stdout.log")) + .stderr_matches_path(curr_dir!().join("stderr.log")); +} diff --git a/src/tools/cargo/tests/testsuite/cargo_verify_project/help/stderr.log b/src/tools/cargo/tests/testsuite/cargo_verify_project/help/stderr.log new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_verify_project/help/stderr.log diff --git a/src/tools/cargo/tests/testsuite/cargo_verify_project/help/stdout.log b/src/tools/cargo/tests/testsuite/cargo_verify_project/help/stdout.log new file mode 100644 index 000000000..a61534500 --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_verify_project/help/stdout.log @@ -0,0 +1,19 @@ +Check correctness of crate manifest + +Usage: cargo[EXE] verify-project [OPTIONS] + +Options: + -q, --quiet Do not print cargo log messages + -v, --verbose... Use verbose output (-vv very verbose/build.rs output) + --color <WHEN> Coloring: auto, always, never + --config <KEY=VALUE> Override a configuration value + -Z <FLAG> Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for details + -h, --help Print help + +Manifest Options: + --manifest-path <PATH> Path to Cargo.toml + --frozen Require Cargo.lock and cache are up to date + --locked Require Cargo.lock is up to date + --offline Run without accessing the network + +Run `cargo help verify-project` for more detailed information. diff --git a/src/tools/cargo/tests/testsuite/cargo_verify_project/mod.rs b/src/tools/cargo/tests/testsuite/cargo_verify_project/mod.rs new file mode 100644 index 000000000..c0ce11180 --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_verify_project/mod.rs @@ -0,0 +1 @@ +mod help; diff --git a/src/tools/cargo/tests/testsuite/cargo_version/help/mod.rs b/src/tools/cargo/tests/testsuite/cargo_version/help/mod.rs new file mode 100644 index 000000000..daa8548c6 --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_version/help/mod.rs @@ -0,0 +1,13 @@ +use cargo_test_support::curr_dir; +use cargo_test_support::prelude::*; + +#[cargo_test] +fn case() { + snapbox::cmd::Command::cargo_ui() + .arg("version") + .arg("--help") + .assert() + .success() + .stdout_matches_path(curr_dir!().join("stdout.log")) + .stderr_matches_path(curr_dir!().join("stderr.log")); +} diff --git a/src/tools/cargo/tests/testsuite/cargo_version/help/stderr.log b/src/tools/cargo/tests/testsuite/cargo_version/help/stderr.log new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_version/help/stderr.log diff --git a/src/tools/cargo/tests/testsuite/cargo_version/help/stdout.log b/src/tools/cargo/tests/testsuite/cargo_version/help/stdout.log new file mode 100644 index 000000000..3f79051ad --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_version/help/stdout.log @@ -0,0 +1,18 @@ +Show version information + +Usage: cargo[EXE] version [OPTIONS] + +Options: + -q, --quiet Do not print cargo log messages + -v, --verbose... Use verbose output (-vv very verbose/build.rs output) + --color <WHEN> Coloring: auto, always, never + --config <KEY=VALUE> Override a configuration value + -Z <FLAG> Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for details + -h, --help Print help + +Manifest Options: + --frozen Require Cargo.lock and cache are up to date + --locked Require Cargo.lock is up to date + --offline Run without accessing the network + +Run `cargo help version` for more detailed information. diff --git a/src/tools/cargo/tests/testsuite/cargo_version/mod.rs b/src/tools/cargo/tests/testsuite/cargo_version/mod.rs new file mode 100644 index 000000000..c0ce11180 --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_version/mod.rs @@ -0,0 +1 @@ +mod help; diff --git a/src/tools/cargo/tests/testsuite/cargo_yank/help/mod.rs b/src/tools/cargo/tests/testsuite/cargo_yank/help/mod.rs new file mode 100644 index 000000000..12034f152 --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_yank/help/mod.rs @@ -0,0 +1,13 @@ +use cargo_test_support::curr_dir; +use cargo_test_support::prelude::*; + +#[cargo_test] +fn case() { + snapbox::cmd::Command::cargo_ui() + .arg("yank") + .arg("--help") + .assert() + .success() + .stdout_matches_path(curr_dir!().join("stdout.log")) + .stderr_matches_path(curr_dir!().join("stderr.log")); +} diff --git a/src/tools/cargo/tests/testsuite/cargo_yank/help/stderr.log b/src/tools/cargo/tests/testsuite/cargo_yank/help/stderr.log new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_yank/help/stderr.log diff --git a/src/tools/cargo/tests/testsuite/cargo_yank/help/stdout.log b/src/tools/cargo/tests/testsuite/cargo_yank/help/stdout.log new file mode 100644 index 000000000..25b04e6c7 --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_yank/help/stdout.log @@ -0,0 +1,26 @@ +Remove a pushed crate from the index + +Usage: cargo[EXE] yank [OPTIONS] [crate] + +Arguments: + [crate] + +Options: + --version <VERSION> The version to yank or un-yank + --undo Undo a yank, putting a version back into the index + --index <INDEX> Registry index to yank from + --registry <REGISTRY> Registry to use + --token <TOKEN> API token to use when authenticating + -q, --quiet Do not print cargo log messages + -v, --verbose... Use verbose output (-vv very verbose/build.rs output) + --color <WHEN> Coloring: auto, always, never + --config <KEY=VALUE> Override a configuration value + -Z <FLAG> Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for details + -h, --help Print help + +Manifest Options: + --frozen Require Cargo.lock and cache are up to date + --locked Require Cargo.lock is up to date + --offline Run without accessing the network + +Run `cargo help yank` for more detailed information. diff --git a/src/tools/cargo/tests/testsuite/cargo_yank/mod.rs b/src/tools/cargo/tests/testsuite/cargo_yank/mod.rs new file mode 100644 index 000000000..c0ce11180 --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_yank/mod.rs @@ -0,0 +1 @@ +mod help; diff --git a/src/tools/cargo/tests/testsuite/credential_process.rs b/src/tools/cargo/tests/testsuite/credential_process.rs index 8c202c6a3..c010c01cd 100644 --- a/src/tools/cargo/tests/testsuite/credential_process.rs +++ b/src/tools/cargo/tests/testsuite/credential_process.rs @@ -1,8 +1,7 @@ //! Tests for credential-process. -use cargo_test_support::registry::TestRegistry; +use cargo_test_support::registry::{Package, TestRegistry}; use cargo_test_support::{basic_manifest, cargo_process, paths, project, registry, Project}; -use std::fs::{self, read_to_string}; fn toml_bin(proj: &Project, name: &str) -> String { proj.bin(name).display().to_string().replace('\\', "\\\\") @@ -24,7 +23,7 @@ fn gated() { ".cargo/config", r#" [registry] - credential-process = "false" + credential-provider = ["false"] "#, ) .file("Cargo.toml", &basic_manifest("foo", "1.0.0")) @@ -65,80 +64,6 @@ or use environment variable CARGO_REGISTRIES_ALTERNATIVE_TOKEN .run(); } -#[cargo_test] -fn warn_both_token_and_process() { - // Specifying both credential-process and a token in config should issue a warning. - let _server = registry::RegistryBuilder::new() - .http_api() - .http_index() - .alternative() - .no_configure_token() - .build(); - let p = project() - .file( - ".cargo/config", - r#" - [registries.alternative] - token = "alternative-sekrit" - credential-process = "false" - "#, - ) - .file( - "Cargo.toml", - r#" - [package] - name = "foo" - version = "0.1.0" - description = "foo" - authors = [] - license = "MIT" - homepage = "https://example.com/" - "#, - ) - .file("src/lib.rs", "") - .build(); - - p.cargo("publish --no-verify --registry alternative -Z credential-process") - .masquerade_as_nightly_cargo(&["credential-process"]) - .with_status(101) - .with_stderr( - "\ -[UPDATING] [..] -[ERROR] both `token` and `credential-process` were specified in the config for registry `alternative`. -Only one of these values may be set, remove one or the other to proceed. -", - ) - .run(); - - // Try with global credential-process, and registry-specific `token`. - // This should silently use the config token, and not run the "false" exe. - p.change_file( - ".cargo/config", - r#" - [registry] - credential-process = "false" - - [registries.alternative] - token = "alternative-sekrit" - "#, - ); - p.cargo("publish --no-verify --registry alternative -Z credential-process") - .masquerade_as_nightly_cargo(&["credential-process"]) - .with_stderr( - "\ -[UPDATING] [..] -[PACKAGING] foo v0.1.0 [..] -[PACKAGED] [..] -[UPLOADING] foo v0.1.0 [..] -[UPLOADED] foo v0.1.0 [..] -note: Waiting [..] -You may press ctrl-c [..] -[PUBLISHED] foo v0.1.0 [..] -", - ) - .run(); -} - /// Setup for a test that will issue a command that needs to fetch a token. /// /// This does the following: @@ -158,29 +83,14 @@ fn get_token_test() -> (Project, TestRegistry) { )) .alternative() .http_api() + .http_index() + .auth_required() .build(); - // The credential process to use. - let cred_proj = project() - .at("cred_proj") - .file("Cargo.toml", &basic_manifest("test-cred", "1.0.0")) - .file( - "src/main.rs", - r#" - use std::fs::File; - use std::io::Write; - fn main() { - let mut f = File::options() - .write(true) - .create(true) - .append(true) - .open("runs.log") - .unwrap(); - write!(f, "+"); - println!("sekrit"); - } "#, - ) - .build(); - cred_proj.cargo("build").run(); + + let provider = build_provider( + "test-cred", + r#"{"Ok":{"kind":"get","token":"sekrit","cache":"session","operation_independent":false}}"#, + ); let p = project() .file( @@ -189,10 +99,9 @@ fn get_token_test() -> (Project, TestRegistry) { r#" [registries.alternative] index = "{}" - credential-process = ["{}"] + credential-provider = ["{provider}"] "#, server.index_url(), - toml_bin(&cred_proj, "test-cred") ), ) .file( @@ -202,7 +111,6 @@ fn get_token_test() -> (Project, TestRegistry) { name = "foo" version = "0.1.0" description = "foo" - authors = [] license = "MIT" homepage = "https://example.com/" "#, @@ -217,24 +125,22 @@ fn publish() { // Checks that credential-process is used for `cargo publish`. let (p, _t) = get_token_test(); - p.cargo("publish --no-verify --registry alternative -Z credential-process") + p.cargo("publish --no-verify --registry alternative -Z credential-process -Z registry-auth") .masquerade_as_nightly_cargo(&["credential-process"]) .with_stderr( - "\ -[UPDATING] [..] + r#"[UPDATING] [..] +{"v":1,"registry":{"index-url":"[..]","name":"alternative","headers":[..]},"kind":"get","operation":"read","args":[]} [PACKAGING] foo v0.1.0 [..] [PACKAGED] [..] +{"v":1,"registry":{"index-url":"[..]","name":"alternative"},"kind":"get","operation":"publish","name":"foo","vers":"0.1.0","cksum":"[..]","args":[]} [UPLOADING] foo v0.1.0 [..] [UPLOADED] foo v0.1.0 [..] note: Waiting [..] You may press ctrl-c [..] [PUBLISHED] foo v0.1.0 [..] -", +"#, ) .run(); - - let calls = read_to_string(p.root().join("runs.log")).unwrap().len(); - assert_eq!(calls, 1); } #[cargo_test] @@ -242,15 +148,8 @@ fn basic_unsupported() { // Non-action commands don't support login/logout. let registry = registry::RegistryBuilder::new() .no_configure_token() + .credential_provider(&["cargo:token-from-stdout", "false"]) .build(); - cargo_util::paths::append( - &paths::home().join(".cargo/config"), - br#" - [registry] - credential-process = "false" - "#, - ) - .unwrap(); cargo_process("login -Z credential-process abcdefg") .replace_crates_io(registry.index_url()) @@ -259,9 +158,10 @@ fn basic_unsupported() { .with_stderr( "\ [UPDATING] crates.io index -[ERROR] credential process `false` cannot be used to log in, \ -the credential-process configuration value must pass the \ -`{action}` argument in the config to support this command +[ERROR] credential provider `cargo:token-from-stdout false` failed action `login` + +Caused by: + requested operation not supported ", ) .run(); @@ -272,9 +172,10 @@ the credential-process configuration value must pass the \ .with_status(101) .with_stderr( "\ -[ERROR] credential process `false` cannot be used to log out, \ -the credential-process configuration value must pass the \ -`{action}` argument in the config to support this command +[ERROR] credential provider `cargo:token-from-stdout false` failed action `logout` + +Caused by: + requested operation not supported ", ) .run(); @@ -282,222 +183,475 @@ the credential-process configuration value must pass the \ #[cargo_test] fn login() { + let registry = registry::RegistryBuilder::new() + .no_configure_token() + .credential_provider(&[ + &build_provider("test-cred", r#"{"Ok": {"kind": "login"}}"#), + "cfg1", + "--cfg2", + ]) + .build(); + + cargo_process("login -Z credential-process abcdefg -- cmd3 --cmd4") + .masquerade_as_nightly_cargo(&["credential-process"]) + .replace_crates_io(registry.index_url()) + .with_stderr( + r#"[UPDATING] [..] +{"v":1,"registry":{"index-url":"https://github.com/rust-lang/crates.io-index","name":"crates-io"},"kind":"login","token":"abcdefg","login-url":"[..]","args":["cfg1","--cfg2","cmd3","--cmd4"]} +"#, + ) + .run(); +} + +#[cargo_test] +fn logout() { let server = registry::RegistryBuilder::new() .no_configure_token() + .credential_provider(&[&build_provider( + "test-cred", + r#"{"Ok": {"kind": "logout"}}"#, + )]) .build(); - // The credential process to use. + + cargo_process("logout -Z credential-process") + .masquerade_as_nightly_cargo(&["credential-process"]) + .replace_crates_io(server.index_url()) + .with_stderr( + r#"{"v":1,"registry":{"index-url":"https://github.com/rust-lang/crates.io-index","name":"crates-io"},"kind":"logout","args":[]} +"#, + ) + .run(); +} + +#[cargo_test] +fn yank() { + let (p, _t) = get_token_test(); + + p.cargo("yank --version 0.1.0 --registry alternative -Zcredential-process -Zregistry-auth") + .masquerade_as_nightly_cargo(&["credential-process"]) + .with_stderr( + r#"[UPDATING] [..] +{"v":1,"registry":{"index-url":"[..]","name":"alternative","headers":[..]},"kind":"get","operation":"read","args":[]} +{"v":1,"registry":{"index-url":"[..]","name":"alternative"},"kind":"get","operation":"yank","name":"foo","vers":"0.1.0","args":[]} +[YANK] foo@0.1.0 +"#, + ) + .run(); +} + +#[cargo_test] +fn owner() { + let (p, _t) = get_token_test(); + + p.cargo("owner --add username --registry alternative -Zcredential-process -Zregistry-auth") + .masquerade_as_nightly_cargo(&["credential-process"]) + .with_stderr( + r#"[UPDATING] [..] +{"v":1,"registry":{"index-url":"[..]","name":"alternative","headers":[..]},"kind":"get","operation":"read","args":[]} +{"v":1,"registry":{"index-url":"[..]","name":"alternative"},"kind":"get","operation":"owners","name":"foo","args":[]} +[OWNER] completed! +"#, + ) + .run(); +} + +#[cargo_test] +fn invalid_token_output() { + // Error when credential process does not output the expected format for a token. let cred_proj = project() .at("cred_proj") .file("Cargo.toml", &basic_manifest("test-cred", "1.0.0")) + .file("src/main.rs", r#"fn main() { print!("a\nb\n"); } "#) + .build(); + cred_proj.cargo("build").run(); + let _server = registry::RegistryBuilder::new() + .alternative() + .credential_provider(&[ + "cargo:token-from-stdout", + &toml_bin(&cred_proj, "test-cred"), + ]) + .no_configure_token() + .build(); + + let p = project() + .file("Cargo.toml", &basic_manifest("foo", "1.0.0")) + .file("src/lib.rs", "") + .build(); + + p.cargo("publish --no-verify --registry alternative -Z credential-process") + .masquerade_as_nightly_cargo(&["credential-process"]) + .with_status(101) + .with_stderr( + "\ +[UPDATING] [..] +[ERROR] credential provider `[..]test-cred[EXE]` failed action `get` + +Caused by: + process `[..]` returned more than one line of output; expected a single token +", + ) + .run(); +} + +/// Builds a credential provider that echos the request from cargo to stderr, +/// and prints the `response` to stdout. +fn build_provider(name: &str, response: &str) -> String { + // The credential process to use. + let cred_proj = project() + .at(name) + .file("Cargo.toml", &basic_manifest(name, "1.0.0")) .file( "src/main.rs", - r#" - use std::io::Read; - - fn main() {{ - assert_eq!(std::env::var("CARGO_REGISTRY_NAME_OPT").unwrap(), "crates-io"); - assert_eq!(std::env::var("CARGO_REGISTRY_INDEX_URL").unwrap(), "https://github.com/rust-lang/crates.io-index"); - assert_eq!(std::env::args().skip(1).next().unwrap(), "store"); + &r####" + fn main() { + println!(r#"{{"v":[1]}}"#); + assert_eq!(std::env::args().skip(1).next().unwrap(), "--cargo-plugin"); let mut buffer = String::new(); - std::io::stdin().read_to_string(&mut buffer).unwrap(); - assert_eq!(buffer, "abcdefg\n"); - std::fs::write("token-store", buffer).unwrap(); - }} - "#, + std::io::stdin().read_line(&mut buffer).unwrap(); + eprint!("{}", buffer); + use std::io::Write; + std::io::stdout().write_all(r###"[RESPONSE]"###.as_bytes()).unwrap(); + println!(); + } "#### + .replace("[RESPONSE]", response), ) .build(); cred_proj.cargo("build").run(); + toml_bin(&cred_proj, name) +} +#[cargo_test] +fn all_not_found() { + let server = registry::RegistryBuilder::new() + .no_configure_token() + .auth_required() + .http_index() + .build(); + let not_found = build_provider("not_found", r#"{"Err": {"kind": "not-found"}}"#); cargo_util::paths::append( &paths::home().join(".cargo/config"), format!( r#" [registry] - credential-process = ["{}", "{{action}}"] + global-credential-providers = ["not_found"] + [credential-alias] + not_found = ["{not_found}"] "#, - toml_bin(&cred_proj, "test-cred") ) .as_bytes(), ) .unwrap(); - cargo_process("login -Z credential-process abcdefg") - .masquerade_as_nightly_cargo(&["credential-process"]) + cargo_process("install -v foo -Zcredential-process -Zregistry-auth") + .masquerade_as_nightly_cargo(&["credential-process", "registry-auth"]) .replace_crates_io(server.index_url()) + .with_status(101) .with_stderr( - "\ -[UPDATING] [..] -[LOGIN] token for `crates.io` saved -", + r#"[UPDATING] [..] +[CREDENTIAL] [..]not_found[..] get crates-io +{"v":1,"registry":{"index-url":"[..]","name":"crates-io","headers":[[..]"WWW-Authenticate: Cargo login_url=\"https://test-registry-login/me\""[..]]},"kind":"get","operation":"read","args":[]} +[ERROR] failed to query replaced source registry `crates-io` + +Caused by: + no token found, please run `cargo login` + or use environment variable CARGO_REGISTRY_TOKEN +"#, ) .run(); - assert_eq!( - fs::read_to_string(paths::root().join("token-store")).unwrap(), - "abcdefg\n" - ); } #[cargo_test] -fn logout() { +fn all_not_supported() { let server = registry::RegistryBuilder::new() .no_configure_token() + .auth_required() + .http_index() .build(); - // The credential process to use. - let cred_proj = project() - .at("cred_proj") - .file("Cargo.toml", &basic_manifest("test-cred", "1.0.0")) - .file( - "src/main.rs", - r#" - use std::io::Read; - - fn main() {{ - assert_eq!(std::env::var("CARGO_REGISTRY_NAME_OPT").unwrap(), "crates-io"); - assert_eq!(std::env::var("CARGO_REGISTRY_INDEX_URL").unwrap(), "https://github.com/rust-lang/crates.io-index"); - assert_eq!(std::env::args().skip(1).next().unwrap(), "erase"); - std::fs::write("token-store", "").unwrap(); - eprintln!("token for `crates-io` has been erased!") - }} - "#, - ) - .build(); - cred_proj.cargo("build").run(); - + let not_supported = + build_provider("not_supported", r#"{"Err": {"kind": "url-not-supported"}}"#); cargo_util::paths::append( &paths::home().join(".cargo/config"), format!( r#" [registry] - credential-process = ["{}", "{{action}}"] + global-credential-providers = ["not_supported"] + [credential-alias] + not_supported = ["{not_supported}"] "#, - toml_bin(&cred_proj, "test-cred") ) .as_bytes(), ) .unwrap(); - cargo_process("logout -Z credential-process") - .masquerade_as_nightly_cargo(&["credential-process"]) + cargo_process("install -v foo -Zcredential-process -Zregistry-auth") + .masquerade_as_nightly_cargo(&["credential-process", "registry-auth"]) .replace_crates_io(server.index_url()) + .with_status(101) .with_stderr( - "\ -token for `crates-io` has been erased! -[LOGOUT] token for `crates-io` has been removed from local storage -[NOTE] This does not revoke the token on the registry server. - If you need to revoke the token, visit <https://crates.io/me> \ - and follow the instructions there. -", + r#"[UPDATING] [..] +[CREDENTIAL] [..]not_supported[..] get crates-io +{"v":1,"registry":{"index-url":"[..]","name":"crates-io","headers":[[..]"WWW-Authenticate: Cargo login_url=\"https://test-registry-login/me\""[..]]},"kind":"get","operation":"read","args":[]} +[ERROR] failed to query replaced source registry `crates-io` + +Caused by: + no credential providers could handle the request +"#, ) .run(); - assert_eq!( - fs::read_to_string(paths::root().join("token-store")).unwrap(), - "" - ); } #[cargo_test] -fn yank() { - let (p, _t) = get_token_test(); +fn multiple_providers() { + let server = registry::RegistryBuilder::new() + .no_configure_token() + .build(); - p.cargo("yank --version 0.1.0 --registry alternative -Z credential-process") + // Set up two credential providers: the first will fail with "UrlNotSupported" + // and Cargo should skip it. The second should succeed. + let url_not_supported = build_provider( + "url_not_supported", + r#"{"Err": {"kind": "url-not-supported"}}"#, + ); + + let success_provider = build_provider("success_provider", r#"{"Ok": {"kind": "login"}}"#); + + cargo_util::paths::append( + &paths::home().join(".cargo/config"), + format!( + r#" + [registry] + global-credential-providers = ["success_provider", "url_not_supported"] + + [credential-alias] + success_provider = ["{success_provider}"] + url_not_supported = ["{url_not_supported}"] + "#, + ) + .as_bytes(), + ) + .unwrap(); + + cargo_process("login -Z credential-process -v abcdefg") .masquerade_as_nightly_cargo(&["credential-process"]) + .replace_crates_io(server.index_url()) .with_stderr( - "\ -[UPDATING] [..] -[YANK] foo@0.1.0 -", + r#"[UPDATING] [..] +[CREDENTIAL] [..]url_not_supported[..] login crates-io +{"v":1,"registry":{"index-url":"https://github.com/rust-lang/crates.io-index","name":"crates-io"},"kind":"login","token":"abcdefg","login-url":"[..]","args":[]} +[CREDENTIAL] [..]success_provider[..] login crates-io +{"v":1,"registry":{"index-url":"https://github.com/rust-lang/crates.io-index","name":"crates-io"},"kind":"login","token":"abcdefg","login-url":"[..]","args":[]} +"#, ) .run(); } #[cargo_test] -fn owner() { - let (p, _t) = get_token_test(); +fn both_token_and_provider() { + let server = registry::RegistryBuilder::new().build(); + cargo_util::paths::append( + &paths::home().join(".cargo/config"), + format!( + r#" + [registry] + credential-provider = ["cargo:token"] + "#, + ) + .as_bytes(), + ) + .unwrap(); - p.cargo("owner --add username --registry alternative -Z credential-process") + cargo_process("login -Z credential-process -v abcdefg") .masquerade_as_nightly_cargo(&["credential-process"]) + .replace_crates_io(server.index_url()) .with_stderr( - "\ -[UPDATING] [..] -[OWNER] completed! -", + r#"[UPDATING] [..] +[WARNING] registry `crates-io` has a token configured in [..]credentials.toml that will be ignored because a credential-provider is configured for this registry` +[CREDENTIAL] cargo:token login crates-io +[LOGIN] token for `crates-io` saved +"#, ) .run(); + let credentials = + std::fs::read_to_string(paths::home().join(".cargo/credentials.toml")).unwrap(); + assert_eq!(credentials, "[registry]\ntoken = \"abcdefg\"\n"); } #[cargo_test] -fn libexec_path() { - // cargo: prefixed names use the sysroot - let server = registry::RegistryBuilder::new() - .no_configure_token() - .build(); +fn both_asymmetric_and_token() { + let server = registry::RegistryBuilder::new().build(); cargo_util::paths::append( &paths::home().join(".cargo/config"), - br#" - [registry] - credential-process = "cargo:doesnotexist" - "#, + format!( + r#" + [registry] + token = "foo" + secret-key = "bar" + "#, + ) + .as_bytes(), ) .unwrap(); - cargo_process("login -Z credential-process abcdefg") + cargo_process("login -Z credential-process -v abcdefg") .masquerade_as_nightly_cargo(&["credential-process"]) .replace_crates_io(server.index_url()) - .with_status(101) .with_stderr( - // FIXME: Update "Caused by" error message once rust/pull/87704 is merged. - // On Windows, changing to a custom executable resolver has changed the - // error messages. - &format!("\ -[UPDATING] [..] -[ERROR] failed to execute `[..]libexec/cargo-credential-doesnotexist[EXE]` to store authentication token for registry `crates-io` - -Caused by: - [..] -"), + r#"[UPDATING] [..] +[WARNING] registry `crates-io` has a `secret_key` configured in [..]config that will be ignored because a `token` is also configured, and the `cargo:token` provider is configured with higher precedence +[CREDENTIAL] cargo:token login crates-io +[LOGIN] token for `crates-io` saved +"#, ) .run(); } #[cargo_test] -fn invalid_token_output() { - // Error when credential process does not output the expected format for a token. - let _server = registry::RegistryBuilder::new() - .alternative() +fn token_caching() { + let server = registry::RegistryBuilder::new() .no_configure_token() + .no_configure_registry() + .token(cargo_test_support::registry::Token::Plaintext( + "sekrit".to_string(), + )) + .alternative() + .http_api() + .http_index() .build(); + + // Token should not be re-used if it is expired + let expired_provider = build_provider( + "test-cred", + r#"{"Ok":{"kind":"get","token":"sekrit","cache":{"expires":0},"operation_independent":true}}"#, + ); + + // Token should not be re-used for a different operation if it is not operation_independent + let non_independent_provider = build_provider( + "test-cred", + r#"{"Ok":{"kind":"get","token":"sekrit","cache":"session","operation_independent":false}}"#, + ); + + let p = project() + .file( + ".cargo/config", + &format!( + r#" + [registries.alternative] + index = "{}" + credential-provider = ["{expired_provider}"] + "#, + server.index_url(), + ), + ) + .file( + "Cargo.toml", + r#" + [package] + name = "foo" + version = "0.1.0" + description = "foo" + license = "MIT" + homepage = "https://example.com/" + "#, + ) + .file("src/lib.rs", "") + .build(); + + let output = r#"[UPDATING] `alternative` index +{"v":1,"registry":{"index-url":"[..]","name":"alternative"},"kind":"get","operation":"read","args":[]} +[PACKAGING] foo v0.1.0 [..] +[PACKAGED] [..] +{"v":1,"registry":{"index-url":"[..]","name":"alternative"},"kind":"get","operation":"publish","name":"foo","vers":"0.1.0","cksum":"[..]","args":[]} +[UPLOADING] foo v0.1.0 [..] +[UPLOADED] foo v0.1.0 [..] +note: Waiting [..] +You may press ctrl-c [..] +[PUBLISHED] foo v0.1.0 [..] +"#; + + // The output should contain two JSON messages from the provider in boths cases: + // The first because the credential is expired, the second because the provider + // indicated that the token was non-operation-independent. + p.cargo("publish -Z credential-process --registry alternative --no-verify") + .masquerade_as_nightly_cargo(&["credential-process"]) + .with_stderr(output) + .run(); + + p.change_file( + ".cargo/config", + &format!( + r#" + [registries.alternative] + index = "{}" + credential-provider = ["{non_independent_provider}"] + "#, + server.index_url(), + ), + ); + + p.cargo("publish -Z credential-process --registry alternative --no-verify") + .masquerade_as_nightly_cargo(&["credential-process"]) + .with_stderr(output) + .run(); +} + +#[cargo_test] +fn basic_provider() { let cred_proj = project() .at("cred_proj") .file("Cargo.toml", &basic_manifest("test-cred", "1.0.0")) - .file("src/main.rs", r#"fn main() { print!("a\nb\n"); } "#) + .file("src/main.rs", r#"fn main() { + eprintln!("CARGO={:?}", std::env::var("CARGO").ok()); + eprintln!("CARGO_REGISTRY_NAME_OPT={:?}", std::env::var("CARGO_REGISTRY_NAME_OPT").ok()); + eprintln!("CARGO_REGISTRY_INDEX_URL={:?}", std::env::var("CARGO_REGISTRY_INDEX_URL").ok()); + print!("sekrit"); + }"#) .build(); cred_proj.cargo("build").run(); - cargo_util::paths::append( - &paths::home().join(".cargo/config"), - format!( + let _server = registry::RegistryBuilder::new() + .no_configure_token() + .credential_provider(&[ + "cargo:token-from-stdout", + &toml_bin(&cred_proj, "test-cred"), + ]) + .token(cargo_test_support::registry::Token::Plaintext( + "sekrit".to_string(), + )) + .alternative() + .http_api() + .auth_required() + .build(); + + let p = project() + .file( + "Cargo.toml", r#" - [registry] - credential-process = ["{}"] + [package] + name = "foo" + version = "0.0.1" + authors = [] + [dependencies.bar] + version = "0.0.1" + registry = "alternative" "#, - toml_bin(&cred_proj, "test-cred") ) - .as_bytes(), - ) - .unwrap(); - - let p = project() - .file("Cargo.toml", &basic_manifest("foo", "1.0.0")) - .file("src/lib.rs", "") + .file("src/main.rs", "fn main() {}") .build(); + Package::new("bar", "0.0.1").alternative(true).publish(); - p.cargo("publish --no-verify --registry alternative -Z credential-process") - .masquerade_as_nightly_cargo(&["credential-process"]) - .with_status(101) + p.cargo("check -Z credential-process -Z registry-auth") + .masquerade_as_nightly_cargo(&["credential-process", "registry-auth"]) .with_stderr( "\ -[UPDATING] [..] -[ERROR] credential process `[..]test-cred[EXE]` returned more than one line of output; expected a single token +[UPDATING] `alternative` index +CARGO=Some([..]) +CARGO_REGISTRY_NAME_OPT=Some(\"alternative\") +CARGO_REGISTRY_INDEX_URL=Some([..]) +[DOWNLOADING] crates ... +[DOWNLOADED] bar v0.0.1 (registry `alternative`) +[CHECKING] bar v0.0.1 (registry `alternative`) +[CHECKING] foo v0.0.1 ([..]) +[FINISHED] [..] ", ) .run(); diff --git a/src/tools/cargo/tests/testsuite/freshness.rs b/src/tools/cargo/tests/testsuite/freshness.rs index 86b186af8..f28f1ff46 100644 --- a/src/tools/cargo/tests/testsuite/freshness.rs +++ b/src/tools/cargo/tests/testsuite/freshness.rs @@ -14,7 +14,8 @@ use super::death; use cargo_test_support::paths::{self, CargoPathExt}; use cargo_test_support::registry::Package; use cargo_test_support::{ - basic_manifest, is_coarse_mtime, project, rustc_host, rustc_host_env, sleep_ms, + basic_lib_manifest, basic_manifest, is_coarse_mtime, project, rustc_host, rustc_host_env, + sleep_ms, }; #[cargo_test] @@ -2814,3 +2815,62 @@ directory sources are not [..] ) .run(); } + +#[cargo_test] +fn skip_mtime_check_in_selected_cargo_home_subdirs() { + let p = project() + .at("cargo_home/registry/foo") + .file("Cargo.toml", &basic_lib_manifest("foo")) + .file("src/lib.rs", "") + .build(); + let project_root = p.root(); + let cargo_home = project_root.parent().unwrap().parent().unwrap(); + p.cargo("check -v") + .env("CARGO_HOME", &cargo_home) + .with_stderr( + "\ +[CHECKING] foo v0.5.0 ([CWD]) +[RUNNING] `rustc --crate-name foo src/lib.rs [..] +[FINISHED] dev [..]", + ) + .run(); + p.change_file("src/lib.rs", "illegal syntax"); + p.cargo("check -v") + .env("CARGO_HOME", &cargo_home) + .with_stderr( + "\ +[FRESH] foo v0.5.0 ([CWD]) +[FINISHED] dev [..]", + ) + .run(); +} + +#[cargo_test] +fn use_mtime_cache_in_cargo_home() { + let p = project() + .at("cargo_home/foo") + .file("Cargo.toml", &basic_lib_manifest("foo")) + .file("src/lib.rs", "") + .build(); + let project_root = p.root(); + let cargo_home = project_root.parent().unwrap(); + p.cargo("check -v") + .env("CARGO_HOME", &cargo_home) + .with_stderr( + "\ +[CHECKING] foo v0.5.0 ([CWD]) +[RUNNING] `rustc --crate-name foo src/lib.rs [..] +[FINISHED] dev [..]", + ) + .run(); + p.change_file("src/lib.rs", "illegal syntax"); + p.cargo("check -v") + .env("CARGO_HOME", &cargo_home) + .with_stderr( + "\ +[DIRTY] foo v0.5.0 ([CWD]): [..] +[CHECKING] foo v0.5.0 ([CWD]) +[RUNNING] `rustc --crate-name foo src/lib.rs [..]", + ) + .run_expect_error(); +} diff --git a/src/tools/cargo/tests/testsuite/lints.rs b/src/tools/cargo/tests/testsuite/lints.rs index fb31da30a..854de69e9 100644 --- a/src/tools/cargo/tests/testsuite/lints.rs +++ b/src/tools/cargo/tests/testsuite/lints.rs @@ -637,3 +637,58 @@ error: unresolved link to `bar` ) .run(); } + +#[cargo_test] +fn doctest_respects_lints() { + let foo = project() + .file( + "Cargo.toml", + r#" + [package] + name = "foo" + version = "0.0.1" + authors = [] + + [lints.rust] + confusable-idents = 'allow' + "#, + ) + .file( + "src/lib.rs", + r#" +/// Test +/// +/// [`Foo`] +/// +/// ``` +/// let s = "rust"; +/// let s_s = "rust2"; +/// ``` +pub fn f() {} +pub const Ě: i32 = 1; +pub const Ĕ: i32 = 2; +"#, + ) + .build(); + + foo.cargo("check -Zlints") + .masquerade_as_nightly_cargo(&["lints"]) + .with_stderr( + "\ +[CHECKING] foo v0.0.1 ([CWD]) +[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]s +", + ) + .run(); + + foo.cargo("test --doc -Zlints") + .masquerade_as_nightly_cargo(&["lints"]) + .with_stderr( + "\ +[COMPILING] foo v0.0.1 ([CWD]) +[FINISHED] test [unoptimized + debuginfo] target(s) in [..]s +[DOCTEST] foo +", + ) + .run(); +} diff --git a/src/tools/cargo/tests/testsuite/lockfile_compat.rs b/src/tools/cargo/tests/testsuite/lockfile_compat.rs index 63148cc07..97dcff123 100644 --- a/src/tools/cargo/tests/testsuite/lockfile_compat.rs +++ b/src/tools/cargo/tests/testsuite/lockfile_compat.rs @@ -966,3 +966,198 @@ version = "0.0.1" let lock = p.read_lockfile(); assert_match_exact(lockfile, &lock); } + +fn create_branch(repo: &git2::Repository, branch: &str, head_id: git2::Oid) { + repo.branch(branch, &repo.find_commit(head_id).unwrap(), true) + .unwrap(); +} + +fn create_tag(repo: &git2::Repository, tag: &str, head_id: git2::Oid) { + repo.tag( + tag, + &repo.find_object(head_id, None).unwrap(), + &repo.signature().unwrap(), + "make a new tag", + false, + ) + .unwrap(); +} + +fn v3_and_git_url_encoded(ref_kind: &str, f: impl FnOnce(&git2::Repository, &str, git2::Oid)) { + let (git_project, repo) = git::new_repo("dep1", |project| { + project + .file("Cargo.toml", &basic_lib_manifest("dep1")) + .file("src/lib.rs", "") + }); + let url = git_project.url(); + let head_id = repo.head().unwrap().target().unwrap(); + // Ref name with special characters + let git_ref = "a-_+#$)"; + f(&repo, git_ref, head_id); + + let lockfile = format!( + r#"# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "dep1" +version = "0.5.0" +source = "git+{url}?{ref_kind}={git_ref}#{head_id}" + +[[package]] +name = "foo" +version = "0.0.1" +dependencies = [ + "dep1", +] +"#, + ); + + let p = project() + .file( + "Cargo.toml", + &format!( + r#" + [package] + name = "foo" + version = "0.0.1" + + [dependencies] + dep1 = {{ git = '{url}', {ref_kind} = '{git_ref}' }} + "#, + ), + ) + .file("src/lib.rs", "") + .file("Cargo.lock", "version = 3") + .build(); + + p.cargo("check") + .with_stderr(format!( + "\ +[UPDATING] git repository `{url}` +[CHECKING] dep1 v0.5.0 ({url}?{ref_kind}={git_ref}#[..]) +[CHECKING] foo v0.0.1 ([CWD]) +[FINISHED] dev [..] +" + )) + .run(); + + let lock = p.read_lockfile(); + assert_match_exact(&lockfile, &lock); + + // v3 doesn't URL-encode URL parameters, but `url` crate does decode as it + // was URL-encoded. Therefore Cargo thinks they are from different source + // and clones the repository again. + p.cargo("check") + .with_stderr(format!( + "\ +[UPDATING] git repository `{url}` +[FINISHED] dev [..] +" + )) + .run(); +} + +#[cargo_test] +fn v3_and_git_url_encoded_branch() { + v3_and_git_url_encoded("branch", create_branch); +} + +#[cargo_test] +fn v3_and_git_url_encoded_tag() { + v3_and_git_url_encoded("tag", create_tag); +} + +#[cargo_test] +fn v3_and_git_url_encoded_rev() { + v3_and_git_url_encoded("rev", create_tag); +} + +fn v4_and_git_url_encoded(ref_kind: &str, f: impl FnOnce(&git2::Repository, &str, git2::Oid)) { + let (git_project, repo) = git::new_repo("dep1", |project| { + project + .file("Cargo.toml", &basic_lib_manifest("dep1")) + .file("src/lib.rs", "") + }); + let url = git_project.url(); + let head_id = repo.head().unwrap().target().unwrap(); + // Ref name with special characters + let git_ref = "a-_+#$)"; + let encoded_ref = "a-_%2B%23%24%29"; + f(&repo, git_ref, head_id); + + let lockfile = format!( + r#"# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "dep1" +version = "0.5.0" +source = "git+{url}?{ref_kind}={encoded_ref}#{head_id}" + +[[package]] +name = "foo" +version = "0.0.1" +dependencies = [ + "dep1", +] +"#, + ); + + let p = project() + .file( + "Cargo.toml", + &format!( + r#" + [package] + name = "foo" + version = "0.0.1" + + [dependencies] + dep1 = {{ git = '{url}', {ref_kind} = '{git_ref}' }} + "#, + ), + ) + .file("src/lib.rs", "") + .file("Cargo.lock", "version = 4") + .build(); + + p.cargo("check -Znext-lockfile-bump") + .masquerade_as_nightly_cargo(&["-Znext-lockfile-bump"]) + .with_stderr(format!( + "\ +[UPDATING] git repository `{url}` +[CHECKING] dep1 v0.5.0 ({url}?{ref_kind}={git_ref}#[..]) +[CHECKING] foo v0.0.1 ([CWD]) +[FINISHED] dev [..] +" + )) + .run(); + + let lock = p.read_lockfile(); + assert_match_exact(&lockfile, &lock); + + // Unlike v3_and_git_url_encoded, v4 encodes URL parameters so no git + // repository re-clone happen. + p.cargo("check -Znext-lockfile-bump") + .masquerade_as_nightly_cargo(&["-Znext-lockfile-bump"]) + .with_stderr("[FINISHED] dev [..]") + .run(); +} + +#[cargo_test] +fn v4_and_git_url_encoded_branch() { + v4_and_git_url_encoded("branch", create_branch); +} + +#[cargo_test] +fn v4_and_git_url_encoded_tag() { + v4_and_git_url_encoded("tag", create_tag); +} + +#[cargo_test] +fn v4_and_git_url_encoded_rev() { + v4_and_git_url_encoded("rev", create_tag) +} diff --git a/src/tools/cargo/tests/testsuite/login.rs b/src/tools/cargo/tests/testsuite/login.rs index 85b299f28..16bd29dce 100644 --- a/src/tools/cargo/tests/testsuite/login.rs +++ b/src/tools/cargo/tests/testsuite/login.rs @@ -109,12 +109,14 @@ fn empty_login_token() { cargo_process("login") .replace_crates_io(registry.index_url()) - .with_stdout("please paste the token found on [..]/me below") .with_stdin("\t\n") .with_stderr( "\ [UPDATING] crates.io index -[ERROR] please provide a non-empty token +[ERROR] credential provider `cargo:token` failed action `login` + +Caused by: + please provide a non-empty token ", ) .with_status(101) @@ -125,7 +127,10 @@ fn empty_login_token() { .arg("") .with_stderr( "\ -[ERROR] please provide a non-empty token +[ERROR] credential provider `cargo:token` failed action `login` + +Caused by: + please provide a non-empty token ", ) .with_status(101) @@ -143,7 +148,6 @@ fn invalid_login_token() { let check = |stdin: &str, stderr: &str, status: i32| { cargo_process("login") .replace_crates_io(registry.index_url()) - .with_stdout("please paste the token found on [..]/me below") .with_stdin(stdin) .with_stderr(stderr) .with_status(status) @@ -153,12 +157,15 @@ fn invalid_login_token() { let invalid = |stdin: &str| { check( stdin, - "[ERROR] token contains invalid characters. -Only printable ISO-8859-1 characters are allowed as it is sent in a HTTPS header.", + "[ERROR] credential provider `cargo:token` failed action `login` + +Caused by: + token contains invalid characters. + Only printable ISO-8859-1 characters are allowed as it is sent in a HTTPS header.", 101, ) }; - let valid = |stdin: &str| check(stdin, "[LOGIN] token for `crates.io` saved", 0); + let valid = |stdin: &str| check(stdin, "[LOGIN] token for `crates-io` saved", 0); // Update config.json so that the rest of the tests don't need to care // whether or not `Updating` is printed. @@ -166,7 +173,7 @@ Only printable ISO-8859-1 characters are allowed as it is sent in a HTTPS header "test", "\ [UPDATING] crates.io index -[LOGIN] token for `crates.io` saved +[LOGIN] token for `crates-io` saved ", 0, ); @@ -184,54 +191,19 @@ Only printable ISO-8859-1 characters are allowed as it is sent in a HTTPS header #[cargo_test] fn bad_asymmetric_token_args() { - // These cases are kept brief as the implementation is covered by clap, so this is only smoke testing that we have clap configured correctly. - cargo_process("login --key-subject=foo tok") - .with_stderr_contains( - "error: the argument '--key-subject <SUBJECT>' cannot be used with '[token]'", - ) - .with_status(1) - .run(); - - cargo_process("login --generate-keypair tok") - .with_stderr_contains( - "error: the argument '--generate-keypair' cannot be used with '[token]'", - ) - .with_status(1) - .run(); - - cargo_process("login --secret-key tok") - .with_stderr_contains("error: the argument '--secret-key' cannot be used with '[token]'") - .with_status(1) - .run(); + let registry = RegistryBuilder::new() + .credential_provider(&["cargo:paseto"]) + .no_configure_token() + .build(); - cargo_process("login --generate-keypair --secret-key") + // These cases are kept brief as the implementation is covered by clap, so this is only smoke testing that we have clap configured correctly. + cargo_process("login -Zcredential-process -- --key-subject") + .masquerade_as_nightly_cargo(&["credential-process"]) + .replace_crates_io(registry.index_url()) .with_stderr_contains( - "error: the argument '--generate-keypair' cannot be used with '--secret-key'", + " error: a value is required for '--key-subject <SUBJECT>' but none was supplied", ) - .with_status(1) - .run(); -} - -#[cargo_test] -fn asymmetric_requires_nightly() { - let registry = registry::init(); - cargo_process("login --key-subject=foo") - .replace_crates_io(registry.index_url()) - .with_status(101) - .with_stderr_contains("[ERROR] the `key-subject` flag is unstable, pass `-Z registry-auth` to enable it\n\ - See https://github.com/rust-lang/cargo/issues/10519 for more information about the `key-subject` flag.") - .run(); - cargo_process("login --generate-keypair") - .replace_crates_io(registry.index_url()) .with_status(101) - .with_stderr_contains("[ERROR] the `generate-keypair` flag is unstable, pass `-Z registry-auth` to enable it\n\ - See https://github.com/rust-lang/cargo/issues/10519 for more information about the `generate-keypair` flag.") - .run(); - cargo_process("login --secret-key") - .replace_crates_io(registry.index_url()) - .with_status(101) - .with_stderr_contains("[ERROR] the `secret-key` flag is unstable, pass `-Z registry-auth` to enable it\n\ - See https://github.com/rust-lang/cargo/issues/10519 for more information about the `secret-key` flag.") .run(); } @@ -250,6 +222,28 @@ fn login_with_no_cargo_dir() { } #[cargo_test] +fn login_with_asymmetric_token_and_subject_on_stdin() { + let registry = RegistryBuilder::new() + .credential_provider(&["cargo:paseto"]) + .no_configure_token() + .build(); + let credentials = credentials_toml(); + cargo_process("login -v -Z credential-process -- --key-subject=foo") + .masquerade_as_nightly_cargo(&["credential-process"]) + .replace_crates_io(registry.index_url()) + .with_stderr_contains( + "\ +k3.public.AmDwjlyf8jAV3gm5Z7Kz9xAOcsKslt_Vwp5v-emjFzBHLCtcANzTaVEghTNEMj9PkQ", + ) + .with_stdin("k3.secret.fNYVuMvBgOlljt9TDohnaYLblghqaHoQquVZwgR6X12cBFHZLFsaU3q7X3k1Zn36") + .run(); + let credentials = fs::read_to_string(&credentials).unwrap(); + assert!(credentials.starts_with("[registry]\n")); + assert!(credentials.contains("secret-key-subject = \"foo\"\n")); + assert!(credentials.contains("secret-key = \"k3.secret.fNYVuMvBgOlljt9TDohnaYLblghqaHoQquVZwgR6X12cBFHZLFsaU3q7X3k1Zn36\"\n")); +} + +#[cargo_test] fn login_with_differently_sized_token() { // Verify that the configuration file gets properly truncated. let registry = registry::init(); @@ -278,7 +272,6 @@ fn login_with_token_on_stdin() { .run(); cargo_process("login") .replace_crates_io(registry.index_url()) - .with_stdout("please paste the token found on [..]/me below") .with_stdin("some token") .run(); let credentials = fs::read_to_string(&credentials).unwrap(); @@ -286,89 +279,38 @@ fn login_with_token_on_stdin() { } #[cargo_test] -fn login_with_asymmetric_token_and_subject_on_stdin() { - let registry = registry::init(); - let credentials = credentials_toml(); - fs::remove_file(&credentials).unwrap(); - cargo_process("login --key-subject=foo --secret-key -v -Z registry-auth") - .masquerade_as_nightly_cargo(&["registry-auth"]) - .replace_crates_io(registry.index_url()) - .with_stdout( - "\ - please paste the API secret key below -k3.public.AmDwjlyf8jAV3gm5Z7Kz9xAOcsKslt_Vwp5v-emjFzBHLCtcANzTaVEghTNEMj9PkQ", - ) - .with_stdin("k3.secret.fNYVuMvBgOlljt9TDohnaYLblghqaHoQquVZwgR6X12cBFHZLFsaU3q7X3k1Zn36") - .run(); - let credentials = fs::read_to_string(&credentials).unwrap(); - assert!(credentials.starts_with("[registry]\n")); - assert!(credentials.contains("secret-key-subject = \"foo\"\n")); - assert!(credentials.contains("secret-key = \"k3.secret.fNYVuMvBgOlljt9TDohnaYLblghqaHoQquVZwgR6X12cBFHZLFsaU3q7X3k1Zn36\"\n")); -} - -#[cargo_test] fn login_with_asymmetric_token_on_stdin() { - let registry = registry::init(); + let _registry = RegistryBuilder::new() + .credential_provider(&["cargo:paseto"]) + .alternative() + .no_configure_token() + .build(); let credentials = credentials_toml(); - fs::remove_file(&credentials).unwrap(); - cargo_process("login --secret-key -v -Z registry-auth") - .masquerade_as_nightly_cargo(&["registry-auth"]) - .replace_crates_io(registry.index_url()) - .with_stdout( + cargo_process("login -vZ credential-process --registry alternative") + .masquerade_as_nightly_cargo(&["credential-process"]) + .with_stderr( "\ - please paste the API secret key below -k3.public.AmDwjlyf8jAV3gm5Z7Kz9xAOcsKslt_Vwp5v-emjFzBHLCtcANzTaVEghTNEMj9PkQ", - ) - .with_stdin("k3.secret.fNYVuMvBgOlljt9TDohnaYLblghqaHoQquVZwgR6X12cBFHZLFsaU3q7X3k1Zn36") - .run(); - let credentials = fs::read_to_string(&credentials).unwrap(); - assert_eq!(credentials, "[registry]\nsecret-key = \"k3.secret.fNYVuMvBgOlljt9TDohnaYLblghqaHoQquVZwgR6X12cBFHZLFsaU3q7X3k1Zn36\"\n"); -} - -#[cargo_test] -fn login_with_asymmetric_key_subject_without_key() { - let registry = registry::init(); - let credentials = credentials_toml(); - fs::remove_file(&credentials).unwrap(); - cargo_process("login --key-subject=foo -Z registry-auth") - .masquerade_as_nightly_cargo(&["registry-auth"]) - .replace_crates_io(registry.index_url()) - .with_stderr_contains("error: need a secret_key to set a key_subject") - .with_status(101) - .run(); - - // ok so add a secret_key to the credentials - cargo_process("login --secret-key -v -Z registry-auth") - .masquerade_as_nightly_cargo(&["registry-auth"]) - .replace_crates_io(registry.index_url()) - .with_stdout( - "please paste the API secret key below +[UPDATING] [..] +[CREDENTIAL] cargo:paseto login alternative k3.public.AmDwjlyf8jAV3gm5Z7Kz9xAOcsKslt_Vwp5v-emjFzBHLCtcANzTaVEghTNEMj9PkQ", ) .with_stdin("k3.secret.fNYVuMvBgOlljt9TDohnaYLblghqaHoQquVZwgR6X12cBFHZLFsaU3q7X3k1Zn36") .run(); - - // and then it should work - cargo_process("login --key-subject=foo -Z registry-auth") - .masquerade_as_nightly_cargo(&["registry-auth"]) - .replace_crates_io(registry.index_url()) - .run(); - let credentials = fs::read_to_string(&credentials).unwrap(); - assert!(credentials.starts_with("[registry]\n")); - assert!(credentials.contains("secret-key-subject = \"foo\"\n")); - assert!(credentials.contains("secret-key = \"k3.secret.fNYVuMvBgOlljt9TDohnaYLblghqaHoQquVZwgR6X12cBFHZLFsaU3q7X3k1Zn36\"\n")); + assert_eq!(credentials, "[registries.alternative]\nsecret-key = \"k3.secret.fNYVuMvBgOlljt9TDohnaYLblghqaHoQquVZwgR6X12cBFHZLFsaU3q7X3k1Zn36\"\n"); } #[cargo_test] fn login_with_generate_asymmetric_token() { - let registry = registry::init(); + let _registry = RegistryBuilder::new() + .credential_provider(&["cargo:paseto"]) + .alternative() + .no_configure_token() + .build(); let credentials = credentials_toml(); - fs::remove_file(&credentials).unwrap(); - cargo_process("login --generate-keypair -Z registry-auth") - .masquerade_as_nightly_cargo(&["registry-auth"]) - .replace_crates_io(registry.index_url()) - .with_stdout("k3.public.[..]") + cargo_process("login -Z credential-process --registry alternative") + .masquerade_as_nightly_cargo(&["credential-process"]) + .with_stderr("[UPDATING] `alternative` index\nk3.public.[..]") .run(); let credentials = fs::read_to_string(&credentials).unwrap(); assert!(credentials.contains("secret-key = \"k3.secret.")); diff --git a/src/tools/cargo/tests/testsuite/main.rs b/src/tools/cargo/tests/testsuite/main.rs index 2c282c0a3..8279f5818 100644 --- a/src/tools/cargo/tests/testsuite/main.rs +++ b/src/tools/cargo/tests/testsuite/main.rs @@ -18,15 +18,50 @@ mod build_script; mod build_script_env; mod build_script_extra_link_arg; mod cache_messages; +mod cargo; mod cargo_add; mod cargo_alias_config; +mod cargo_bench; +mod cargo_build; +mod cargo_check; +mod cargo_clean; mod cargo_command; mod cargo_config; +mod cargo_doc; mod cargo_env_config; mod cargo_features; +mod cargo_fetch; +mod cargo_fix; +mod cargo_generate_lockfile; +mod cargo_git_checkout; +mod cargo_help; +mod cargo_init; +mod cargo_install; +mod cargo_locate_project; +mod cargo_login; +mod cargo_logout; +mod cargo_metadata; mod cargo_new; +mod cargo_owner; +mod cargo_package; +mod cargo_pkgid; +mod cargo_publish; +mod cargo_read_manifest; mod cargo_remove; +mod cargo_report; +mod cargo_run; +mod cargo_rustc; +mod cargo_rustdoc; +mod cargo_search; mod cargo_targets; +mod cargo_test; +mod cargo_tree; +mod cargo_uninstall; +mod cargo_update; +mod cargo_vendor; +mod cargo_verify_project; +mod cargo_version; +mod cargo_yank; mod cfg; mod check; mod check_cfg; @@ -65,7 +100,6 @@ mod glob_targets; mod help; mod https; mod inheritable_workspace_fields; -mod init; mod install; mod install_upgrade; mod jobserver; diff --git a/src/tools/cargo/tests/testsuite/owner.rs b/src/tools/cargo/tests/testsuite/owner.rs index 9fc960c92..7b38bcc5e 100644 --- a/src/tools/cargo/tests/testsuite/owner.rs +++ b/src/tools/cargo/tests/testsuite/owner.rs @@ -117,8 +117,8 @@ fn simple_add_with_asymmetric() { // The http_api server will check that the authorization is correct. // If the authorization was not sent then we would get an unauthorized error. p.cargo("owner -a username") - .arg("-Zregistry-auth") - .masquerade_as_nightly_cargo(&["registry-auth"]) + .arg("-Zcredential-process") + .masquerade_as_nightly_cargo(&["credential-process"]) .replace_crates_io(registry.index_url()) .with_status(0) .run(); @@ -184,9 +184,9 @@ fn simple_remove_with_asymmetric() { // The http_api server will check that the authorization is correct. // If the authorization was not sent then we would get an unauthorized error. p.cargo("owner -r username") - .arg("-Zregistry-auth") + .arg("-Zcredential-process") .replace_crates_io(registry.index_url()) - .masquerade_as_nightly_cargo(&["registry-auth"]) + .masquerade_as_nightly_cargo(&["credential-process"]) .with_status(0) .run(); } diff --git a/src/tools/cargo/tests/testsuite/package.rs b/src/tools/cargo/tests/testsuite/package.rs index 3b4328242..010523fda 100644 --- a/src/tools/cargo/tests/testsuite/package.rs +++ b/src/tools/cargo/tests/testsuite/package.rs @@ -2983,3 +2983,115 @@ src/main.rs.bak ], ); } + +#[cargo_test] +#[cfg(windows)] // windows is the platform that is most consistently configured for case insensitive filesystems +fn normalize_case() { + let p = project() + .file("src/main.rs", r#"fn main() { println!("hello"); }"#) + .file("src/bar.txt", "") // should be ignored when packaging + .build(); + // Workaround `project()` making a `Cargo.toml` on our behalf + std::fs::remove_file(p.root().join("Cargo.toml")).unwrap(); + std::fs::write( + p.root().join("cargo.toml"), + r#" + [package] + name = "foo" + version = "0.0.1" + authors = [] + exclude = ["*.txt"] + license = "MIT" + description = "foo" + "#, + ) + .unwrap(); + + p.cargo("package") + .with_stderr( + "\ +[WARNING] manifest has no documentation[..] +See [..] +[PACKAGING] foo v0.0.1 ([CWD]) +[VERIFYING] foo v0.0.1 ([CWD]) +[COMPILING] foo v0.0.1 ([CWD][..]) +[FINISHED] dev [unoptimized + debuginfo] target(s) in [..] +[PACKAGED] 4 files, [..] ([..] compressed) +", + ) + .run(); + assert!(p.root().join("target/package/foo-0.0.1.crate").is_file()); + p.cargo("package -l") + .with_stdout( + "\ +Cargo.lock +Cargo.toml +Cargo.toml.orig +src/main.rs +", + ) + .run(); + p.cargo("package").with_stdout("").run(); + + let f = File::open(&p.root().join("target/package/foo-0.0.1.crate")).unwrap(); + validate_crate_contents( + f, + "foo-0.0.1.crate", + &["Cargo.lock", "Cargo.toml", "Cargo.toml.orig", "src/main.rs"], + &[], + ); +} + +#[cargo_test] +#[cfg(target_os = "linux")] // linux is generally configured to be case sensitive +fn mixed_case() { + let manifest = r#" + [package] + name = "foo" + version = "0.0.1" + authors = [] + exclude = ["*.txt"] + license = "MIT" + description = "foo" + "#; + let p = project() + .file("Cargo.toml", manifest) + .file("cargo.toml", manifest) + .file("src/main.rs", r#"fn main() { println!("hello"); }"#) + .file("src/bar.txt", "") // should be ignored when packaging + .build(); + + p.cargo("package") + .with_stderr( + "\ +[WARNING] manifest has no documentation[..] +See [..] +[PACKAGING] foo v0.0.1 ([CWD]) +[VERIFYING] foo v0.0.1 ([CWD]) +[COMPILING] foo v0.0.1 ([CWD][..]) +[FINISHED] dev [unoptimized + debuginfo] target(s) in [..] +[PACKAGED] 4 files, [..] ([..] compressed) +", + ) + .run(); + assert!(p.root().join("target/package/foo-0.0.1.crate").is_file()); + p.cargo("package -l") + .with_stdout( + "\ +Cargo.lock +Cargo.toml +Cargo.toml.orig +src/main.rs +", + ) + .run(); + p.cargo("package").with_stdout("").run(); + + let f = File::open(&p.root().join("target/package/foo-0.0.1.crate")).unwrap(); + validate_crate_contents( + f, + "foo-0.0.1.crate", + &["Cargo.lock", "Cargo.toml", "Cargo.toml.orig", "src/main.rs"], + &[], + ); +} diff --git a/src/tools/cargo/tests/testsuite/profile_targets.rs b/src/tools/cargo/tests/testsuite/profile_targets.rs index a88ca34fd..f2de169b9 100644 --- a/src/tools/cargo/tests/testsuite/profile_targets.rs +++ b/src/tools/cargo/tests/testsuite/profile_targets.rs @@ -328,7 +328,7 @@ fn profile_selection_test() { [RUNNING] `[..]/deps/foo-[..]` [RUNNING] `[..]/deps/test1-[..]` [DOCTEST] foo -[RUNNING] `rustdoc [..]--test [..] +[RUNNING] `[..] rustdoc [..]--test [..] ").run(); p.cargo("test -vv") .with_stderr_unordered( @@ -341,7 +341,7 @@ fn profile_selection_test() { [RUNNING] `[..]/deps/foo-[..]` [RUNNING] `[..]/deps/test1-[..]` [DOCTEST] foo -[RUNNING] `rustdoc [..]--test [..] +[RUNNING] `[..] rustdoc [..]--test [..] ", ) .run(); @@ -395,7 +395,7 @@ fn profile_selection_test_release() { [RUNNING] `[..]/deps/foo-[..]` [RUNNING] `[..]/deps/test1-[..]` [DOCTEST] foo -[RUNNING] `rustdoc [..]--test [..]` +[RUNNING] `[..] rustdoc [..]--test [..]` ").run(); p.cargo("test --release -vv") .with_stderr_unordered( @@ -408,7 +408,7 @@ fn profile_selection_test_release() { [RUNNING] `[..]/deps/foo-[..]` [RUNNING] `[..]/deps/test1-[..]` [DOCTEST] foo -[RUNNING] `rustdoc [..]--test [..] +[RUNNING] `[..] rustdoc [..]--test [..] ", ) .run(); diff --git a/src/tools/cargo/tests/testsuite/publish.rs b/src/tools/cargo/tests/testsuite/publish.rs index 45b7c7da5..50ad697d5 100644 --- a/src/tools/cargo/tests/testsuite/publish.rs +++ b/src/tools/cargo/tests/testsuite/publish.rs @@ -194,8 +194,8 @@ fn simple_publish_with_asymmetric() { .file("src/main.rs", "fn main() {}") .build(); - p.cargo("publish --no-verify -Zregistry-auth --registry dummy-registry") - .masquerade_as_nightly_cargo(&["registry-auth"]) + p.cargo("publish --no-verify -Zcredential-process --registry dummy-registry") + .masquerade_as_nightly_cargo(&["credential-process"]) .with_stderr( "\ [UPDATING] `dummy-registry` index @@ -338,7 +338,7 @@ fn git_deps() { .file("src/main.rs", "fn main() {}") .build(); - p.cargo("publish -v --no-verify") + p.cargo("publish --no-verify") .replace_crates_io(registry.index_url()) .with_status(101) .with_stderr( @@ -2023,10 +2023,10 @@ fn api_other_error() { [ERROR] failed to publish to registry at http://127.0.0.1:[..]/ Caused by: - invalid response from server + invalid response body from server Caused by: - response body was not valid utf-8 + invalid utf-8 sequence of [..] ", ) .run(); diff --git a/src/tools/cargo/tests/testsuite/registry.rs b/src/tools/cargo/tests/testsuite/registry.rs index bd5e42b45..8982b1cb6 100644 --- a/src/tools/cargo/tests/testsuite/registry.rs +++ b/src/tools/cargo/tests/testsuite/registry.rs @@ -3529,3 +3529,38 @@ fn unpack_again_when_cargo_ok_is_unrecognized() { let ok = fs::read_to_string(&cargo_ok).unwrap(); assert_eq!(&ok, r#"{"v":1}"#); } + +#[cargo_test] +fn differ_only_by_metadata() { + let p = project() + .file( + "Cargo.toml", + r#" + [package] + name = "foo" + version = "0.0.1" + authors = [] + + [dependencies] + baz = "=0.0.1" + "#, + ) + .file("src/main.rs", "fn main() {}") + .build(); + + Package::new("baz", "0.0.1+b").publish(); + Package::new("baz", "0.0.1+c").yanked(true).publish(); + + p.cargo("check") + .with_stderr( + "\ +[UPDATING] `dummy-registry` index +[DOWNLOADING] crates ... +[DOWNLOADED] [..] v0.0.1+b (registry `dummy-registry`) +[CHECKING] baz v0.0.1+b +[CHECKING] foo v0.0.1 ([CWD]) +[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]s +", + ) + .run(); +} diff --git a/src/tools/cargo/tests/testsuite/registry_auth.rs b/src/tools/cargo/tests/testsuite/registry_auth.rs index 97cdf6748..4422c638a 100644 --- a/src/tools/cargo/tests/testsuite/registry_auth.rs +++ b/src/tools/cargo/tests/testsuite/registry_auth.rs @@ -6,8 +6,9 @@ use cargo_test_support::{project, Execs, Project}; fn cargo(p: &Project, s: &str) -> Execs { let mut e = p.cargo(s); - e.masquerade_as_nightly_cargo(&["registry-auth"]) - .arg("-Zregistry-auth"); + e.masquerade_as_nightly_cargo(&["registry-auth", "credential-process"]) + .arg("-Zregistry-auth") + .arg("-Zcredential-process"); e } @@ -149,95 +150,6 @@ fn environment_token_with_asymmetric() { } #[cargo_test] -fn warn_both_asymmetric_and_token() { - let _server = RegistryBuilder::new() - .alternative() - .no_configure_token() - .build(); - let p = project() - .file( - ".cargo/config", - r#" - [registries.alternative] - token = "sekrit" - secret-key = "k3.secret.fNYVuMvBgOlljt9TDohnaYLblghqaHoQquVZwgR6X12cBFHZLFsaU3q7X3k1Zn36" - "#, - ) - .file( - "Cargo.toml", - r#" - [package] - name = "foo" - version = "0.1.0" - description = "foo" - authors = [] - license = "MIT" - homepage = "https://example.com/" - "#, - ) - .file("src/lib.rs", "") - .build(); - - p.cargo("publish --no-verify --registry alternative") - .masquerade_as_nightly_cargo(&["credential-process", "registry-auth"]) - .arg("-Zregistry-auth") - .with_status(101) - .with_stderr( - "\ -[UPDATING] [..] -[ERROR] both `token` and `secret-key` were specified in the config for registry `alternative`. -Only one of these values may be set, remove one or the other to proceed. -", - ) - .run(); -} - -#[cargo_test] -fn warn_both_asymmetric_and_credential_process() { - let _server = RegistryBuilder::new() - .alternative() - .no_configure_token() - .build(); - let p = project() - .file( - ".cargo/config", - r#" - [registries.alternative] - credential-process = "false" - secret-key = "k3.secret.fNYVuMvBgOlljt9TDohnaYLblghqaHoQquVZwgR6X12cBFHZLFsaU3q7X3k1Zn36" - "#, - ) - .file( - "Cargo.toml", - r#" - [package] - name = "foo" - version = "0.1.0" - description = "foo" - authors = [] - license = "MIT" - homepage = "https://example.com/" - "#, - ) - .file("src/lib.rs", "") - .build(); - - p.cargo("publish --no-verify --registry alternative") - .masquerade_as_nightly_cargo(&["credential-process", "registry-auth"]) - .arg("-Zcredential-process") - .arg("-Zregistry-auth") - .with_status(101) - .with_stderr( - "\ -[UPDATING] [..] -[ERROR] both `credential-process` and `secret-key` were specified in the config for registry `alternative`. -Only one of these values may be set, remove one or the other to proceed. -", - ) - .run(); -} - -#[cargo_test] fn bad_environment_token_with_asymmetric_subject() { let registry = RegistryBuilder::new() .alternative() @@ -463,7 +375,6 @@ fn login() { let p = make_project(); cargo(&p, "login --registry alternative") - .with_stdout("please paste the token found on https://test-registry-login/me below") .with_stdin("sekrit") .run(); } @@ -478,7 +389,6 @@ fn login_existing_token() { let p = make_project(); cargo(&p, "login --registry alternative") - .with_stdout("please paste the token found on file://[..]/me below") .with_stdin("sekrit") .run(); } diff --git a/src/tools/cargo/tests/testsuite/run.rs b/src/tools/cargo/tests/testsuite/run.rs index 586502288..64cf4e16c 100644 --- a/src/tools/cargo/tests/testsuite/run.rs +++ b/src/tools/cargo/tests/testsuite/run.rs @@ -1,6 +1,8 @@ //! Tests for the `cargo run` command. -use cargo_test_support::{basic_bin_manifest, basic_lib_manifest, project, Project}; +use cargo_test_support::{ + basic_bin_manifest, basic_lib_manifest, basic_manifest, project, Project, +}; use cargo_util::paths::dylib_path_envvar; #[cargo_test] @@ -1417,6 +1419,24 @@ fn default_run_workspace() { } #[cargo_test] +fn print_env_verbose() { + let p = project() + .file("Cargo.toml", &basic_manifest("a", "0.0.1")) + .file("src/main.rs", r#"fn main() {println!("run-a");}"#) + .build(); + + p.cargo("run -vv") + .with_stderr( + "\ +[COMPILING] a v0.0.1 ([CWD]) +[RUNNING] `[..]CARGO_MANIFEST_DIR=[CWD][..] rustc --crate-name a[..]` +[FINISHED] dev [unoptimized + debuginfo] target(s) in [..] +[RUNNING] `[..]CARGO_MANIFEST_DIR=[CWD][..] target/debug/a[EXE]`", + ) + .run(); +} + +#[cargo_test] #[cfg(target_os = "macos")] fn run_link_system_path_macos() { use cargo_test_support::paths::{self, CargoPathExt}; diff --git a/src/tools/cargo/tests/testsuite/script.rs b/src/tools/cargo/tests/testsuite/script.rs index fcf58de69..0c0441d62 100644 --- a/src/tools/cargo/tests/testsuite/script.rs +++ b/src/tools/cargo/tests/testsuite/script.rs @@ -35,7 +35,7 @@ args: [] ) .with_stderr( "\ -[WARNING] `package.edition` is unspecifiead, defaulting to `2021` +[WARNING] `package.edition` is unspecified, defaulting to `2021` [COMPILING] echo v0.0.0 ([ROOT]/foo) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..]s [RUNNING] `[..]/debug/echo[EXE]` @@ -59,7 +59,7 @@ args: [] ) .with_stderr( "\ -[WARNING] `package.edition` is unspecifiead, defaulting to `2021` +[WARNING] `package.edition` is unspecified, defaulting to `2021` [COMPILING] echo v0.0.0 ([ROOT]/foo) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..]s [RUNNING] `[..]/debug/echo[EXE]` @@ -136,7 +136,7 @@ args: [] ) .with_stderr( "\ -[WARNING] `package.edition` is unspecifiead, defaulting to `2021` +[WARNING] `package.edition` is unspecified, defaulting to `2021` [COMPILING] echo v0.0.0 ([ROOT]/foo) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..]s [RUNNING] `[..]/debug/echo[EXE]` @@ -260,7 +260,7 @@ fn main() { ) .with_stderr( "\ -[WARNING] `package.edition` is unspecifiead, defaulting to `2021` +[WARNING] `package.edition` is unspecified, defaulting to `2021` [COMPILING] script v0.0.0 ([ROOT]/foo) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..]s [RUNNING] `[..]/debug/script[EXE]` @@ -289,7 +289,7 @@ fn main() { ) .with_stderr( "\ -[WARNING] `package.edition` is unspecifiead, defaulting to `2021` +[WARNING] `package.edition` is unspecified, defaulting to `2021` [COMPILING] script v0.0.0 ([ROOT]/foo) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..]s [RUNNING] `[..]/debug/script[EXE]` @@ -306,7 +306,7 @@ fn main() { ) .with_stderr( "\ -[WARNING] `package.edition` is unspecifiead, defaulting to `2021` +[WARNING] `package.edition` is unspecified, defaulting to `2021` [FINISHED] dev [unoptimized + debuginfo] target(s) in [..]s [RUNNING] `[..]/debug/script[EXE]` ", @@ -323,7 +323,7 @@ fn main() { ) .with_stderr( "\ -[WARNING] `package.edition` is unspecifiead, defaulting to `2021` +[WARNING] `package.edition` is unspecified, defaulting to `2021` [COMPILING] script v0.0.0 ([ROOT]/foo) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..]s [RUNNING] `[..]/debug/script[EXE]` @@ -435,7 +435,7 @@ fn main() { ) .with_stderr( "\ -[WARNING] `package.edition` is unspecifiead, defaulting to `2021` +[WARNING] `package.edition` is unspecified, defaulting to `2021` [COMPILING] script v0.0.0 ([ROOT]/foo) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..]s [RUNNING] `[..]/debug/script[EXE]` @@ -460,7 +460,7 @@ args: ["-NotAnArg"] ) .with_stderr( "\ -[WARNING] `package.edition` is unspecifiead, defaulting to `2021` +[WARNING] `package.edition` is unspecified, defaulting to `2021` [COMPILING] script v0.0.0 ([ROOT]/foo) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..]s [RUNNING] `[..]/debug/script[EXE] -NotAnArg` @@ -485,7 +485,7 @@ args: ["-NotAnArg"] ) .with_stderr( "\ -[WARNING] `package.edition` is unspecifiead, defaulting to `2021` +[WARNING] `package.edition` is unspecified, defaulting to `2021` [COMPILING] script v0.0.0 ([ROOT]/foo) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..]s [RUNNING] `[..]/debug/script[EXE] -NotAnArg` @@ -510,7 +510,7 @@ args: ["--help"] ) .with_stderr( "\ -[WARNING] `package.edition` is unspecifiead, defaulting to `2021` +[WARNING] `package.edition` is unspecified, defaulting to `2021` [COMPILING] script v0.0.0 ([ROOT]/foo) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..]s [RUNNING] `[..]/debug/script[EXE] --help` @@ -534,7 +534,7 @@ args: [] "#, ) .with_stderr( - r#"[WARNING] `package.edition` is unspecifiead, defaulting to `2021` + r#"[WARNING] `package.edition` is unspecified, defaulting to `2021` [COMPILING] s-h-w-c- v0.0.0 ([ROOT]/foo) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..]s [RUNNING] `[..]/debug/s-h-w-c-[EXE]` @@ -544,6 +544,52 @@ args: [] } #[cargo_test] +fn test_name_has_leading_number() { + let script = ECHO_SCRIPT; + let p = cargo_test_support::project() + .file("42answer.rs", script) + .build(); + + p.cargo("-Zscript -v 42answer.rs") + .masquerade_as_nightly_cargo(&["script"]) + .with_stdout( + r#"bin: [..]/debug/answer[EXE] +args: [] +"#, + ) + .with_stderr( + r#"[WARNING] `package.edition` is unspecified, defaulting to `2021` +[COMPILING] answer v0.0.0 ([ROOT]/foo) +[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]s +[RUNNING] `[..]/debug/answer[EXE]` +"#, + ) + .run(); +} + +#[cargo_test] +fn test_name_is_number() { + let script = ECHO_SCRIPT; + let p = cargo_test_support::project().file("42.rs", script).build(); + + p.cargo("-Zscript -v 42.rs") + .masquerade_as_nightly_cargo(&["script"]) + .with_stdout( + r#"bin: [..]/debug/package[EXE] +args: [] +"#, + ) + .with_stderr( + r#"[WARNING] `package.edition` is unspecified, defaulting to `2021` +[COMPILING] package v0.0.0 ([ROOT]/foo) +[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]s +[RUNNING] `[..]/debug/package[EXE]` +"#, + ) + .run(); +} + +#[cargo_test] fn script_like_dir() { let p = cargo_test_support::project() .file("script.rs/foo", "something") @@ -600,7 +646,7 @@ fn main() { ) .with_stderr( "\ -[WARNING] `package.edition` is unspecifiead, defaulting to `2021` +[WARNING] `package.edition` is unspecified, defaulting to `2021` [UPDATING] `dummy-registry` index [DOWNLOADING] crates ... [DOWNLOADED] script v1.0.0 (registry `dummy-registry`) @@ -640,7 +686,7 @@ fn main() { ) .with_stderr( "\ -[WARNING] `package.edition` is unspecifiead, defaulting to `2021` +[WARNING] `package.edition` is unspecified, defaulting to `2021` [COMPILING] bar v0.0.1 ([ROOT]/foo/bar) [COMPILING] script v0.0.0 ([ROOT]/foo) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..]s @@ -670,7 +716,7 @@ fn main() { ) .with_stderr( "\ -[WARNING] `package.edition` is unspecifiead, defaulting to `2021` +[WARNING] `package.edition` is unspecified, defaulting to `2021` [COMPILING] script v0.0.0 ([ROOT]/foo) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..]s [RUNNING] `[..]/debug/script[EXE] --help` @@ -699,7 +745,7 @@ fn main() { ) .with_stderr( "\ -[WARNING] `package.edition` is unspecifiead, defaulting to `2021` +[WARNING] `package.edition` is unspecified, defaulting to `2021` [COMPILING] script v0.0.0 ([ROOT]/foo) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..]s [RUNNING] `[..]/debug/script[EXE] --help` @@ -724,7 +770,7 @@ args: [] ) .with_stderr( "\ -[WARNING] `package.edition` is unspecifiead, defaulting to `2021` +[WARNING] `package.edition` is unspecified, defaulting to `2021` [COMPILING] script v0.0.0 ([ROOT]/foo) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..]s [RUNNING] `[ROOT]/home/.cargo/target/[..]/debug/script[EXE]` @@ -752,7 +798,7 @@ args: [] ) .with_stderr( "\ -[WARNING] `package.edition` is unspecifiead, defaulting to `2021` +[WARNING] `package.edition` is unspecified, defaulting to `2021` [COMPILING] script v0.0.0 ([ROOT]/foo) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..]s [RUNNING] `[ROOT]/home/.cargo/target/[..]/debug/script[EXE]` @@ -815,7 +861,7 @@ fn cmd_check_with_embedded() { ) .with_stderr( "\ -[WARNING] `package.edition` is unspecifiead, defaulting to `2021` +[WARNING] `package.edition` is unspecified, defaulting to `2021` [CHECKING] script v0.0.0 ([ROOT]/foo) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..]s ", @@ -876,7 +922,7 @@ fn cmd_build_with_embedded() { ) .with_stderr( "\ -[WARNING] `package.edition` is unspecifiead, defaulting to `2021` +[WARNING] `package.edition` is unspecified, defaulting to `2021` [COMPILING] script v0.0.0 ([ROOT]/foo) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..]s ", @@ -904,7 +950,7 @@ test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; fini ) .with_stderr( "\ -[WARNING] `package.edition` is unspecifiead, defaulting to `2021` +[WARNING] `package.edition` is unspecified, defaulting to `2021` [COMPILING] script v0.0.0 ([ROOT]/foo) [FINISHED] test [unoptimized + debuginfo] target(s) in [..]s [RUNNING] unittests script.rs ([..]) @@ -933,7 +979,7 @@ fn cmd_clean_with_embedded() { ) .with_stderr( "\ -[WARNING] `package.edition` is unspecifiead, defaulting to `2021` +[WARNING] `package.edition` is unspecified, defaulting to `2021` ", ) .run(); @@ -954,7 +1000,7 @@ fn cmd_generate_lockfile_with_embedded() { ) .with_stderr( "\ -[WARNING] `package.edition` is unspecifiead, defaulting to `2021` +[WARNING] `package.edition` is unspecified, defaulting to `2021` ", ) .run(); @@ -1039,7 +1085,7 @@ fn cmd_metadata_with_embedded() { ) .with_stderr( "\ -[WARNING] `package.edition` is unspecifiead, defaulting to `2021` +[WARNING] `package.edition` is unspecified, defaulting to `2021` ", ) .run(); @@ -1095,7 +1141,7 @@ fn cmd_read_manifest_with_embedded() { ) .with_stderr( "\ -[WARNING] `package.edition` is unspecifiead, defaulting to `2021` +[WARNING] `package.edition` is unspecified, defaulting to `2021` ", ) .run(); @@ -1116,7 +1162,7 @@ args: [] ) .with_stderr( "\ -[WARNING] `package.edition` is unspecifiead, defaulting to `2021` +[WARNING] `package.edition` is unspecified, defaulting to `2021` [COMPILING] script v0.0.0 ([ROOT]/foo) [FINISHED] dev [unoptimized + debuginfo] target(s) in [..]s [RUNNING] `[..]/debug/script[EXE]` @@ -1140,7 +1186,7 @@ script v0.0.0 ([ROOT]/foo) ) .with_stderr( "\ -[WARNING] `package.edition` is unspecifiead, defaulting to `2021` +[WARNING] `package.edition` is unspecified, defaulting to `2021` ", ) .run(); @@ -1160,7 +1206,7 @@ fn cmd_update_with_embedded() { ) .with_stderr( "\ -[WARNING] `package.edition` is unspecifiead, defaulting to `2021` +[WARNING] `package.edition` is unspecified, defaulting to `2021` ", ) .run(); @@ -1177,7 +1223,61 @@ fn cmd_verify_project_with_embedded() { .with_json(r#"{"success":"true"}"#) .with_stderr( "\ -[WARNING] `package.edition` is unspecifiead, defaulting to `2021` +[WARNING] `package.edition` is unspecified, defaulting to `2021` +", + ) + .run(); +} + +#[cargo_test] +fn cmd_pkgid_with_embedded() { + let p = cargo_test_support::project() + .file("script.rs", ECHO_SCRIPT) + .build(); + + p.cargo("-Zscript pkgid --manifest-path script.rs") + .masquerade_as_nightly_cargo(&["script"]) + .with_status(101) + .with_stderr( + "\ +[WARNING] `package.edition` is unspecified, defaulting to `2021` +[ERROR] [ROOT]/foo/script.rs is unsupported by `cargo pkgid` +", + ) + .run(); +} + +#[cargo_test] +fn cmd_package_with_embedded() { + let p = cargo_test_support::project() + .file("script.rs", ECHO_SCRIPT) + .build(); + + p.cargo("-Zscript package --manifest-path script.rs") + .masquerade_as_nightly_cargo(&["script"]) + .with_status(101) + .with_stderr( + "\ +[WARNING] `package.edition` is unspecified, defaulting to `2021` +[ERROR] [ROOT]/foo/script.rs is unsupported by `cargo package` +", + ) + .run(); +} + +#[cargo_test] +fn cmd_publish_with_embedded() { + let p = cargo_test_support::project() + .file("script.rs", ECHO_SCRIPT) + .build(); + + p.cargo("-Zscript publish --manifest-path script.rs") + .masquerade_as_nightly_cargo(&["script"]) + .with_status(101) + .with_stderr( + "\ +[WARNING] `package.edition` is unspecified, defaulting to `2021` +[ERROR] [ROOT]/foo/script.rs is unsupported by `cargo publish` ", ) .run(); diff --git a/src/tools/cargo/tests/testsuite/test.rs b/src/tools/cargo/tests/testsuite/test.rs index 6a062cfb6..c6ae4ce61 100644 --- a/src/tools/cargo/tests/testsuite/test.rs +++ b/src/tools/cargo/tests/testsuite/test.rs @@ -389,10 +389,10 @@ failures: ---- test_hello stdout ---- [..]thread '[..]' panicked at [..]", ) - .with_stdout_contains("[..]assertion failed[..]") - .with_stdout_contains("[..]`(left == right)`[..]") - .with_stdout_contains("[..]left: `\"hello\"`,[..]") - .with_stdout_contains("[..]right: `\"nope\"`[..]") + .with_stdout_contains("[..]assertion [..]failed[..]") + .with_stdout_contains("[..]left == right[..]") + .with_stdout_contains("[..]left: [..]\"hello\"[..]") + .with_stdout_contains("[..]right: [..]\"nope\"[..]") .with_stdout_contains("[..]src/main.rs:12[..]") .with_stdout_contains( "\ @@ -4794,6 +4794,21 @@ error: test failed, to rerun pass `--test t2` Caused by: process didn't exit successfully: `[ROOT]/foo/target/debug/deps/t2[..]` (exit [..]: 4) +note: test exited abnormally; to see the full output pass --nocapture to the harness. +", + ) + .with_status(4) + .run(); + + p.cargo("test --test t2 -- --nocapture") + .with_stderr( + "\ +[FINISHED] test [..] +[RUNNING] tests/t2.rs (target/debug/deps/t2[..]) +error: test failed, to rerun pass `--test t2` + +Caused by: + process didn't exit successfully: `[ROOT]/foo/target/debug/deps/t2[..]` (exit [..]: 4) ", ) .with_status(4) @@ -4811,6 +4826,7 @@ error: test failed, to rerun pass `--test t2` Caused by: process didn't exit successfully: `[ROOT]/foo/target/debug/deps/t2[..]` (exit [..]: 4) +note: test exited abnormally; to see the full output pass --nocapture to the harness. error: 2 targets failed: `--test t1` `--test t2` @@ -4818,4 +4834,51 @@ error: 2 targets failed: ) .with_status(101) .run(); + + p.cargo("test --no-fail-fast -- --nocapture") + .with_stderr_does_not_contain("test exited abnormally; to see the full output pass --nocapture to the harness.") + .with_stderr_contains("[..]thread 't' panicked [..] tests/t1[..]") + .with_stderr_contains("note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace") + .with_stderr_contains("[..]process didn't exit successfully: `[ROOT]/foo/target/debug/deps/t2[..]` (exit [..]: 4)") + .with_status(101) + .run(); +} + +#[cargo_test] +fn cargo_test_no_keep_going() { + let p = project() + .file("Cargo.toml", &basic_bin_manifest("foo")) + .file("src/main.rs", "") + .build(); + + p.cargo("test --keep-going") + .with_stderr( + "\ +error: unexpected argument `--keep-going` found + + tip: to run as many tests as possible without failing fast, use `--no-fail-fast`", + ) + .with_status(101) + .run(); +} + +#[cargo_test] +fn cargo_test_print_env_verbose() { + let p = project() + .file("Cargo.toml", &basic_manifest("foo", "0.0.1")) + .file("src/lib.rs", "") + .build(); + + p.cargo("test -vv") + .with_stderr( + "\ +[COMPILING] foo v0.0.1 ([CWD]) +[RUNNING] `[..]CARGO_MANIFEST_DIR=[CWD][..] rustc --crate-name foo[..]` +[RUNNING] `[..]CARGO_MANIFEST_DIR=[CWD][..] rustc --crate-name foo[..]` +[FINISHED] test [unoptimized + debuginfo] target(s) in [..] +[RUNNING] `[..]CARGO_MANIFEST_DIR=[CWD][..] [CWD]/target/debug/deps/foo-[..][EXE]` +[DOCTEST] foo +[RUNNING] `[..]CARGO_MANIFEST_DIR=[CWD][..] rustdoc --crate-type lib --crate-name foo[..]", + ) + .run(); } diff --git a/src/tools/cargo/tests/testsuite/update.rs b/src/tools/cargo/tests/testsuite/update.rs index 1d3ee05b7..d42345355 100644 --- a/src/tools/cargo/tests/testsuite/update.rs +++ b/src/tools/cargo/tests/testsuite/update.rs @@ -464,6 +464,46 @@ fn update_aggressive() { .run(); } +#[cargo_test] +fn update_aggressive_conflicts_with_precise() { + Package::new("log", "0.1.0").publish(); + Package::new("serde", "0.2.1").dep("log", "0.1").publish(); + + let p = project() + .file( + "Cargo.toml", + r#" + [package] + name = "bar" + version = "0.0.1" + authors = [] + + [dependencies] + serde = "0.2" + "#, + ) + .file("src/lib.rs", "") + .build(); + + p.cargo("check").run(); + + Package::new("log", "0.1.1").publish(); + Package::new("serde", "0.2.2").dep("log", "0.1").publish(); + + p.cargo("update -p serde:0.2.1 --precise 0.2.2 --aggressive") + .with_status(1) + .with_stderr( + "\ +error: the argument '--precise <PRECISE>' cannot be used with '--aggressive' + +Usage: cargo[EXE] update --package [<SPEC>] --precise <PRECISE> + +For more information, try '--help'. +", + ) + .run(); +} + // cargo update should respect its arguments even without a lockfile. // See issue "Running cargo update without a Cargo.lock ignores arguments" // at <https://github.com/rust-lang/cargo/issues/6872>. diff --git a/src/tools/cargo/tests/testsuite/yank.rs b/src/tools/cargo/tests/testsuite/yank.rs index 684a04508..c0bd24776 100644 --- a/src/tools/cargo/tests/testsuite/yank.rs +++ b/src/tools/cargo/tests/testsuite/yank.rs @@ -76,14 +76,14 @@ fn explicit_version_with_asymmetric() { // The http_api server will check that the authorization is correct. // If the authorization was not sent then we would get an unauthorized error. p.cargo("yank --version 0.0.1") - .arg("-Zregistry-auth") - .masquerade_as_nightly_cargo(&["registry-auth"]) + .arg("-Zcredential-process") + .masquerade_as_nightly_cargo(&["credential-process"]) .replace_crates_io(registry.index_url()) .run(); p.cargo("yank --undo --version 0.0.1") - .arg("-Zregistry-auth") - .masquerade_as_nightly_cargo(&["registry-auth"]) + .arg("-Zcredential-process") + .masquerade_as_nightly_cargo(&["credential-process"]) .replace_crates_io(registry.index_url()) .run(); } |