mirror of
https://github.com/rust-lang/cargo.git
synced 2025-09-28 11:20:36 +00:00
Auto merge of #5907 - dwijnand:collapse-test-cmd-args, r=matklad
Collapse ProcessBuilder::arg calls in tests Refs #5742 More of #5854
This commit is contained in:
commit
a06570c2d1
@ -316,10 +316,9 @@ fn cannot_publish_to_crates_io_with_registry_dependency() {
|
||||
Package::new("bar", "0.0.1").alternative(true).publish();
|
||||
|
||||
assert_that(
|
||||
p.cargo("publish")
|
||||
.masquerade_as_nightly_cargo()
|
||||
.arg("--index")
|
||||
.arg(registry::registry().to_string()),
|
||||
p.cargo("publish --index")
|
||||
.arg(registry::registry().to_string())
|
||||
.masquerade_as_nightly_cargo(),
|
||||
execs().with_status(101),
|
||||
);
|
||||
}
|
||||
@ -349,21 +348,14 @@ fn publish_with_registry_dependency() {
|
||||
|
||||
// Login so that we have the token available
|
||||
assert_that(
|
||||
p.cargo("login")
|
||||
.masquerade_as_nightly_cargo()
|
||||
.arg("--registry")
|
||||
.arg("alternative")
|
||||
.arg("TOKEN")
|
||||
.arg("-Zunstable-options"),
|
||||
p.cargo("login --registry alternative TOKEN -Zunstable-options")
|
||||
.masquerade_as_nightly_cargo(),
|
||||
execs(),
|
||||
);
|
||||
|
||||
assert_that(
|
||||
p.cargo("publish")
|
||||
.masquerade_as_nightly_cargo()
|
||||
.arg("--registry")
|
||||
.arg("alternative")
|
||||
.arg("-Zunstable-options"),
|
||||
p.cargo("publish --registry alternative -Zunstable-options")
|
||||
.masquerade_as_nightly_cargo(),
|
||||
execs(),
|
||||
);
|
||||
}
|
||||
@ -427,11 +419,8 @@ fn block_publish_due_to_no_token() {
|
||||
|
||||
// Now perform the actual publish
|
||||
assert_that(
|
||||
p.cargo("publish")
|
||||
.masquerade_as_nightly_cargo()
|
||||
.arg("--registry")
|
||||
.arg("alternative")
|
||||
.arg("-Zunstable-options"),
|
||||
p.cargo("publish --registry alternative -Zunstable-options")
|
||||
.masquerade_as_nightly_cargo(),
|
||||
execs()
|
||||
.with_status(101)
|
||||
.with_stderr_contains("error: no upload token found, please run `cargo login`"),
|
||||
@ -460,22 +449,15 @@ fn publish_to_alt_registry() {
|
||||
|
||||
// Login so that we have the token available
|
||||
assert_that(
|
||||
p.cargo("login")
|
||||
.masquerade_as_nightly_cargo()
|
||||
.arg("--registry")
|
||||
.arg("alternative")
|
||||
.arg("TOKEN")
|
||||
.arg("-Zunstable-options"),
|
||||
p.cargo("login --registry alternative TOKEN -Zunstable-options")
|
||||
.masquerade_as_nightly_cargo(),
|
||||
execs(),
|
||||
);
|
||||
|
||||
// Now perform the actual publish
|
||||
assert_that(
|
||||
p.cargo("publish")
|
||||
.masquerade_as_nightly_cargo()
|
||||
.arg("--registry")
|
||||
.arg("alternative")
|
||||
.arg("-Zunstable-options"),
|
||||
p.cargo("publish --registry alternative -Zunstable-options")
|
||||
.masquerade_as_nightly_cargo(),
|
||||
execs(),
|
||||
);
|
||||
|
||||
@ -509,21 +491,14 @@ fn publish_with_crates_io_dep() {
|
||||
|
||||
// Login so that we have the token available
|
||||
assert_that(
|
||||
p.cargo("login")
|
||||
.masquerade_as_nightly_cargo()
|
||||
.arg("--registry")
|
||||
.arg("alternative")
|
||||
.arg("TOKEN")
|
||||
.arg("-Zunstable-options"),
|
||||
p.cargo("login --registry alternative TOKEN -Zunstable-options")
|
||||
.masquerade_as_nightly_cargo(),
|
||||
execs(),
|
||||
);
|
||||
|
||||
assert_that(
|
||||
p.cargo("publish")
|
||||
.masquerade_as_nightly_cargo()
|
||||
.arg("--registry")
|
||||
.arg("alternative")
|
||||
.arg("-Zunstable-options"),
|
||||
p.cargo("publish --registry alternative -Zunstable-options")
|
||||
.masquerade_as_nightly_cargo(),
|
||||
execs(),
|
||||
);
|
||||
}
|
||||
@ -560,11 +535,8 @@ fn credentials_in_url_forbidden() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("publish")
|
||||
.masquerade_as_nightly_cargo()
|
||||
.arg("--registry")
|
||||
.arg("alternative")
|
||||
.arg("-Zunstable-options"),
|
||||
p.cargo("publish --registry alternative -Zunstable-options")
|
||||
.masquerade_as_nightly_cargo(),
|
||||
execs()
|
||||
.with_status(101)
|
||||
.with_stderr_contains("error: Registry URLs may not contain credentials"),
|
||||
|
@ -15,9 +15,7 @@ fn bad1() {
|
||||
)
|
||||
.build();
|
||||
assert_that(
|
||||
p.cargo("build")
|
||||
.arg("-v")
|
||||
.arg("--target=nonexistent-target"),
|
||||
p.cargo("build -v --target=nonexistent-target"),
|
||||
execs().with_status(101).with_stderr(
|
||||
"\
|
||||
[ERROR] expected table for configuration key `target.nonexistent-target`, \
|
||||
@ -40,7 +38,7 @@ fn bad2() {
|
||||
)
|
||||
.build();
|
||||
assert_that(
|
||||
p.cargo("publish").arg("-v"),
|
||||
p.cargo("publish -v"),
|
||||
execs().with_status(101).with_stderr(
|
||||
"\
|
||||
[ERROR] could not load Cargo configuration
|
||||
@ -76,7 +74,7 @@ fn bad3() {
|
||||
Package::new("foo", "1.0.0").publish();
|
||||
|
||||
assert_that(
|
||||
p.cargo("publish").arg("-v"),
|
||||
p.cargo("publish -v"),
|
||||
execs().with_status(101).with_stderr(
|
||||
"\
|
||||
error: failed to update registry [..]
|
||||
@ -100,7 +98,7 @@ fn bad4() {
|
||||
)
|
||||
.build();
|
||||
assert_that(
|
||||
p.cargo("new").arg("-v").arg("foo"),
|
||||
p.cargo("new -v foo"),
|
||||
execs().with_status(101).with_stderr(
|
||||
"\
|
||||
[ERROR] Failed to create project `foo` at `[..]`
|
||||
@ -127,7 +125,7 @@ fn bad6() {
|
||||
Package::new("foo", "1.0.0").publish();
|
||||
|
||||
assert_that(
|
||||
p.cargo("publish").arg("-v"),
|
||||
p.cargo("publish -v"),
|
||||
execs().with_status(101).with_stderr(
|
||||
"\
|
||||
error: failed to update registry [..]
|
||||
@ -152,7 +150,7 @@ fn bad_cargo_config_jobs() {
|
||||
)
|
||||
.build();
|
||||
assert_that(
|
||||
p.cargo("build").arg("-v"),
|
||||
p.cargo("build -v"),
|
||||
execs().with_status(101).with_stderr(
|
||||
"\
|
||||
[ERROR] error in [..].cargo/config: \
|
||||
@ -175,7 +173,7 @@ fn default_cargo_config_jobs() {
|
||||
"#,
|
||||
)
|
||||
.build();
|
||||
assert_that(p.cargo("build").arg("-v"), execs());
|
||||
assert_that(p.cargo("build -v"), execs());
|
||||
}
|
||||
|
||||
#[test]
|
||||
@ -190,7 +188,7 @@ fn good_cargo_config_jobs() {
|
||||
"#,
|
||||
)
|
||||
.build();
|
||||
assert_that(p.cargo("build").arg("-v"), execs());
|
||||
assert_that(p.cargo("build -v"), execs());
|
||||
}
|
||||
|
||||
#[test]
|
||||
@ -213,7 +211,7 @@ fn invalid_global_config() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("build").arg("-v"),
|
||||
p.cargo("build -v"),
|
||||
execs().with_status(101).with_stderr(
|
||||
"\
|
||||
[ERROR] could not load Cargo configuration
|
||||
@ -239,7 +237,7 @@ fn bad_cargo_lock() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("build").arg("-v"),
|
||||
p.cargo("build -v"),
|
||||
execs().with_status(101).with_stderr(
|
||||
"\
|
||||
[ERROR] failed to parse lock file at: [..]Cargo.lock
|
||||
@ -342,7 +340,7 @@ fn bad_source_in_cargo_lock() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("build").arg("--verbose"),
|
||||
p.cargo("build --verbose"),
|
||||
execs().with_status(101).with_stderr(
|
||||
"\
|
||||
[ERROR] failed to parse lock file at: [..]
|
||||
@ -393,7 +391,7 @@ fn bad_git_dependency() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("build").arg("-v"),
|
||||
p.cargo("build -v"),
|
||||
execs().with_status(101).with_stderr(
|
||||
"\
|
||||
[UPDATING] git repository `file:///`
|
||||
@ -431,7 +429,7 @@ fn bad_crate_type() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("build").arg("-v"),
|
||||
p.cargo("build -v"),
|
||||
execs().with_status(101).with_stderr_contains(
|
||||
"error: failed to run `rustc` to learn about crate-type bad_type information",
|
||||
),
|
||||
@ -536,7 +534,7 @@ fn duplicate_example_names() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("build").arg("--example").arg("ex"),
|
||||
p.cargo("build --example ex"),
|
||||
execs().with_status(101).with_stderr(
|
||||
"\
|
||||
[ERROR] failed to parse manifest at `[..]`
|
||||
@ -876,7 +874,7 @@ fn ambiguous_git_reference() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("build").arg("-v"),
|
||||
p.cargo("build -v"),
|
||||
execs().with_status(101).with_stderr_contains(
|
||||
"\
|
||||
[WARNING] dependency (bar) specification is ambiguous. \
|
||||
@ -1096,7 +1094,7 @@ fn both_git_and_path_specified() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
foo.cargo("build").arg("-v"),
|
||||
foo.cargo("build -v"),
|
||||
execs().with_status(101).with_stderr_contains(
|
||||
"\
|
||||
[WARNING] dependency (bar) specification is ambiguous. \
|
||||
@ -1161,7 +1159,7 @@ fn ignored_git_revision() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
foo.cargo("build").arg("-v"),
|
||||
foo.cargo("build -v"),
|
||||
execs().with_status(101).with_stderr_contains(
|
||||
"\
|
||||
[WARNING] key `branch` is ignored for dependency (bar). \
|
||||
|
@ -326,9 +326,7 @@ fn verify_project_dir_containing_cargo_toml() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("verify-project")
|
||||
.arg("--manifest-path")
|
||||
.arg("foo")
|
||||
p.cargo("verify-project --manifest-path foo")
|
||||
.cwd(p.root().parent().unwrap()),
|
||||
execs().with_status(1).with_stdout(
|
||||
"{\"invalid\":\"the manifest-path must be a path to a Cargo.toml file\"}\
|
||||
@ -345,9 +343,7 @@ fn verify_project_dir_plus_file() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("verify-project")
|
||||
.arg("--manifest-path")
|
||||
.arg("foo/bar")
|
||||
p.cargo("verify-project --manifest-path foo/bar")
|
||||
.cwd(p.root().parent().unwrap()),
|
||||
execs().with_status(1).with_stdout(
|
||||
"{\"invalid\":\"the manifest-path must be a path to a Cargo.toml file\"}\
|
||||
@ -364,9 +360,7 @@ fn verify_project_dir_plus_path() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("verify-project")
|
||||
.arg("--manifest-path")
|
||||
.arg("foo/bar/baz")
|
||||
p.cargo("verify-project --manifest-path foo/bar/baz")
|
||||
.cwd(p.root().parent().unwrap()),
|
||||
execs().with_status(1).with_stdout(
|
||||
"{\"invalid\":\"the manifest-path must be a path to a Cargo.toml file\"}\
|
||||
@ -379,9 +373,7 @@ fn verify_project_dir_plus_path() {
|
||||
fn verify_project_dir_to_nonexistent_cargo_toml() {
|
||||
let p = project().build();
|
||||
assert_that(
|
||||
p.cargo("verify-project")
|
||||
.arg("--manifest-path")
|
||||
.arg("foo/bar/baz/Cargo.toml")
|
||||
p.cargo("verify-project --manifest-path foo/bar/baz/Cargo.toml")
|
||||
.cwd(p.root().parent().unwrap()),
|
||||
execs().with_status(1).with_stdout(
|
||||
"{\"invalid\":\"manifest path `foo[..]bar[..]baz[..]Cargo.toml` does not exist\"}\
|
||||
|
@ -88,7 +88,7 @@ fn bench_bench_implicit() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("bench").arg("--benches"),
|
||||
p.cargo("bench --benches"),
|
||||
execs()
|
||||
.with_stderr(format!(
|
||||
"\
|
||||
@ -136,7 +136,7 @@ fn bench_bin_implicit() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("bench").arg("--bins"),
|
||||
p.cargo("bench --bins"),
|
||||
execs()
|
||||
.with_stderr(format!(
|
||||
"\
|
||||
@ -174,7 +174,7 @@ fn bench_tarname() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("bench").arg("--bench").arg("bin2"),
|
||||
p.cargo("bench --bench bin2"),
|
||||
execs()
|
||||
.with_stderr(format!(
|
||||
"\
|
||||
@ -219,11 +219,7 @@ fn bench_multiple_targets() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("bench")
|
||||
.arg("--bench")
|
||||
.arg("bin1")
|
||||
.arg("--bench")
|
||||
.arg("bin2"),
|
||||
p.cargo("bench --bench bin1 --bench bin2"),
|
||||
execs()
|
||||
.with_stdout_contains("test run1 ... bench: [..]")
|
||||
.with_stdout_contains("test run2 ... bench: [..]")
|
||||
@ -252,7 +248,7 @@ fn cargo_bench_verbose() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("bench").arg("-v").arg("hello"),
|
||||
p.cargo("bench -v hello"),
|
||||
execs()
|
||||
.with_stderr(&format!(
|
||||
"\
|
||||
@ -361,7 +357,7 @@ fn cargo_bench_failing_test() {
|
||||
|
||||
// Force libtest into serial execution so that the test header will be printed.
|
||||
assert_that(
|
||||
p.cargo("bench").arg("--").arg("--test-threads=1"),
|
||||
p.cargo("bench -- --test-threads=1"),
|
||||
execs()
|
||||
.with_stdout_contains("test bench_hello ...[..]")
|
||||
.with_stderr_contains(format!(
|
||||
@ -680,8 +676,7 @@ fn bench_autodiscover_2015() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("bench")
|
||||
.arg("bench_basic")
|
||||
p.cargo("bench bench_basic")
|
||||
.masquerade_as_nightly_cargo(),
|
||||
execs().with_stderr(&format!(
|
||||
"warning: \
|
||||
@ -746,7 +741,7 @@ fn pass_through_command_line() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("bench").arg("bar"),
|
||||
p.cargo("bench bar"),
|
||||
execs()
|
||||
.with_stderr(&format!(
|
||||
"\
|
||||
@ -759,7 +754,7 @@ fn pass_through_command_line() {
|
||||
);
|
||||
|
||||
assert_that(
|
||||
p.cargo("bench").arg("foo"),
|
||||
p.cargo("bench foo"),
|
||||
execs()
|
||||
.with_stderr(
|
||||
"[FINISHED] release [optimized] target(s) in [..]
|
||||
@ -1031,7 +1026,7 @@ fn bench_dylib() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("bench").arg("-v"),
|
||||
p.cargo("bench -v"),
|
||||
execs()
|
||||
.with_stderr(&format!(
|
||||
"\
|
||||
@ -1051,7 +1046,7 @@ fn bench_dylib() {
|
||||
|
||||
p.root().move_into_the_past();
|
||||
assert_that(
|
||||
p.cargo("bench").arg("-v"),
|
||||
p.cargo("bench -v"),
|
||||
execs()
|
||||
.with_stderr(&format!(
|
||||
"\
|
||||
@ -1192,7 +1187,7 @@ fn bench_with_examples() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("bench").arg("-v"),
|
||||
p.cargo("bench -v"),
|
||||
execs()
|
||||
.with_stderr(&format!(
|
||||
"\
|
||||
@ -1277,7 +1272,7 @@ fn test_bench_no_run() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("bench").arg("--no-run"),
|
||||
p.cargo("bench --no-run"),
|
||||
execs().with_stderr(
|
||||
"\
|
||||
[COMPILING] foo v0.0.1 ([..])
|
||||
@ -1322,10 +1317,7 @@ fn test_bench_no_fail_fast() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("bench")
|
||||
.arg("--no-fail-fast")
|
||||
.arg("--")
|
||||
.arg("--test-threads=1"),
|
||||
p.cargo("bench --no-fail-fast -- --test-threads=1"),
|
||||
execs()
|
||||
.with_status(101)
|
||||
.with_stderr_contains("[RUNNING] target/release/deps/foo-[..][EXE]")
|
||||
@ -1420,7 +1412,7 @@ fn test_bench_multiple_packages() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("bench").arg("-p").arg("bar").arg("-p").arg("baz"),
|
||||
p.cargo("bench -p bar -p baz"),
|
||||
execs()
|
||||
.with_stderr_contains("[RUNNING] target/release/deps/bbaz-[..][EXE]")
|
||||
.with_stdout_contains("test bench_baz ... bench: [..]")
|
||||
@ -1479,7 +1471,7 @@ fn bench_all_workspace() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("bench").arg("--all"),
|
||||
p.cargo("bench --all"),
|
||||
execs()
|
||||
.with_stderr_contains("[RUNNING] target/release/deps/bar-[..][EXE]")
|
||||
.with_stdout_contains("test bench_bar ... bench: [..]")
|
||||
@ -1526,7 +1518,7 @@ fn bench_all_exclude() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("bench").arg("--all").arg("--exclude").arg("baz"),
|
||||
p.cargo("bench --all --exclude baz"),
|
||||
execs().with_stdout_contains(
|
||||
"\
|
||||
running 1 test
|
||||
@ -1581,7 +1573,7 @@ fn bench_all_virtual_manifest() {
|
||||
|
||||
// The order in which bar and baz are built is not guaranteed
|
||||
assert_that(
|
||||
p.cargo("bench").arg("--all"),
|
||||
p.cargo("bench --all"),
|
||||
execs()
|
||||
.with_stderr_contains("[RUNNING] target/release/deps/baz-[..][EXE]")
|
||||
.with_stdout_contains("test bench_baz ... bench: [..]")
|
||||
|
@ -35,7 +35,7 @@ fn cargo_fail_with_no_stderr() {
|
||||
.file("src/foo.rs", &String::from("refusal"))
|
||||
.build();
|
||||
assert_that(
|
||||
p.cargo("build").arg("--message-format=json"),
|
||||
p.cargo("build --message-format=json"),
|
||||
execs()
|
||||
.with_status(101)
|
||||
.with_stderr_does_not_contain("--- stderr"),
|
||||
@ -52,14 +52,14 @@ fn cargo_compile_incremental() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("build").arg("-v").env("CARGO_INCREMENTAL", "1"),
|
||||
p.cargo("build -v").env("CARGO_INCREMENTAL", "1"),
|
||||
execs().with_stderr_contains(
|
||||
"[RUNNING] `rustc [..] -C incremental=[..]/target/debug/incremental[..]`\n",
|
||||
)
|
||||
);
|
||||
|
||||
assert_that(
|
||||
p.cargo("test").arg("-v").env("CARGO_INCREMENTAL", "1"),
|
||||
p.cargo("test -v").env("CARGO_INCREMENTAL", "1"),
|
||||
execs().with_stderr_contains(
|
||||
"[RUNNING] `rustc [..] -C incremental=[..]/target/debug/incremental[..]`\n",
|
||||
)
|
||||
@ -88,27 +88,23 @@ fn incremental_profile() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("build").arg("-v").env_remove("CARGO_INCREMENTAL"),
|
||||
p.cargo("build -v").env_remove("CARGO_INCREMENTAL"),
|
||||
execs().with_stderr_does_not_contain("[..]C incremental=[..]"),
|
||||
);
|
||||
|
||||
assert_that(
|
||||
p.cargo("build").arg("-v").env("CARGO_INCREMENTAL", "1"),
|
||||
p.cargo("build -v").env("CARGO_INCREMENTAL", "1"),
|
||||
execs().with_stderr_contains("[..]C incremental=[..]"),
|
||||
);
|
||||
|
||||
assert_that(
|
||||
p.cargo("build")
|
||||
.arg("--release")
|
||||
.arg("-v")
|
||||
p.cargo("build --release -v")
|
||||
.env_remove("CARGO_INCREMENTAL"),
|
||||
execs().with_stderr_contains("[..]C incremental=[..]"),
|
||||
);
|
||||
|
||||
assert_that(
|
||||
p.cargo("build")
|
||||
.arg("--release")
|
||||
.arg("-v")
|
||||
p.cargo("build --release -v")
|
||||
.env("CARGO_INCREMENTAL", "0"),
|
||||
execs().with_stderr_does_not_contain("[..]C incremental=[..]"),
|
||||
);
|
||||
@ -128,13 +124,13 @@ fn incremental_config() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("build").arg("-v").env_remove("CARGO_INCREMENTAL"),
|
||||
p.cargo("build -v").env_remove("CARGO_INCREMENTAL"),
|
||||
execs()
|
||||
.with_stderr_does_not_contain("[..]C incremental=[..]"),
|
||||
);
|
||||
|
||||
assert_that(
|
||||
p.cargo("build").arg("-v").env("CARGO_INCREMENTAL", "1"),
|
||||
p.cargo("build -v").env("CARGO_INCREMENTAL", "1"),
|
||||
execs().with_stderr_contains("[..]C incremental=[..]"),
|
||||
);
|
||||
}
|
||||
@ -146,7 +142,7 @@ fn cargo_compile_with_workspace_excluded() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("build").arg("--all").arg("--exclude").arg("foo"),
|
||||
p.cargo("build --all --exclude foo"),
|
||||
execs()
|
||||
.with_stderr_does_not_contain("[..]virtual[..]")
|
||||
.with_stderr_contains("[..]no packages to compile")
|
||||
@ -162,9 +158,7 @@ fn cargo_compile_manifest_path() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("build")
|
||||
.arg("--manifest-path")
|
||||
.arg("foo/Cargo.toml")
|
||||
p.cargo("build --manifest-path foo/Cargo.toml")
|
||||
.cwd(p.root().parent().unwrap()),
|
||||
execs(),
|
||||
);
|
||||
@ -223,9 +217,7 @@ fn cargo_compile_with_invalid_manifest3() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("build")
|
||||
.arg("--manifest-path")
|
||||
.arg("src/Cargo.toml"),
|
||||
p.cargo("build --manifest-path src/Cargo.toml"),
|
||||
execs().with_status(101).with_stderr(
|
||||
"\
|
||||
[ERROR] failed to parse manifest at `[..]`
|
||||
@ -917,14 +909,14 @@ fn cargo_compile_with_filename() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("build").arg("--bin").arg("bin.rs"),
|
||||
p.cargo("build --bin bin.rs"),
|
||||
execs()
|
||||
.with_status(101)
|
||||
.with_stderr("[ERROR] no bin target named `bin.rs`"),
|
||||
);
|
||||
|
||||
assert_that(
|
||||
p.cargo("build").arg("--bin").arg("a.rs"),
|
||||
p.cargo("build --bin a.rs"),
|
||||
execs().with_status(101).with_stderr(
|
||||
"\
|
||||
[ERROR] no bin target named `a.rs`
|
||||
@ -934,14 +926,14 @@ Did you mean `a`?",
|
||||
);
|
||||
|
||||
assert_that(
|
||||
p.cargo("build").arg("--example").arg("example.rs"),
|
||||
p.cargo("build --example example.rs"),
|
||||
execs()
|
||||
.with_status(101)
|
||||
.with_stderr("[ERROR] no example target named `example.rs`"),
|
||||
);
|
||||
|
||||
assert_that(
|
||||
p.cargo("build").arg("--example").arg("a.rs"),
|
||||
p.cargo("build --example a.rs"),
|
||||
execs().with_status(101).with_stderr(
|
||||
"\
|
||||
[ERROR] no example target named `a.rs`
|
||||
@ -972,9 +964,8 @@ fn cargo_compile_path_with_offline() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("build")
|
||||
.masquerade_as_nightly_cargo()
|
||||
.arg("-Zoffline"),
|
||||
p.cargo("build -Zoffline")
|
||||
.masquerade_as_nightly_cargo(),
|
||||
execs(),
|
||||
);
|
||||
}
|
||||
@ -1021,9 +1012,8 @@ fn cargo_compile_with_downloaded_dependency_with_offline() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p2.cargo("build")
|
||||
.masquerade_as_nightly_cargo()
|
||||
.arg("-Zoffline"),
|
||||
p2.cargo("build -Zoffline")
|
||||
.masquerade_as_nightly_cargo(),
|
||||
execs().with_stderr(
|
||||
"\
|
||||
[COMPILING] present_dep v1.2.3
|
||||
@ -1051,9 +1041,8 @@ fn cargo_compile_offline_not_try_update() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("build")
|
||||
.masquerade_as_nightly_cargo()
|
||||
.arg("-Zoffline"),
|
||||
p.cargo("build -Zoffline")
|
||||
.masquerade_as_nightly_cargo(),
|
||||
execs().with_status(101).with_stderr(
|
||||
"\
|
||||
error: no matching package named `not_cached_dep` found
|
||||
@ -1124,9 +1113,8 @@ fn main(){
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p2.cargo("run")
|
||||
.masquerade_as_nightly_cargo()
|
||||
.arg("-Zoffline"),
|
||||
p2.cargo("run -Zoffline")
|
||||
.masquerade_as_nightly_cargo(),
|
||||
execs()
|
||||
.with_stderr(format!(
|
||||
"\
|
||||
@ -1275,9 +1263,8 @@ fn compile_offline_while_transitive_dep_not_cached() {
|
||||
drop(File::create(baz_path).ok().unwrap().write_all(&content));
|
||||
|
||||
assert_that(
|
||||
p.cargo("build")
|
||||
.masquerade_as_nightly_cargo()
|
||||
.arg("-Zoffline"),
|
||||
p.cargo("build -Zoffline")
|
||||
.masquerade_as_nightly_cargo(),
|
||||
execs().with_status(101).with_stderr(
|
||||
"\
|
||||
error: no matching package named `baz` found
|
||||
@ -1381,7 +1368,7 @@ fn cargo_default_env_metadata_env_var() {
|
||||
|
||||
// No metadata on libbar since it's a dylib path dependency
|
||||
assert_that(
|
||||
p.cargo("build").arg("-v"),
|
||||
p.cargo("build -v"),
|
||||
execs().with_stderr(&format!(
|
||||
"\
|
||||
[COMPILING] bar v0.0.1 ({url}/bar)
|
||||
@ -1411,8 +1398,7 @@ fn cargo_default_env_metadata_env_var() {
|
||||
|
||||
// If you set the env-var, then we expect metadata on libbar
|
||||
assert_that(
|
||||
p.cargo("build")
|
||||
.arg("-v")
|
||||
p.cargo("build -v")
|
||||
.env("__CARGO_DEFAULT_LIB_METADATA", "stable"),
|
||||
execs().with_stderr(&format!(
|
||||
"\
|
||||
@ -1502,7 +1488,7 @@ fn crate_env_vars() {
|
||||
.build();
|
||||
|
||||
println!("build");
|
||||
assert_that(p.cargo("build").arg("-v"), execs());
|
||||
assert_that(p.cargo("build -v"), execs());
|
||||
|
||||
println!("bin");
|
||||
assert_that(
|
||||
@ -1512,7 +1498,7 @@ fn crate_env_vars() {
|
||||
);
|
||||
|
||||
println!("test");
|
||||
assert_that(p.cargo("test").arg("-v"), execs());
|
||||
assert_that(p.cargo("test -v"), execs());
|
||||
}
|
||||
|
||||
#[test]
|
||||
@ -1553,7 +1539,7 @@ fn crate_authors_env_vars() {
|
||||
.build();
|
||||
|
||||
println!("build");
|
||||
assert_that(p.cargo("build").arg("-v"), execs());
|
||||
assert_that(p.cargo("build -v"), execs());
|
||||
|
||||
println!("bin");
|
||||
assert_that(
|
||||
@ -1563,7 +1549,7 @@ fn crate_authors_env_vars() {
|
||||
);
|
||||
|
||||
println!("test");
|
||||
assert_that(p.cargo("test").arg("-v"), execs());
|
||||
assert_that(p.cargo("test -v"), execs());
|
||||
}
|
||||
|
||||
// The tester may already have LD_LIBRARY_PATH=::/foo/bar which leads to a false positive error
|
||||
@ -1775,7 +1761,7 @@ fn lto_build() {
|
||||
.file("src/main.rs", "fn main() {}")
|
||||
.build();
|
||||
assert_that(
|
||||
p.cargo("build").arg("-v").arg("--release"),
|
||||
p.cargo("build -v --release"),
|
||||
execs().with_stderr(&format!(
|
||||
"\
|
||||
[COMPILING] test v0.0.0 ({url})
|
||||
@ -1800,7 +1786,7 @@ fn verbose_build() {
|
||||
.file("src/lib.rs", "")
|
||||
.build();
|
||||
assert_that(
|
||||
p.cargo("build").arg("-v"),
|
||||
p.cargo("build -v"),
|
||||
execs().with_stderr(&format!(
|
||||
"\
|
||||
[COMPILING] foo v0.0.1 ({url})
|
||||
@ -1823,7 +1809,7 @@ fn verbose_release_build() {
|
||||
.file("src/lib.rs", "")
|
||||
.build();
|
||||
assert_that(
|
||||
p.cargo("build").arg("-v").arg("--release"),
|
||||
p.cargo("build -v --release"),
|
||||
execs().with_stderr(&format!(
|
||||
"\
|
||||
[COMPILING] foo v0.0.1 ({url})
|
||||
@ -1875,7 +1861,7 @@ fn verbose_release_build_deps() {
|
||||
.file("foo/src/lib.rs", "")
|
||||
.build();
|
||||
assert_that(
|
||||
p.cargo("build").arg("-v").arg("--release"),
|
||||
p.cargo("build -v --release"),
|
||||
execs().with_stderr(&format!(
|
||||
"\
|
||||
[COMPILING] foo v0.0.0 ({url}/foo)
|
||||
@ -1954,7 +1940,7 @@ fn explicit_examples() {
|
||||
)
|
||||
.build();
|
||||
|
||||
assert_that(p.cargo("test").arg("-v"), execs());
|
||||
assert_that(p.cargo("test -v"), execs());
|
||||
assert_that(
|
||||
process(&p.bin("examples/hello")),
|
||||
execs().with_stdout("Hello, World!\n"),
|
||||
@ -1988,7 +1974,7 @@ fn non_existing_example() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("test").arg("-v"),
|
||||
p.cargo("test -v"),
|
||||
execs().with_status(101).with_stderr(
|
||||
"\
|
||||
[ERROR] failed to parse manifest at `[..]`
|
||||
@ -2008,7 +1994,7 @@ fn non_existing_binary() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("build").arg("-v"),
|
||||
p.cargo("build -v"),
|
||||
execs().with_status(101).with_stderr(
|
||||
"\
|
||||
[ERROR] failed to parse manifest at `[..]`
|
||||
@ -2039,7 +2025,7 @@ fn legacy_binary_paths_warnings() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("build").arg("-v"),
|
||||
p.cargo("build -v"),
|
||||
execs().with_stderr_contains(
|
||||
"\
|
||||
[WARNING] path `[..]src/main.rs` was erroneously implicitly accepted for binary `bar`,
|
||||
@ -2065,7 +2051,7 @@ please set bin.path in Cargo.toml",
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("build").arg("-v"),
|
||||
p.cargo("build -v"),
|
||||
execs().with_stderr_contains(
|
||||
"\
|
||||
[WARNING] path `[..]src/bin/main.rs` was erroneously implicitly accepted for binary `bar`,
|
||||
@ -2090,7 +2076,7 @@ please set bin.path in Cargo.toml",
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("build").arg("-v"),
|
||||
p.cargo("build -v"),
|
||||
execs().with_stderr_contains(
|
||||
"\
|
||||
[WARNING] path `[..]src/bar.rs` was erroneously implicitly accepted for binary `bar`,
|
||||
@ -2184,7 +2170,7 @@ fn release_build_ndebug() {
|
||||
)
|
||||
.build();
|
||||
|
||||
assert_that(p.cargo("build").arg("--release"), execs());
|
||||
assert_that(p.cargo("build --release"), execs());
|
||||
assert_that(
|
||||
process(&p.release_bin("foo")),
|
||||
execs().with_stdout("fast\n"),
|
||||
@ -2303,7 +2289,7 @@ fn staticlib_rlib_and_bin() {
|
||||
.file("src/main.rs", "extern crate foo; fn main() { foo::foo(); }")
|
||||
.build();
|
||||
|
||||
assert_that(p.cargo("build").arg("-v"), execs());
|
||||
assert_that(p.cargo("build -v"), execs());
|
||||
}
|
||||
|
||||
#[test]
|
||||
@ -2517,7 +2503,7 @@ fn bad_cargo_config() {
|
||||
.file(".cargo/config", "this is not valid toml")
|
||||
.build();
|
||||
assert_that(
|
||||
foo.cargo("build").arg("-v"),
|
||||
foo.cargo("build -v"),
|
||||
execs().with_status(101).with_stderr(
|
||||
"\
|
||||
[ERROR] could not load Cargo configuration
|
||||
@ -2655,7 +2641,7 @@ fn example_as_lib() {
|
||||
.file("examples/ex.rs", "")
|
||||
.build();
|
||||
|
||||
assert_that(p.cargo("build").arg("--example=ex"), execs());
|
||||
assert_that(p.cargo("build --example=ex"), execs());
|
||||
assert_that(&p.example_lib("ex", "lib"), existing_file());
|
||||
}
|
||||
|
||||
@ -2679,7 +2665,7 @@ fn example_as_rlib() {
|
||||
.file("examples/ex.rs", "")
|
||||
.build();
|
||||
|
||||
assert_that(p.cargo("build").arg("--example=ex"), execs());
|
||||
assert_that(p.cargo("build --example=ex"), execs());
|
||||
assert_that(&p.example_lib("ex", "rlib"), existing_file());
|
||||
}
|
||||
|
||||
@ -2703,7 +2689,7 @@ fn example_as_dylib() {
|
||||
.file("examples/ex.rs", "")
|
||||
.build();
|
||||
|
||||
assert_that(p.cargo("build").arg("--example=ex"), execs());
|
||||
assert_that(p.cargo("build --example=ex"), execs());
|
||||
assert_that(&p.example_lib("ex", "dylib"), existing_file());
|
||||
}
|
||||
|
||||
@ -2731,7 +2717,7 @@ fn example_as_proc_macro() {
|
||||
.file("examples/ex.rs", "#![feature(proc_macro)]")
|
||||
.build();
|
||||
|
||||
assert_that(p.cargo("build").arg("--example=ex"), execs());
|
||||
assert_that(p.cargo("build --example=ex"), execs());
|
||||
assert_that(&p.example_lib("ex", "proc-macro"), existing_file());
|
||||
}
|
||||
|
||||
@ -2742,9 +2728,7 @@ fn example_bin_same_name() {
|
||||
.file("examples/foo.rs", "fn main() {}")
|
||||
.build();
|
||||
|
||||
p.cargo("test")
|
||||
.arg("--no-run")
|
||||
.arg("-v")
|
||||
p.cargo("test --no-run -v")
|
||||
.exec_with_output()
|
||||
.unwrap();
|
||||
|
||||
@ -2752,9 +2736,7 @@ fn example_bin_same_name() {
|
||||
// We expect a file of the form bin/foo-{metadata_hash}
|
||||
assert_that(&p.bin("examples/foo"), existing_file());
|
||||
|
||||
p.cargo("test")
|
||||
.arg("--no-run")
|
||||
.arg("-v")
|
||||
p.cargo("test --no-run -v")
|
||||
.exec_with_output()
|
||||
.unwrap();
|
||||
|
||||
@ -2769,14 +2751,14 @@ fn compile_then_delete() {
|
||||
.file("src/main.rs", "fn main() {}")
|
||||
.build();
|
||||
|
||||
assert_that(p.cargo("run").arg("-v"), execs());
|
||||
assert_that(p.cargo("run -v"), execs());
|
||||
assert_that(&p.bin("foo"), existing_file());
|
||||
if cfg!(windows) {
|
||||
// On windows unlinking immediately after running often fails, so sleep
|
||||
sleep_ms(100);
|
||||
}
|
||||
fs::remove_file(&p.bin("foo")).unwrap();
|
||||
assert_that(p.cargo("run").arg("-v"), execs());
|
||||
assert_that(p.cargo("run -v"), execs());
|
||||
}
|
||||
|
||||
#[test]
|
||||
@ -2816,7 +2798,7 @@ fn transitive_dependencies_not_available() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("build").arg("-v"),
|
||||
p.cargo("build -v"),
|
||||
execs()
|
||||
.with_status(101)
|
||||
.with_stderr_contains("[..] can't find crate for `bbbbb`[..]"),
|
||||
@ -2854,7 +2836,7 @@ fn cyclic_deps_rejected() {
|
||||
.file("a/src/lib.rs", "")
|
||||
.build();
|
||||
|
||||
assert_that(p.cargo("build").arg("-v"),
|
||||
assert_that(p.cargo("build -v"),
|
||||
execs().with_status(101)
|
||||
.with_stderr(
|
||||
r#"[ERROR] cyclic package dependency: package `a v0.0.1 ([..])` depends on itself. Cycle:
|
||||
@ -2881,7 +2863,7 @@ fn predictable_filenames() {
|
||||
.file("src/lib.rs", "")
|
||||
.build();
|
||||
|
||||
assert_that(p.cargo("build").arg("-v"), execs());
|
||||
assert_that(p.cargo("build -v"), execs());
|
||||
assert_that(&p.root().join("target/debug/libfoo.rlib"), existing_file());
|
||||
let dylib_name = format!("{}foo{}", env::consts::DLL_PREFIX, env::consts::DLL_SUFFIX);
|
||||
assert_that(
|
||||
@ -2898,7 +2880,7 @@ fn dashes_to_underscores() {
|
||||
.file("src/main.rs", "extern crate foo_bar; fn main() {}")
|
||||
.build();
|
||||
|
||||
assert_that(p.cargo("build").arg("-v"), execs());
|
||||
assert_that(p.cargo("build -v"), execs());
|
||||
assert_that(&p.bin("foo-bar"), existing_file());
|
||||
}
|
||||
|
||||
@ -2921,7 +2903,7 @@ fn dashes_in_crate_name_bad() {
|
||||
.file("src/main.rs", "extern crate foo_bar; fn main() {}")
|
||||
.build();
|
||||
|
||||
assert_that(p.cargo("build").arg("-v"), execs().with_status(101));
|
||||
assert_that(p.cargo("build -v"), execs().with_status(101));
|
||||
}
|
||||
|
||||
#[test]
|
||||
@ -2931,9 +2913,8 @@ fn rustc_env_var() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("build")
|
||||
.env("RUSTC", "rustc-that-does-not-exist")
|
||||
.arg("-v"),
|
||||
p.cargo("build -v")
|
||||
.env("RUSTC", "rustc-that-does-not-exist"),
|
||||
execs().with_status(101).with_stderr(
|
||||
"\
|
||||
[ERROR] could not execute process `rustc-that-does-not-exist -vV` ([..])
|
||||
@ -2956,11 +2937,11 @@ fn filtering() {
|
||||
.file("examples/b.rs", "fn main() {}")
|
||||
.build();
|
||||
|
||||
assert_that(p.cargo("build").arg("--lib"), execs());
|
||||
assert_that(p.cargo("build --lib"), execs());
|
||||
assert_that(&p.bin("a"), is_not(existing_file()));
|
||||
|
||||
assert_that(
|
||||
p.cargo("build").arg("--bin=a").arg("--example=a"),
|
||||
p.cargo("build --bin=a --example=a"),
|
||||
execs(),
|
||||
);
|
||||
assert_that(&p.bin("a"), existing_file());
|
||||
@ -2979,7 +2960,7 @@ fn filtering_implicit_bins() {
|
||||
.file("examples/b.rs", "fn main() {}")
|
||||
.build();
|
||||
|
||||
assert_that(p.cargo("build").arg("--bins"), execs());
|
||||
assert_that(p.cargo("build --bins"), execs());
|
||||
assert_that(&p.bin("a"), existing_file());
|
||||
assert_that(&p.bin("b"), existing_file());
|
||||
assert_that(&p.bin("examples/a"), is_not(existing_file()));
|
||||
@ -2996,7 +2977,7 @@ fn filtering_implicit_examples() {
|
||||
.file("examples/b.rs", "fn main() {}")
|
||||
.build();
|
||||
|
||||
assert_that(p.cargo("build").arg("--examples"), execs());
|
||||
assert_that(p.cargo("build --examples"), execs());
|
||||
assert_that(&p.bin("a"), is_not(existing_file()));
|
||||
assert_that(&p.bin("b"), is_not(existing_file()));
|
||||
assert_that(&p.bin("examples/a"), existing_file());
|
||||
@ -3259,18 +3240,14 @@ fn invalid_spec() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("build").arg("-p").arg("notAValidDep"),
|
||||
p.cargo("build -p notAValidDep"),
|
||||
execs()
|
||||
.with_status(101)
|
||||
.with_stderr("[ERROR] package id specification `notAValidDep` matched no packages"),
|
||||
);
|
||||
|
||||
assert_that(
|
||||
p.cargo("build")
|
||||
.arg("-p")
|
||||
.arg("d1")
|
||||
.arg("-p")
|
||||
.arg("notAValidDep"),
|
||||
p.cargo("build -p d1 -p notAValidDep"),
|
||||
execs()
|
||||
.with_status(101)
|
||||
.with_stderr("[ERROR] package id specification `notAValidDep` matched no packages"),
|
||||
@ -3291,7 +3268,7 @@ fn manifest_with_bom_is_ok() {
|
||||
)
|
||||
.file("src/lib.rs", "")
|
||||
.build();
|
||||
assert_that(p.cargo("build").arg("-v"), execs());
|
||||
assert_that(p.cargo("build -v"), execs());
|
||||
}
|
||||
|
||||
#[test]
|
||||
@ -3312,7 +3289,7 @@ fn panic_abort_compiles_with_panic_abort() {
|
||||
.file("src/lib.rs", "")
|
||||
.build();
|
||||
assert_that(
|
||||
p.cargo("build").arg("-v"),
|
||||
p.cargo("build -v"),
|
||||
execs()
|
||||
.with_stderr_contains("[..] -C panic=abort [..]"),
|
||||
);
|
||||
@ -3325,14 +3302,14 @@ fn explicit_color_config_is_propagated_to_rustc() {
|
||||
.file("src/lib.rs", "")
|
||||
.build();
|
||||
assert_that(
|
||||
p.cargo("build").arg("-v").arg("--color").arg("always"),
|
||||
p.cargo("build -v --color always"),
|
||||
execs().with_stderr_contains("[..]rustc [..] src/lib.rs --color always[..]"),
|
||||
);
|
||||
|
||||
assert_that(p.cargo("clean"), execs());
|
||||
|
||||
assert_that(
|
||||
p.cargo("build").arg("-v").arg("--color").arg("never"),
|
||||
p.cargo("build -v --color never"),
|
||||
execs().with_stderr(
|
||||
"\
|
||||
[COMPILING] test v0.0.0 ([..])
|
||||
@ -3567,7 +3544,7 @@ fn wrong_message_format_option() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("build").arg("--message-format").arg("XML"),
|
||||
p.cargo("build --message-format XML"),
|
||||
execs().with_status(1).with_stderr_contains(
|
||||
"\
|
||||
error: 'XML' isn't a valid value for '--message-format <FMT>'
|
||||
@ -3585,12 +3562,7 @@ fn message_format_json_forward_stderr() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("rustc")
|
||||
.arg("--release")
|
||||
.arg("--bin")
|
||||
.arg("foo")
|
||||
.arg("--message-format")
|
||||
.arg("JSON"),
|
||||
p.cargo("rustc --release --bin foo --message-format JSON"),
|
||||
execs().with_json(
|
||||
r#"
|
||||
{
|
||||
@ -3671,7 +3643,7 @@ fn cargo_build_empty_target() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("build").arg("--target").arg(""),
|
||||
p.cargo("build --target").arg(""),
|
||||
execs()
|
||||
.with_status(101)
|
||||
.with_stderr_contains("[..] target was empty"),
|
||||
@ -3700,7 +3672,7 @@ fn build_all_workspace() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("build").arg("--all"),
|
||||
p.cargo("build --all"),
|
||||
execs().with_stderr(
|
||||
"[..] Compiling bar v0.1.0 ([..])\n\
|
||||
[..] Compiling foo v0.1.0 ([..])\n\
|
||||
@ -3731,7 +3703,7 @@ fn build_all_exclude() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("build").arg("--all").arg("--exclude").arg("baz"),
|
||||
p.cargo("build --all --exclude baz"),
|
||||
execs()
|
||||
.with_stderr_contains("[..]Compiling foo v0.1.0 [..]")
|
||||
.with_stderr_contains("[..]Compiling bar v0.1.0 [..]")
|
||||
@ -3769,7 +3741,7 @@ fn build_all_workspace_implicit_examples() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("build").arg("--all").arg("--examples"),
|
||||
p.cargo("build --all --examples"),
|
||||
execs().with_stderr(
|
||||
"[..] Compiling bar v0.1.0 ([..])\n\
|
||||
[..] Compiling foo v0.1.0 ([..])\n\
|
||||
@ -3804,7 +3776,7 @@ fn build_all_virtual_manifest() {
|
||||
|
||||
// The order in which bar and baz are built is not guaranteed
|
||||
assert_that(
|
||||
p.cargo("build").arg("--all"),
|
||||
p.cargo("build --all"),
|
||||
execs()
|
||||
.with_stderr_contains("[..] Compiling baz v0.1.0 ([..])")
|
||||
.with_stderr_contains("[..] Compiling bar v0.1.0 ([..])")
|
||||
@ -3863,7 +3835,7 @@ fn build_virtual_manifest_one_project() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("build").arg("-p").arg("bar"),
|
||||
p.cargo("build -p bar"),
|
||||
execs()
|
||||
.with_stderr_does_not_contain("[..]baz[..]")
|
||||
.with_stderr_contains("[..] Compiling bar v0.1.0 ([..])")
|
||||
@ -3900,7 +3872,7 @@ fn build_all_virtual_manifest_implicit_examples() {
|
||||
|
||||
// The order in which bar and baz are built is not guaranteed
|
||||
assert_that(
|
||||
p.cargo("build").arg("--all").arg("--examples"),
|
||||
p.cargo("build --all --examples"),
|
||||
execs()
|
||||
.with_stderr_contains("[..] Compiling baz v0.1.0 ([..])")
|
||||
.with_stderr_contains("[..] Compiling bar v0.1.0 ([..])")
|
||||
@ -3947,7 +3919,7 @@ fn build_all_member_dependency_same_name() {
|
||||
Package::new("a", "0.1.0").publish();
|
||||
|
||||
assert_that(
|
||||
p.cargo("build").arg("--all"),
|
||||
p.cargo("build --all"),
|
||||
execs().with_stderr(
|
||||
"[..] Updating registry `[..]`\n\
|
||||
[..] Downloading a v0.1.0 ([..])\n\
|
||||
@ -3980,7 +3952,7 @@ fn run_proper_binary() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("run").arg("--bin").arg("other"),
|
||||
p.cargo("run --bin other"),
|
||||
execs(),
|
||||
);
|
||||
}
|
||||
@ -3994,7 +3966,7 @@ fn run_proper_binary_main_rs() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("run").arg("--bin").arg("foo"),
|
||||
p.cargo("run --bin foo"),
|
||||
execs(),
|
||||
);
|
||||
}
|
||||
@ -4019,7 +3991,7 @@ fn run_proper_alias_binary_from_src() {
|
||||
.file("src/bar.rs", r#"fn main() { println!("bar"); }"#)
|
||||
.build();
|
||||
|
||||
assert_that(p.cargo("build").arg("--all"), execs());
|
||||
assert_that(p.cargo("build --all"), execs());
|
||||
assert_that(
|
||||
process(&p.bin("foo")),
|
||||
execs().with_stdout("foo\n"),
|
||||
@ -4049,7 +4021,7 @@ fn run_proper_alias_binary_main_rs() {
|
||||
.file("src/main.rs", r#"fn main() { println!("main"); }"#)
|
||||
.build();
|
||||
|
||||
assert_that(p.cargo("build").arg("--all"), execs());
|
||||
assert_that(p.cargo("build --all"), execs());
|
||||
assert_that(
|
||||
process(&p.bin("foo")),
|
||||
execs().with_stdout("main\n"),
|
||||
@ -4069,7 +4041,7 @@ fn run_proper_binary_main_rs_as_foo() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("run").arg("--bin").arg("foo"),
|
||||
p.cargo("run --bin foo"),
|
||||
execs(),
|
||||
);
|
||||
}
|
||||
@ -4087,8 +4059,7 @@ fn rustc_wrapper() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("build")
|
||||
.arg("-v")
|
||||
p.cargo("build -v")
|
||||
.env("RUSTC_WRAPPER", "/usr/bin/env"),
|
||||
execs().with_stderr_contains("[RUNNING] `/usr/bin/env rustc --crate-name foo [..]"),
|
||||
);
|
||||
@ -4203,7 +4174,7 @@ fn deterministic_cfg_flags() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("build").arg("-v"),
|
||||
p.cargo("build -v"),
|
||||
execs().with_stderr(
|
||||
"\
|
||||
[COMPILING] foo v0.1.0 [..]
|
||||
@ -4340,7 +4311,7 @@ fn inferred_tests() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("test").arg("--test=bar").arg("--test=baz"),
|
||||
p.cargo("test --test=bar --test=baz"),
|
||||
execs(),
|
||||
);
|
||||
}
|
||||
@ -4354,7 +4325,7 @@ fn inferred_benchmarks() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("bench").arg("--bench=bar").arg("--bench=baz"),
|
||||
p.cargo("bench --bench=bar --bench=baz"),
|
||||
execs(),
|
||||
);
|
||||
}
|
||||
@ -4381,7 +4352,7 @@ fn target_edition() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("build").arg("-v").masquerade_as_nightly_cargo(),
|
||||
p.cargo("build -v").masquerade_as_nightly_cargo(),
|
||||
execs()
|
||||
.with_stderr_contains("\
|
||||
[COMPILING] foo v0.0.1 ([..])
|
||||
@ -4411,7 +4382,7 @@ fn target_edition_override() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("build").arg("-v").masquerade_as_nightly_cargo(),
|
||||
p.cargo("build -v").masquerade_as_nightly_cargo(),
|
||||
execs().with_stderr_contains("\
|
||||
[COMPILING] foo v0.0.1 ([..])
|
||||
[RUNNING] `rustc [..]--edition=2015 [..]
|
||||
@ -4438,7 +4409,7 @@ fn target_edition_feature_gated() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("build").arg("-v").masquerade_as_nightly_cargo(),
|
||||
p.cargo("build -v").masquerade_as_nightly_cargo(),
|
||||
execs().with_status(101).with_stderr(
|
||||
"\
|
||||
error: failed to parse manifest at `[..]`
|
||||
@ -4464,7 +4435,7 @@ fn same_metadata_different_directory() {
|
||||
.file("src/foo.rs", &main_file(r#""i am foo""#, &[]))
|
||||
.build();
|
||||
let output = t!(String::from_utf8(
|
||||
t!(p.cargo("build").arg("-v").exec_with_output()).stderr,
|
||||
t!(p.cargo("build -v").exec_with_output()).stderr,
|
||||
));
|
||||
let metadata = output
|
||||
.split_whitespace()
|
||||
@ -4477,7 +4448,7 @@ fn same_metadata_different_directory() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("build").arg("-v"),
|
||||
p.cargo("build -v"),
|
||||
execs()
|
||||
.with_stderr_contains(format!("[..]{}[..]", metadata)),
|
||||
);
|
||||
@ -4536,10 +4507,7 @@ fn uplift_dsym_of_bin_on_mac() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("build")
|
||||
.arg("--bins")
|
||||
.arg("--examples")
|
||||
.arg("--tests"),
|
||||
p.cargo("build --bins --examples --tests"),
|
||||
execs(),
|
||||
);
|
||||
assert_that(&p.bin("foo.dSYM"), existing_dir());
|
||||
@ -4568,10 +4536,7 @@ fn uplift_pdb_of_bin_on_windows() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("build")
|
||||
.arg("--bins")
|
||||
.arg("--examples")
|
||||
.arg("--tests"),
|
||||
p.cargo("build --bins --examples --tests"),
|
||||
execs(),
|
||||
);
|
||||
assert_that(&p.target_debug_dir().join("foo.pdb"), existing_file());
|
||||
@ -4593,7 +4558,7 @@ fn build_filter_infer_profile() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("build").arg("-v"),
|
||||
p.cargo("build -v"),
|
||||
execs()
|
||||
.with_stderr_contains(
|
||||
"\
|
||||
@ -4609,7 +4574,7 @@ fn build_filter_infer_profile() {
|
||||
|
||||
p.root().join("target").rm_rf();
|
||||
assert_that(
|
||||
p.cargo("build").arg("-v").arg("--test=t1"),
|
||||
p.cargo("build -v --test=t1"),
|
||||
execs()
|
||||
.with_stderr_contains(
|
||||
"\
|
||||
@ -4628,7 +4593,7 @@ fn build_filter_infer_profile() {
|
||||
|
||||
p.root().join("target").rm_rf();
|
||||
assert_that(
|
||||
p.cargo("build").arg("-v").arg("--bench=b1"),
|
||||
p.cargo("build -v --bench=b1"),
|
||||
execs()
|
||||
.with_stderr_contains(
|
||||
"\
|
||||
@ -4654,7 +4619,7 @@ fn targets_selected_default() {
|
||||
.file("src/main.rs", "fn main() {}")
|
||||
.build();
|
||||
assert_that(
|
||||
p.cargo("build").arg("-v"),
|
||||
p.cargo("build -v"),
|
||||
execs()
|
||||
// bin
|
||||
.with_stderr_contains("\
|
||||
@ -4677,7 +4642,7 @@ fn targets_selected_all() {
|
||||
.file("src/main.rs", "fn main() {}")
|
||||
.build();
|
||||
assert_that(
|
||||
p.cargo("build").arg("-v").arg("--all-targets"),
|
||||
p.cargo("build -v --all-targets"),
|
||||
execs()
|
||||
// bin
|
||||
.with_stderr_contains("\
|
||||
@ -4700,7 +4665,7 @@ fn all_targets_no_lib() {
|
||||
.file("src/main.rs", "fn main() {}")
|
||||
.build();
|
||||
assert_that(
|
||||
p.cargo("build").arg("-v").arg("--all-targets"),
|
||||
p.cargo("build -v --all-targets"),
|
||||
execs()
|
||||
// bin
|
||||
.with_stderr_contains("\
|
||||
@ -4777,9 +4742,8 @@ fn avoid_dev_deps() {
|
||||
|
||||
assert_that(p.cargo("build"), execs().with_status(101));
|
||||
assert_that(
|
||||
p.cargo("build")
|
||||
.masquerade_as_nightly_cargo()
|
||||
.arg("-Zavoid-dev-deps"),
|
||||
p.cargo("build -Zavoid-dev-deps")
|
||||
.masquerade_as_nightly_cargo(),
|
||||
execs(),
|
||||
);
|
||||
}
|
||||
@ -4792,7 +4756,7 @@ fn invalid_jobs() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("build").arg("--jobs").arg("over9000"),
|
||||
p.cargo("build --jobs over9000"),
|
||||
execs()
|
||||
.with_status(1)
|
||||
.with_stderr("error: Invalid value: could not parse `over9000` as a number"),
|
||||
|
@ -84,7 +84,7 @@ fn http_auth_offered() {
|
||||
)
|
||||
.build();
|
||||
|
||||
assert_that(script.cargo("build").arg("-v"), execs());
|
||||
assert_that(script.cargo("build -v"), execs());
|
||||
let script = script.bin("script");
|
||||
|
||||
let config = paths::home().join(".gitconfig");
|
||||
@ -186,7 +186,7 @@ fn https_something_happens() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("build").arg("-v"),
|
||||
p.cargo("build -v"),
|
||||
execs()
|
||||
.with_status(101)
|
||||
.with_stderr_contains(&format!(
|
||||
@ -243,7 +243,7 @@ fn ssh_something_happens() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("build").arg("-v"),
|
||||
p.cargo("build -v"),
|
||||
execs()
|
||||
.with_status(101)
|
||||
.with_stderr_contains(&format!(
|
||||
|
@ -27,7 +27,7 @@ fn build_lib_only() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("build").arg("--lib").arg("-v"),
|
||||
p.cargo("build --lib -v"),
|
||||
execs()
|
||||
.with_stderr(verbose_output_for_lib(&p)),
|
||||
);
|
||||
@ -41,7 +41,7 @@ fn build_with_no_lib() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("build").arg("--lib"),
|
||||
p.cargo("build --lib"),
|
||||
execs()
|
||||
.with_status(101)
|
||||
.with_stderr("[ERROR] no library targets found in package `foo`"),
|
||||
|
@ -10,10 +10,8 @@ fn cargo_build_plan_simple() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("build")
|
||||
.masquerade_as_nightly_cargo()
|
||||
.arg("--build-plan")
|
||||
.arg("-Zunstable-options"),
|
||||
p.cargo("build --build-plan -Zunstable-options")
|
||||
.masquerade_as_nightly_cargo(),
|
||||
execs().with_json(
|
||||
r#"
|
||||
{
|
||||
@ -71,10 +69,8 @@ fn cargo_build_plan_single_dep() {
|
||||
.file("bar/src/lib.rs", "pub fn bar() {}")
|
||||
.build();
|
||||
assert_that(
|
||||
p.cargo("build")
|
||||
.masquerade_as_nightly_cargo()
|
||||
.arg("--build-plan")
|
||||
.arg("-Zunstable-options"),
|
||||
p.cargo("build --build-plan -Zunstable-options")
|
||||
.masquerade_as_nightly_cargo(),
|
||||
execs().with_json(
|
||||
r#"
|
||||
{
|
||||
@ -139,10 +135,8 @@ fn cargo_build_plan_build_script() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("build")
|
||||
.masquerade_as_nightly_cargo()
|
||||
.arg("--build-plan")
|
||||
.arg("-Zunstable-options"),
|
||||
p.cargo("build --build-plan -Zunstable-options")
|
||||
.masquerade_as_nightly_cargo(),
|
||||
execs().with_json(
|
||||
r#"
|
||||
{
|
||||
|
@ -30,7 +30,7 @@ fn custom_build_script_failed() {
|
||||
.file("build.rs", "fn main() { std::process::exit(101); }")
|
||||
.build();
|
||||
assert_that(
|
||||
p.cargo("build").arg("-v"),
|
||||
p.cargo("build -v"),
|
||||
execs().with_status(101).with_stderr(&format!(
|
||||
"\
|
||||
[COMPILING] foo v0.5.0 ({url})
|
||||
@ -129,7 +129,7 @@ fn custom_build_env_vars() {
|
||||
let p = p.file("bar/build.rs", &file_content).build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("build").arg("--features").arg("bar_feat"),
|
||||
p.cargo("build --features bar_feat"),
|
||||
execs(),
|
||||
);
|
||||
}
|
||||
@ -166,7 +166,7 @@ fn custom_build_env_var_rustc_linker() {
|
||||
// no crate type set => linker never called => build succeeds if and
|
||||
// only if build.rs succeeds, despite linker binary not existing.
|
||||
assert_that(
|
||||
p.cargo("build").arg("--target").arg(&target),
|
||||
p.cargo("build --target").arg(&target),
|
||||
execs(),
|
||||
);
|
||||
}
|
||||
@ -233,7 +233,7 @@ fn custom_build_script_rustc_flags() {
|
||||
.build();
|
||||
|
||||
// TODO: TEST FAILS BECAUSE OF WRONG STDOUT (but otherwise, the build works)
|
||||
assert_that(p.cargo("build").arg("--verbose"),
|
||||
assert_that(p.cargo("build --verbose"),
|
||||
execs().with_status(101)
|
||||
.with_stderr(&format!("\
|
||||
[COMPILING] bar v0.5.0 ({url})
|
||||
@ -451,7 +451,7 @@ fn overrides_and_links() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("build").arg("-v"),
|
||||
p.cargo("build -v"),
|
||||
execs().with_stderr(
|
||||
"\
|
||||
[..]
|
||||
@ -497,7 +497,7 @@ fn unused_overrides() {
|
||||
)
|
||||
.build();
|
||||
|
||||
assert_that(p.cargo("build").arg("-v"), execs());
|
||||
assert_that(p.cargo("build -v"), execs());
|
||||
}
|
||||
|
||||
#[test]
|
||||
@ -554,7 +554,7 @@ fn links_passes_env_vars() {
|
||||
)
|
||||
.build();
|
||||
|
||||
assert_that(p.cargo("build").arg("-v"), execs());
|
||||
assert_that(p.cargo("build -v"), execs());
|
||||
}
|
||||
|
||||
#[test]
|
||||
@ -574,14 +574,14 @@ fn only_rerun_build_script() {
|
||||
.file("build.rs", "fn main() {}")
|
||||
.build();
|
||||
|
||||
assert_that(p.cargo("build").arg("-v"), execs());
|
||||
assert_that(p.cargo("build -v"), execs());
|
||||
p.root().move_into_the_past();
|
||||
|
||||
File::create(&p.root().join("some-new-file")).unwrap();
|
||||
p.root().move_into_the_past();
|
||||
|
||||
assert_that(
|
||||
p.cargo("build").arg("-v"),
|
||||
p.cargo("build -v"),
|
||||
execs().with_stderr(
|
||||
"\
|
||||
[COMPILING] foo v0.5.0 (file://[..])
|
||||
@ -652,13 +652,13 @@ fn rebuild_continues_to_pass_env_vars() {
|
||||
)
|
||||
.build();
|
||||
|
||||
assert_that(p.cargo("build").arg("-v"), execs());
|
||||
assert_that(p.cargo("build -v"), execs());
|
||||
p.root().move_into_the_past();
|
||||
|
||||
File::create(&p.root().join("some-new-file")).unwrap();
|
||||
p.root().move_into_the_past();
|
||||
|
||||
assert_that(p.cargo("build").arg("-v"), execs());
|
||||
assert_that(p.cargo("build -v"), execs());
|
||||
}
|
||||
|
||||
#[test]
|
||||
@ -679,7 +679,7 @@ fn testing_and_such() {
|
||||
.build();
|
||||
|
||||
println!("build");
|
||||
assert_that(p.cargo("build").arg("-v"), execs());
|
||||
assert_that(p.cargo("build -v"), execs());
|
||||
p.root().move_into_the_past();
|
||||
|
||||
File::create(&p.root().join("src/lib.rs")).unwrap();
|
||||
@ -687,7 +687,7 @@ fn testing_and_such() {
|
||||
|
||||
println!("test");
|
||||
assert_that(
|
||||
p.cargo("test").arg("-vj1"),
|
||||
p.cargo("test -vj1"),
|
||||
execs()
|
||||
.with_stderr(
|
||||
"\
|
||||
@ -705,7 +705,7 @@ fn testing_and_such() {
|
||||
|
||||
println!("doc");
|
||||
assert_that(
|
||||
p.cargo("doc").arg("-v"),
|
||||
p.cargo("doc -v"),
|
||||
execs().with_stderr(
|
||||
"\
|
||||
[DOCUMENTING] foo v0.5.0 (file://[..])
|
||||
@ -790,7 +790,7 @@ fn propagation_of_l_flags() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("build").arg("-v").arg("-j1"),
|
||||
p.cargo("build -v -j1"),
|
||||
execs().with_stderr_contains(
|
||||
"\
|
||||
[RUNNING] `rustc --crate-name a [..] -L bar[..]-L foo[..]`
|
||||
@ -866,7 +866,7 @@ fn propagation_of_l_flags_new() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("build").arg("-v").arg("-j1"),
|
||||
p.cargo("build -v -j1"),
|
||||
execs().with_stderr_contains(
|
||||
"\
|
||||
[RUNNING] `rustc --crate-name a [..] -L bar[..]-L foo[..]`
|
||||
@ -906,7 +906,7 @@ fn build_deps_simple() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("build").arg("-v"),
|
||||
p.cargo("build -v"),
|
||||
execs().with_stderr(
|
||||
"\
|
||||
[COMPILING] a v0.5.0 (file://[..])
|
||||
@ -954,7 +954,7 @@ fn build_deps_not_for_normal() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("build").arg("-v").arg("--target").arg(&target),
|
||||
p.cargo("build -v --target").arg(&target),
|
||||
execs()
|
||||
.with_status(101)
|
||||
.with_stderr_contains("[..]can't find crate for `aaaaa`[..]")
|
||||
@ -1017,7 +1017,7 @@ fn build_cmd_with_a_build_cmd() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("build").arg("-v"),
|
||||
p.cargo("build -v"),
|
||||
execs().with_stderr(
|
||||
"\
|
||||
[COMPILING] b v0.5.0 (file://[..])
|
||||
@ -1077,7 +1077,7 @@ fn out_dir_is_preserved() {
|
||||
.build();
|
||||
|
||||
// Make the file
|
||||
assert_that(p.cargo("build").arg("-v"), execs());
|
||||
assert_that(p.cargo("build -v"), execs());
|
||||
p.root().move_into_the_past();
|
||||
|
||||
// Change to asserting that it's there
|
||||
@ -1095,14 +1095,14 @@ fn out_dir_is_preserved() {
|
||||
)
|
||||
.unwrap();
|
||||
p.root().move_into_the_past();
|
||||
assert_that(p.cargo("build").arg("-v"), execs());
|
||||
assert_that(p.cargo("build -v"), execs());
|
||||
|
||||
// Run a fresh build where file should be preserved
|
||||
assert_that(p.cargo("build").arg("-v"), execs());
|
||||
assert_that(p.cargo("build -v"), execs());
|
||||
|
||||
// One last time to make sure it's still there.
|
||||
File::create(&p.root().join("foo")).unwrap();
|
||||
assert_that(p.cargo("build").arg("-v"), execs());
|
||||
assert_that(p.cargo("build -v"), execs());
|
||||
}
|
||||
|
||||
#[test]
|
||||
@ -1130,7 +1130,7 @@ fn output_separate_lines() {
|
||||
)
|
||||
.build();
|
||||
assert_that(
|
||||
p.cargo("build").arg("-v"),
|
||||
p.cargo("build -v"),
|
||||
execs().with_status(101).with_stderr_contains(
|
||||
"\
|
||||
[COMPILING] foo v0.5.0 (file://[..])
|
||||
@ -1168,7 +1168,7 @@ fn output_separate_lines_new() {
|
||||
)
|
||||
.build();
|
||||
assert_that(
|
||||
p.cargo("build").arg("-v"),
|
||||
p.cargo("build -v"),
|
||||
execs().with_status(101).with_stderr_contains(
|
||||
"\
|
||||
[COMPILING] foo v0.5.0 (file://[..])
|
||||
@ -1264,7 +1264,7 @@ fn release_with_build_script() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("build").arg("-v").arg("--release"),
|
||||
p.cargo("build -v --release"),
|
||||
execs(),
|
||||
);
|
||||
}
|
||||
@ -1285,7 +1285,7 @@ fn build_script_only() {
|
||||
.file("build.rs", r#"fn main() {}"#)
|
||||
.build();
|
||||
assert_that(
|
||||
p.cargo("build").arg("-v"),
|
||||
p.cargo("build -v"),
|
||||
execs().with_status(101).with_stderr(
|
||||
"\
|
||||
[ERROR] failed to parse manifest at `[..]`
|
||||
@ -1344,7 +1344,7 @@ fn shared_dep_with_a_build_script() {
|
||||
)
|
||||
.file("b/src/lib.rs", "")
|
||||
.build();
|
||||
assert_that(p.cargo("build").arg("-v"), execs());
|
||||
assert_that(p.cargo("build -v"), execs());
|
||||
}
|
||||
|
||||
#[test]
|
||||
@ -1562,15 +1562,13 @@ fn build_script_with_dynamic_native_dependency() {
|
||||
|
||||
assert_that(
|
||||
build
|
||||
.cargo("build")
|
||||
.arg("-v")
|
||||
.cargo("build -v")
|
||||
.env("RUST_LOG", "cargo::ops::cargo_rustc"),
|
||||
execs(),
|
||||
);
|
||||
|
||||
assert_that(
|
||||
foo.cargo("build")
|
||||
.arg("-v")
|
||||
foo.cargo("build -v")
|
||||
.env("SRC", build.root())
|
||||
.env("RUST_LOG", "cargo::ops::cargo_rustc"),
|
||||
execs(),
|
||||
@ -1716,7 +1714,7 @@ fn cfg_feedback() {
|
||||
.file("src/main.rs", "#[cfg(foo)] fn main() {}")
|
||||
.file("build.rs", r#"fn main() { println!("cargo:rustc-cfg=foo"); }"#)
|
||||
.build();
|
||||
assert_that(p.cargo("build").arg("-v"), execs());
|
||||
assert_that(p.cargo("build -v"), execs());
|
||||
}
|
||||
|
||||
#[test]
|
||||
@ -1749,7 +1747,7 @@ fn cfg_override() {
|
||||
)
|
||||
.build();
|
||||
|
||||
assert_that(p.cargo("build").arg("-v"), execs());
|
||||
assert_that(p.cargo("build -v"), execs());
|
||||
}
|
||||
|
||||
#[test]
|
||||
@ -1791,7 +1789,7 @@ fn cfg_test() {
|
||||
.file("tests/test.rs", "#[cfg(foo)] #[test] fn test_bar() {}")
|
||||
.build();
|
||||
assert_that(
|
||||
p.cargo("test").arg("-v"),
|
||||
p.cargo("test -v"),
|
||||
execs()
|
||||
.with_stderr(format!(
|
||||
"\
|
||||
@ -1907,7 +1905,7 @@ fn cfg_override_test() {
|
||||
.file("tests/test.rs", "#[cfg(foo)] #[test] fn test_bar() {}")
|
||||
.build();
|
||||
assert_that(
|
||||
p.cargo("test").arg("-v"),
|
||||
p.cargo("test -v"),
|
||||
execs()
|
||||
.with_stderr(format!(
|
||||
"\
|
||||
@ -2009,9 +2007,9 @@ fn env_build() {
|
||||
)
|
||||
.file("build.rs", r#"fn main() { println!("cargo:rustc-env=FOO=foo"); }"#)
|
||||
.build();
|
||||
assert_that(p.cargo("build").arg("-v"), execs());
|
||||
assert_that(p.cargo("build -v"), execs());
|
||||
assert_that(
|
||||
p.cargo("run").arg("-v"),
|
||||
p.cargo("run -v"),
|
||||
execs().with_stdout("foo\n"),
|
||||
);
|
||||
}
|
||||
@ -2044,7 +2042,7 @@ fn env_test() {
|
||||
)
|
||||
.build();
|
||||
assert_that(
|
||||
p.cargo("test").arg("-v"),
|
||||
p.cargo("test -v"),
|
||||
execs()
|
||||
.with_stderr(format!(
|
||||
"\
|
||||
@ -2089,7 +2087,7 @@ fn env_doc() {
|
||||
.file("build.rs", r#"fn main() { println!("cargo:rustc-env=FOO=foo"); }"#,
|
||||
)
|
||||
.build();
|
||||
assert_that(p.cargo("doc").arg("-v"), execs());
|
||||
assert_that(p.cargo("doc -v"), execs());
|
||||
}
|
||||
|
||||
#[test]
|
||||
@ -2143,7 +2141,7 @@ fn flags_go_into_tests() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("test").arg("-v").arg("--test=foo"),
|
||||
p.cargo("test -v --test=foo"),
|
||||
execs()
|
||||
.with_stderr(
|
||||
"\
|
||||
@ -2163,7 +2161,7 @@ fn flags_go_into_tests() {
|
||||
);
|
||||
|
||||
assert_that(
|
||||
p.cargo("test").arg("-v").arg("-pb").arg("--lib"),
|
||||
p.cargo("test -v -pb --lib"),
|
||||
execs()
|
||||
.with_stderr(
|
||||
"\
|
||||
@ -2242,7 +2240,7 @@ fn diamond_passes_args_only_once() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("build").arg("-v"),
|
||||
p.cargo("build -v"),
|
||||
execs().with_stderr(
|
||||
"\
|
||||
[COMPILING] c v0.5.0 ([..]
|
||||
@ -2289,7 +2287,7 @@ fn adding_an_override_invalidates() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("build").arg("-v"),
|
||||
p.cargo("build -v"),
|
||||
execs().with_stderr(
|
||||
"\
|
||||
[COMPILING] foo v0.5.0 ([..]
|
||||
@ -2315,7 +2313,7 @@ fn adding_an_override_invalidates() {
|
||||
.unwrap();
|
||||
|
||||
assert_that(
|
||||
p.cargo("build").arg("-v"),
|
||||
p.cargo("build -v"),
|
||||
execs().with_stderr(
|
||||
"\
|
||||
[COMPILING] foo v0.5.0 ([..]
|
||||
@ -2356,7 +2354,7 @@ fn changing_an_override_invalidates() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("build").arg("-v"),
|
||||
p.cargo("build -v"),
|
||||
execs().with_stderr(
|
||||
"\
|
||||
[COMPILING] foo v0.5.0 ([..]
|
||||
@ -2380,7 +2378,7 @@ fn changing_an_override_invalidates() {
|
||||
.unwrap();
|
||||
|
||||
assert_that(
|
||||
p.cargo("build").arg("-v"),
|
||||
p.cargo("build -v"),
|
||||
execs().with_stderr(
|
||||
"\
|
||||
[COMPILING] foo v0.5.0 ([..]
|
||||
@ -2424,7 +2422,7 @@ fn fresh_builds_possible_with_link_libs() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("build").arg("-v"),
|
||||
p.cargo("build -v"),
|
||||
execs().with_stderr(
|
||||
"\
|
||||
[COMPILING] foo v0.5.0 ([..]
|
||||
@ -2435,8 +2433,7 @@ fn fresh_builds_possible_with_link_libs() {
|
||||
);
|
||||
|
||||
assert_that(
|
||||
p.cargo("build")
|
||||
.arg("-v")
|
||||
p.cargo("build -v")
|
||||
.env("RUST_LOG", "cargo::ops::cargo_rustc::fingerprint=info"),
|
||||
execs().with_stderr(
|
||||
"\
|
||||
@ -2482,7 +2479,7 @@ fn fresh_builds_possible_with_multiple_metadata_overrides() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("build").arg("-v"),
|
||||
p.cargo("build -v"),
|
||||
execs().with_stderr(
|
||||
"\
|
||||
[COMPILING] foo v0.5.0 ([..]
|
||||
@ -2493,8 +2490,7 @@ fn fresh_builds_possible_with_multiple_metadata_overrides() {
|
||||
);
|
||||
|
||||
assert_that(
|
||||
p.cargo("build")
|
||||
.arg("-v")
|
||||
p.cargo("build -v")
|
||||
.env("RUST_LOG", "cargo::ops::cargo_rustc::fingerprint=info"),
|
||||
execs().with_stderr(
|
||||
"\
|
||||
@ -2530,12 +2526,12 @@ fn rebuild_only_on_explicit_paths() {
|
||||
)
|
||||
.build();
|
||||
|
||||
assert_that(p.cargo("build").arg("-v"), execs());
|
||||
assert_that(p.cargo("build -v"), execs());
|
||||
|
||||
// files don't exist, so should always rerun if they don't exist
|
||||
println!("run without");
|
||||
assert_that(
|
||||
p.cargo("build").arg("-v"),
|
||||
p.cargo("build -v"),
|
||||
execs().with_stderr(
|
||||
"\
|
||||
[COMPILING] foo v0.5.0 ([..])
|
||||
@ -2553,7 +2549,7 @@ fn rebuild_only_on_explicit_paths() {
|
||||
// now the exist, so run once, catch the mtime, then shouldn't run again
|
||||
println!("run with");
|
||||
assert_that(
|
||||
p.cargo("build").arg("-v"),
|
||||
p.cargo("build -v"),
|
||||
execs().with_stderr(
|
||||
"\
|
||||
[COMPILING] foo v0.5.0 ([..])
|
||||
@ -2566,7 +2562,7 @@ fn rebuild_only_on_explicit_paths() {
|
||||
|
||||
println!("run with2");
|
||||
assert_that(
|
||||
p.cargo("build").arg("-v"),
|
||||
p.cargo("build -v"),
|
||||
execs().with_stderr(
|
||||
"\
|
||||
[FRESH] foo v0.5.0 ([..])
|
||||
@ -2581,7 +2577,7 @@ fn rebuild_only_on_explicit_paths() {
|
||||
println!("run baz");
|
||||
File::create(p.root().join("baz")).unwrap();
|
||||
assert_that(
|
||||
p.cargo("build").arg("-v"),
|
||||
p.cargo("build -v"),
|
||||
execs().with_stderr(
|
||||
"\
|
||||
[FRESH] foo v0.5.0 ([..])
|
||||
@ -2594,7 +2590,7 @@ fn rebuild_only_on_explicit_paths() {
|
||||
println!("run foo change");
|
||||
File::create(p.root().join("foo")).unwrap();
|
||||
assert_that(
|
||||
p.cargo("build").arg("-v"),
|
||||
p.cargo("build -v"),
|
||||
execs().with_stderr(
|
||||
"\
|
||||
[COMPILING] foo v0.5.0 ([..])
|
||||
@ -2609,7 +2605,7 @@ fn rebuild_only_on_explicit_paths() {
|
||||
println!("run foo delete");
|
||||
fs::remove_file(p.root().join("bar")).unwrap();
|
||||
assert_that(
|
||||
p.cargo("build").arg("-v"),
|
||||
p.cargo("build -v"),
|
||||
execs().with_stderr(
|
||||
"\
|
||||
[COMPILING] foo v0.5.0 ([..])
|
||||
@ -2659,7 +2655,7 @@ fn doctest_receives_build_link_args() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("test").arg("-v"),
|
||||
p.cargo("test -v"),
|
||||
execs().with_stderr_contains(
|
||||
"[RUNNING] `rustdoc --test [..] --crate-name foo [..]-L native=bar[..]`",
|
||||
),
|
||||
@ -2714,7 +2710,7 @@ fn please_respect_the_dag() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("build").arg("-v"),
|
||||
p.cargo("build -v"),
|
||||
execs()
|
||||
.with_stderr_contains("[RUNNING] `rustc [..] -L native=foo -L native=bar[..]`"),
|
||||
);
|
||||
@ -2754,7 +2750,7 @@ fn non_utf8_output() {
|
||||
.file("src/main.rs", "#[cfg(foo)] fn main() {}")
|
||||
.build();
|
||||
|
||||
assert_that(p.cargo("build").arg("-v"), execs());
|
||||
assert_that(p.cargo("build -v"), execs());
|
||||
}
|
||||
|
||||
#[test]
|
||||
@ -2794,7 +2790,7 @@ fn custom_target_dir() {
|
||||
.file("a/src/lib.rs", "")
|
||||
.build();
|
||||
|
||||
assert_that(p.cargo("build").arg("-v"), execs());
|
||||
assert_that(p.cargo("build -v"), execs());
|
||||
}
|
||||
|
||||
#[test]
|
||||
@ -2851,7 +2847,7 @@ fn panic_abort_with_build_scripts() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("build").arg("-v").arg("--release"),
|
||||
p.cargo("build -v --release"),
|
||||
execs(),
|
||||
);
|
||||
|
||||
@ -2889,7 +2885,7 @@ fn warnings_emitted() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("build").arg("-v"),
|
||||
p.cargo("build -v"),
|
||||
execs().with_stderr(
|
||||
"\
|
||||
[COMPILING] foo v0.5.0 ([..])
|
||||
@ -2946,7 +2942,7 @@ fn warnings_hidden_for_upstream() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("build").arg("-v"),
|
||||
p.cargo("build -v"),
|
||||
execs().with_stderr(
|
||||
"\
|
||||
[UPDATING] registry `[..]`
|
||||
@ -3005,7 +3001,7 @@ fn warnings_printed_on_vv() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("build").arg("-vv"),
|
||||
p.cargo("build -vv"),
|
||||
execs().with_stderr(
|
||||
"\
|
||||
[UPDATING] registry `[..]`
|
||||
@ -3052,7 +3048,7 @@ fn output_shows_on_vv() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("build").arg("-vv"),
|
||||
p.cargo("build -vv"),
|
||||
execs().with_stdout("stdout").with_stderr(
|
||||
"\
|
||||
[COMPILING] foo v0.5.0 ([..])
|
||||
@ -3104,7 +3100,7 @@ fn links_with_dots() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("build").arg("-v"),
|
||||
p.cargo("build -v"),
|
||||
execs()
|
||||
.with_stderr_contains("[RUNNING] `rustc --crate-name foo [..] [..] -L foo[..]`"),
|
||||
);
|
||||
@ -3220,15 +3216,15 @@ fn switch_features_rerun() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("run").arg("-v").arg("--features=foo"),
|
||||
p.cargo("run -v --features=foo"),
|
||||
execs().with_stdout("foo\n"),
|
||||
);
|
||||
assert_that(
|
||||
p.cargo("run").arg("-v"),
|
||||
p.cargo("run -v"),
|
||||
execs().with_stdout("bar\n"),
|
||||
);
|
||||
assert_that(
|
||||
p.cargo("run").arg("-v").arg("--features=foo"),
|
||||
p.cargo("run -v --features=foo"),
|
||||
execs().with_stdout("foo\n"),
|
||||
);
|
||||
}
|
||||
@ -3256,7 +3252,7 @@ fn assume_build_script_when_build_rs_present() {
|
||||
)
|
||||
.build();
|
||||
|
||||
assert_that(p.cargo("run").arg("-v"), execs());
|
||||
assert_that(p.cargo("run -v"), execs());
|
||||
}
|
||||
|
||||
#[test]
|
||||
@ -3292,7 +3288,7 @@ fn if_build_set_to_false_dont_treat_build_rs_as_build_script() {
|
||||
)
|
||||
.build();
|
||||
|
||||
assert_that(p.cargo("run").arg("-v"), execs());
|
||||
assert_that(p.cargo("run -v"), execs());
|
||||
}
|
||||
|
||||
#[test]
|
||||
@ -3405,7 +3401,7 @@ fn deterministic_rustc_dependency_flags() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("build").arg("-v"),
|
||||
p.cargo("build -v"),
|
||||
execs().with_stderr_contains(
|
||||
"\
|
||||
[RUNNING] `rustc --crate-name foo [..] -L native=test1 -L native=test2 \
|
||||
|
@ -16,7 +16,7 @@ fn alias_incorrect_config_type() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("b-cargo-test").arg("-v"),
|
||||
p.cargo("b-cargo-test -v"),
|
||||
execs().with_status(101).with_stderr_contains(
|
||||
"\
|
||||
[ERROR] invalid configuration for key `alias.b-cargo-test`
|
||||
@ -40,7 +40,7 @@ fn alias_default_config_overrides_config() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("b").arg("-v"),
|
||||
p.cargo("b -v"),
|
||||
execs()
|
||||
.with_stderr_contains("[COMPILING] foo v0.5.0 [..]"),
|
||||
);
|
||||
@ -111,7 +111,7 @@ fn alias_list_test() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("b-cargo-test").arg("-v"),
|
||||
p.cargo("b-cargo-test -v"),
|
||||
execs()
|
||||
.with_stderr_contains("[COMPILING] foo v0.5.0 [..]")
|
||||
.with_stderr_contains("[RUNNING] `rustc --crate-name [..]"),
|
||||
@ -133,7 +133,7 @@ fn alias_with_flags_config() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("b-cargo-test").arg("-v"),
|
||||
p.cargo("b-cargo-test -v"),
|
||||
execs()
|
||||
.with_stderr_contains("[COMPILING] foo v0.5.0 [..]")
|
||||
.with_stderr_contains("[RUNNING] `rustc --crate-name foo [..]"),
|
||||
|
@ -273,23 +273,22 @@ fn z_flags_rejected() {
|
||||
.file("src/lib.rs", "")
|
||||
.build();
|
||||
assert_that(
|
||||
p.cargo("build").arg("-Zprint-im-a-teapot"),
|
||||
p.cargo("build -Zprint-im-a-teapot"),
|
||||
execs()
|
||||
.with_status(101)
|
||||
.with_stderr("error: the `-Z` flag is only accepted on the nightly channel of Cargo"),
|
||||
);
|
||||
|
||||
assert_that(
|
||||
p.cargo("build").masquerade_as_nightly_cargo().arg("-Zarg"),
|
||||
p.cargo("build -Zarg").masquerade_as_nightly_cargo(),
|
||||
execs()
|
||||
.with_status(101)
|
||||
.with_stderr("error: unknown `-Z` flag specified: arg"),
|
||||
);
|
||||
|
||||
assert_that(
|
||||
p.cargo("build")
|
||||
.masquerade_as_nightly_cargo()
|
||||
.arg("-Zprint-im-a-teapot"),
|
||||
p.cargo("build -Zprint-im-a-teapot")
|
||||
.masquerade_as_nightly_cargo(),
|
||||
execs()
|
||||
.with_stdout("im-a-teapot = true\n")
|
||||
.with_stderr(
|
||||
@ -320,8 +319,7 @@ fn publish_allowed() {
|
||||
.file("src/lib.rs", "")
|
||||
.build();
|
||||
assert_that(
|
||||
p.cargo("publish")
|
||||
.arg("--index")
|
||||
p.cargo("publish --index")
|
||||
.arg(publish::registry().to_string())
|
||||
.masquerade_as_nightly_cargo(),
|
||||
execs(),
|
||||
|
@ -162,7 +162,7 @@ fn cfg_easy() {
|
||||
.file("b/Cargo.toml", &basic_manifest("b", "0.0.1"))
|
||||
.file("b/src/lib.rs", "")
|
||||
.build();
|
||||
assert_that(p.cargo("build").arg("-v"), execs());
|
||||
assert_that(p.cargo("build -v"), execs());
|
||||
}
|
||||
|
||||
#[test]
|
||||
@ -383,7 +383,7 @@ fn multiple_match_ok() {
|
||||
.file("b/Cargo.toml", &basic_manifest("b", "0.0.1"))
|
||||
.file("b/src/lib.rs", "")
|
||||
.build();
|
||||
assert_that(p.cargo("build").arg("-v"), execs());
|
||||
assert_that(p.cargo("build -v"), execs());
|
||||
}
|
||||
|
||||
#[test]
|
||||
@ -405,7 +405,7 @@ fn any_ok() {
|
||||
.file("b/Cargo.toml", &basic_manifest("b", "0.0.1"))
|
||||
.file("b/src/lib.rs", "")
|
||||
.build();
|
||||
assert_that(p.cargo("build").arg("-v"), execs());
|
||||
assert_that(p.cargo("build -v"), execs());
|
||||
}
|
||||
|
||||
// https://github.com/rust-lang/cargo/issues/5313
|
||||
|
@ -185,7 +185,7 @@ fn issue_3418() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
foo.cargo("check").arg("-v"),
|
||||
foo.cargo("check -v"),
|
||||
execs()
|
||||
.with_stderr_contains("[..] --emit=dep-info,metadata [..]"),
|
||||
);
|
||||
@ -317,11 +317,7 @@ fn rustc_check() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
foo.cargo("rustc")
|
||||
.arg("--profile")
|
||||
.arg("check")
|
||||
.arg("--")
|
||||
.arg("--emit=metadata"),
|
||||
foo.cargo("rustc --profile check -- --emit=metadata"),
|
||||
execs(),
|
||||
);
|
||||
}
|
||||
@ -349,11 +345,7 @@ fn rustc_check_err() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
foo.cargo("rustc")
|
||||
.arg("--profile")
|
||||
.arg("check")
|
||||
.arg("--")
|
||||
.arg("--emit=metadata"),
|
||||
foo.cargo("rustc --profile check -- --emit=metadata"),
|
||||
execs().with_status(101),
|
||||
);
|
||||
}
|
||||
@ -384,7 +376,7 @@ fn check_all() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("check").arg("--all").arg("-v"),
|
||||
p.cargo("check --all -v"),
|
||||
execs()
|
||||
.with_stderr_contains("[..] --crate-name foo src/lib.rs [..]")
|
||||
.with_stderr_contains("[..] --crate-name foo src/main.rs [..]")
|
||||
@ -410,7 +402,7 @@ fn check_virtual_all_implied() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("check").arg("-v"),
|
||||
p.cargo("check -v"),
|
||||
execs()
|
||||
.with_stderr_contains("[..] --crate-name bar bar/src/lib.rs [..]")
|
||||
.with_stderr_contains("[..] --crate-name baz baz/src/lib.rs [..]"),
|
||||
@ -428,7 +420,7 @@ fn targets_selected_default() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
foo.cargo("check").arg("-v"),
|
||||
foo.cargo("check -v"),
|
||||
execs()
|
||||
.with_stderr_contains("[..] --crate-name foo src/lib.rs [..]")
|
||||
.with_stderr_contains("[..] --crate-name foo src/main.rs [..]")
|
||||
@ -449,7 +441,7 @@ fn targets_selected_all() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
foo.cargo("check").arg("--all-targets").arg("-v"),
|
||||
foo.cargo("check --all-targets -v"),
|
||||
execs()
|
||||
.with_stderr_contains("[..] --crate-name foo src/lib.rs [..]")
|
||||
.with_stderr_contains("[..] --crate-name foo src/main.rs [..]")
|
||||
@ -478,7 +470,7 @@ fn check_unit_test_profile() {
|
||||
|
||||
assert_that(foo.cargo("check"), execs());
|
||||
assert_that(
|
||||
foo.cargo("check").arg("--profile").arg("test"),
|
||||
foo.cargo("check --profile test"),
|
||||
execs()
|
||||
.with_status(101)
|
||||
.with_stderr_contains("[..]badtext[..]"),
|
||||
@ -555,7 +547,7 @@ fn check_filters() {
|
||||
);
|
||||
p.root().join("target").rm_rf();
|
||||
assert_that(
|
||||
p.cargo("check").arg("--tests").arg("-v"),
|
||||
p.cargo("check --tests -v"),
|
||||
execs()
|
||||
.with_stderr_contains("[..] --crate-name foo src/lib.rs [..] --test [..]")
|
||||
.with_stderr_contains("[..] --crate-name foo src/lib.rs --crate-type lib [..]")
|
||||
@ -573,7 +565,7 @@ fn check_filters() {
|
||||
);
|
||||
p.root().join("target").rm_rf();
|
||||
assert_that(
|
||||
p.cargo("check").arg("--test").arg("t1").arg("-v"),
|
||||
p.cargo("check --test t1 -v"),
|
||||
execs()
|
||||
.with_stderr_contains("[..]unused_normal_lib[..]")
|
||||
.with_stderr_contains("[..]unused_unit_t1[..]")
|
||||
@ -587,7 +579,7 @@ fn check_filters() {
|
||||
);
|
||||
p.root().join("target").rm_rf();
|
||||
assert_that(
|
||||
p.cargo("check").arg("--all-targets").arg("-v"),
|
||||
p.cargo("check --all-targets -v"),
|
||||
execs()
|
||||
.with_stderr_contains("[..]unused_normal_lib[..]")
|
||||
.with_stderr_contains("[..]unused_normal_bin[..]")
|
||||
@ -624,7 +616,7 @@ fn check_artifacts() {
|
||||
);
|
||||
|
||||
p.root().join("target").rm_rf();
|
||||
assert_that(p.cargo("check").arg("--lib"), execs());
|
||||
assert_that(p.cargo("check --lib"), execs());
|
||||
assert_that(&p.root().join("target/debug/libfoo.rmeta"), existing_file());
|
||||
assert_that(
|
||||
&p.root().join("target/debug/libfoo.rlib"),
|
||||
@ -637,7 +629,7 @@ fn check_artifacts() {
|
||||
|
||||
p.root().join("target").rm_rf();
|
||||
assert_that(
|
||||
p.cargo("check").arg("--bin").arg("foo"),
|
||||
p.cargo("check --bin foo"),
|
||||
execs(),
|
||||
);
|
||||
if is_nightly() {
|
||||
@ -657,7 +649,7 @@ fn check_artifacts() {
|
||||
|
||||
p.root().join("target").rm_rf();
|
||||
assert_that(
|
||||
p.cargo("check").arg("--test").arg("t1"),
|
||||
p.cargo("check --test t1"),
|
||||
execs(),
|
||||
);
|
||||
assert_that(
|
||||
@ -681,7 +673,7 @@ fn check_artifacts() {
|
||||
|
||||
p.root().join("target").rm_rf();
|
||||
assert_that(
|
||||
p.cargo("check").arg("--example").arg("ex1"),
|
||||
p.cargo("check --example ex1"),
|
||||
execs(),
|
||||
);
|
||||
assert_that(
|
||||
@ -699,7 +691,7 @@ fn check_artifacts() {
|
||||
|
||||
p.root().join("target").rm_rf();
|
||||
assert_that(
|
||||
p.cargo("check").arg("--bench").arg("b1"),
|
||||
p.cargo("check --bench b1"),
|
||||
execs(),
|
||||
);
|
||||
assert_that(
|
||||
@ -780,7 +772,7 @@ fn proc_macro() {
|
||||
)
|
||||
.build();
|
||||
assert_that(
|
||||
p.cargo("check").arg("-v").env("RUST_LOG", "cargo=trace"),
|
||||
p.cargo("check -v").env("RUST_LOG", "cargo=trace"),
|
||||
execs(),
|
||||
);
|
||||
}
|
||||
|
@ -105,23 +105,23 @@ fn clean_release() {
|
||||
.file("a/src/lib.rs", "")
|
||||
.build();
|
||||
|
||||
assert_that(p.cargo("build").arg("--release"), execs());
|
||||
assert_that(p.cargo("build --release"), execs());
|
||||
|
||||
assert_that(
|
||||
p.cargo("clean").arg("-p").arg("foo"),
|
||||
p.cargo("clean -p foo"),
|
||||
execs(),
|
||||
);
|
||||
assert_that(
|
||||
p.cargo("build").arg("--release"),
|
||||
p.cargo("build --release"),
|
||||
execs().with_stdout(""),
|
||||
);
|
||||
|
||||
assert_that(
|
||||
p.cargo("clean").arg("-p").arg("foo").arg("--release"),
|
||||
p.cargo("clean -p foo --release"),
|
||||
execs(),
|
||||
);
|
||||
assert_that(
|
||||
p.cargo("build").arg("--release"),
|
||||
p.cargo("build --release"),
|
||||
execs().with_stderr(
|
||||
"\
|
||||
[COMPILING] foo v0.0.1 ([..])
|
||||
@ -157,7 +157,7 @@ fn clean_doc() {
|
||||
|
||||
assert_that(doc_path, existing_dir());
|
||||
|
||||
assert_that(p.cargo("clean").arg("--doc"), execs());
|
||||
assert_that(p.cargo("clean --doc"), execs());
|
||||
|
||||
assert_that(doc_path, is_not(existing_dir()));
|
||||
assert_that(p.build_dir(), existing_dir());
|
||||
@ -198,11 +198,11 @@ fn build_script() {
|
||||
|
||||
assert_that(p.cargo("build").env("FIRST", "1"), execs());
|
||||
assert_that(
|
||||
p.cargo("clean").arg("-p").arg("foo"),
|
||||
p.cargo("clean -p foo"),
|
||||
execs(),
|
||||
);
|
||||
assert_that(
|
||||
p.cargo("build").arg("-v"),
|
||||
p.cargo("build -v"),
|
||||
execs().with_stderr(
|
||||
"\
|
||||
[COMPILING] foo v0.0.1 ([..])
|
||||
@ -244,7 +244,7 @@ fn clean_git() {
|
||||
|
||||
assert_that(p.cargo("build"), execs());
|
||||
assert_that(
|
||||
p.cargo("clean").arg("-p").arg("dep"),
|
||||
p.cargo("clean -p dep"),
|
||||
execs().with_stdout(""),
|
||||
);
|
||||
assert_that(p.cargo("build"), execs());
|
||||
@ -272,7 +272,7 @@ fn registry() {
|
||||
|
||||
assert_that(p.cargo("build"), execs());
|
||||
assert_that(
|
||||
p.cargo("clean").arg("-p").arg("bar"),
|
||||
p.cargo("clean -p bar"),
|
||||
execs().with_stdout(""),
|
||||
);
|
||||
assert_that(p.cargo("build"), execs());
|
||||
@ -299,7 +299,7 @@ fn clean_verbose() {
|
||||
|
||||
assert_that(p.cargo("build"), execs());
|
||||
assert_that(
|
||||
p.cargo("clean").arg("-p").arg("bar").arg("--verbose"),
|
||||
p.cargo("clean -p bar --verbose"),
|
||||
execs().with_stderr(
|
||||
"\
|
||||
[REMOVING] [..]
|
||||
|
@ -246,12 +246,10 @@ fn git_same_repo_different_tags() {
|
||||
.file("b/src/main.rs", "extern crate dep; fn main() { dep::tag2(); }");
|
||||
let p = p.build();
|
||||
|
||||
let mut a = p.cargo("build")
|
||||
.arg("-v")
|
||||
let mut a = p.cargo("build -v")
|
||||
.cwd(p.root().join("a"))
|
||||
.build_command();
|
||||
let mut b = p.cargo("build")
|
||||
.arg("-v")
|
||||
let mut b = p.cargo("build -v")
|
||||
.cwd(p.root().join("b"))
|
||||
.build_command();
|
||||
|
||||
@ -445,7 +443,7 @@ fn debug_release_ok() {
|
||||
fs::remove_dir_all(p.root().join("target")).unwrap();
|
||||
|
||||
let mut a = p.cargo("build").build_command();
|
||||
let mut b = p.cargo("build").arg("--release").build_command();
|
||||
let mut b = p.cargo("build --release").build_command();
|
||||
a.stdout(Stdio::piped()).stderr(Stdio::piped());
|
||||
b.stdout(Stdio::piped()).stderr(Stdio::piped());
|
||||
let a = a.spawn().unwrap();
|
||||
|
@ -48,7 +48,7 @@ fn deleting_database_files() {
|
||||
println!("deleting {}", file.display());
|
||||
cargopaths::remove_file(&file).unwrap();
|
||||
assert_that(
|
||||
project.cargo("build").env("RUST_LOG", log).arg("-v"),
|
||||
project.cargo("build -v").env("RUST_LOG", log),
|
||||
execs(),
|
||||
);
|
||||
|
||||
@ -64,7 +64,7 @@ fn deleting_database_files() {
|
||||
.set_len(2)
|
||||
.unwrap();
|
||||
assert_that(
|
||||
project.cargo("build").env("RUST_LOG", log).arg("-v"),
|
||||
project.cargo("build -v").env("RUST_LOG", log),
|
||||
execs(),
|
||||
);
|
||||
}
|
||||
@ -130,7 +130,7 @@ fn deleting_checkout_files() {
|
||||
println!("deleting {}", file.display());
|
||||
cargopaths::remove_file(&file).unwrap();
|
||||
assert_that(
|
||||
project.cargo("build").env("RUST_LOG", log).arg("-v"),
|
||||
project.cargo("build -v").env("RUST_LOG", log),
|
||||
execs(),
|
||||
);
|
||||
|
||||
@ -146,7 +146,7 @@ fn deleting_checkout_files() {
|
||||
.set_len(2)
|
||||
.unwrap();
|
||||
assert_that(
|
||||
project.cargo("build").env("RUST_LOG", log).arg("-v"),
|
||||
project.cargo("build -v").env("RUST_LOG", log),
|
||||
execs(),
|
||||
);
|
||||
}
|
||||
|
@ -47,7 +47,7 @@ fn simple_cross() {
|
||||
|
||||
let target = cross_compile::alternate();
|
||||
assert_that(
|
||||
p.cargo("build").arg("--target").arg(&target).arg("-v"),
|
||||
p.cargo("build -v --target").arg(&target),
|
||||
execs(),
|
||||
);
|
||||
assert_that(&p.target_bin(&target, "foo"), existing_file());
|
||||
@ -111,7 +111,7 @@ fn simple_cross_config() {
|
||||
.build();
|
||||
|
||||
let target = cross_compile::alternate();
|
||||
assert_that(p.cargo("build").arg("-v"), execs());
|
||||
assert_that(p.cargo("build -v"), execs());
|
||||
assert_that(&p.target_bin(&target, "foo"), existing_file());
|
||||
|
||||
assert_that(
|
||||
@ -148,7 +148,7 @@ fn simple_deps() {
|
||||
|
||||
let target = cross_compile::alternate();
|
||||
assert_that(
|
||||
p.cargo("build").arg("--target").arg(&target),
|
||||
p.cargo("build --target").arg(&target),
|
||||
execs(),
|
||||
);
|
||||
assert_that(&p.target_bin(&target, "foo"), existing_file());
|
||||
@ -244,7 +244,7 @@ fn plugin_deps() {
|
||||
|
||||
let target = cross_compile::alternate();
|
||||
assert_that(
|
||||
foo.cargo("build").arg("--target").arg(&target),
|
||||
foo.cargo("build --target").arg(&target),
|
||||
execs(),
|
||||
);
|
||||
assert_that(&foo.target_bin(&target, "foo"), existing_file());
|
||||
@ -347,12 +347,12 @@ fn plugin_to_the_max() {
|
||||
|
||||
let target = cross_compile::alternate();
|
||||
assert_that(
|
||||
foo.cargo("build").arg("--target").arg(&target).arg("-v"),
|
||||
foo.cargo("build -v --target").arg(&target),
|
||||
execs(),
|
||||
);
|
||||
println!("second");
|
||||
assert_that(
|
||||
foo.cargo("build").arg("-v").arg("--target").arg(&target),
|
||||
foo.cargo("build -v --target").arg(&target),
|
||||
execs(),
|
||||
);
|
||||
assert_that(&foo.target_bin(&target, "foo"), existing_file());
|
||||
@ -398,7 +398,7 @@ fn linker_and_ar() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("build").arg("--target").arg(&target).arg("-v"),
|
||||
p.cargo("build -v --target").arg(&target),
|
||||
execs().with_status(101).with_stderr_contains(&format!(
|
||||
"\
|
||||
[COMPILING] foo v0.5.0 ({url})
|
||||
@ -503,7 +503,7 @@ fn plugin_with_extra_dylib_dep() {
|
||||
|
||||
let target = cross_compile::alternate();
|
||||
assert_that(
|
||||
foo.cargo("build").arg("--target").arg(&target),
|
||||
foo.cargo("build --target").arg(&target),
|
||||
execs(),
|
||||
);
|
||||
}
|
||||
@ -557,7 +557,7 @@ fn cross_tests() {
|
||||
|
||||
let target = cross_compile::alternate();
|
||||
assert_that(
|
||||
p.cargo("test").arg("--target").arg(&target),
|
||||
p.cargo("test --target").arg(&target),
|
||||
execs()
|
||||
.with_stderr(&format!(
|
||||
"\
|
||||
@ -610,7 +610,7 @@ fn no_cross_doctests() {
|
||||
println!("b");
|
||||
let target = cross_compile::host();
|
||||
assert_that(
|
||||
p.cargo("test").arg("--target").arg(&target),
|
||||
p.cargo("test --target").arg(&target),
|
||||
execs().with_stderr(&format!(
|
||||
"\
|
||||
[COMPILING] foo v0.0.1 ({foo})
|
||||
@ -626,7 +626,7 @@ fn no_cross_doctests() {
|
||||
println!("c");
|
||||
let target = cross_compile::alternate();
|
||||
assert_that(
|
||||
p.cargo("test").arg("--target").arg(&target),
|
||||
p.cargo("test --target").arg(&target),
|
||||
execs().with_stderr(&format!(
|
||||
"\
|
||||
[COMPILING] foo v0.0.1 ({foo})
|
||||
@ -662,7 +662,7 @@ fn simple_cargo_run() {
|
||||
|
||||
let target = cross_compile::alternate();
|
||||
assert_that(
|
||||
p.cargo("run").arg("--target").arg(&target),
|
||||
p.cargo("run --target").arg(&target),
|
||||
execs(),
|
||||
);
|
||||
}
|
||||
@ -715,7 +715,7 @@ fn cross_with_a_build_script() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("build").arg("--target").arg(&target).arg("-v"),
|
||||
p.cargo("build -v --target").arg(&target),
|
||||
execs().with_stderr(&format!(
|
||||
"\
|
||||
[COMPILING] foo v0.0.0 (file://[..])
|
||||
@ -814,7 +814,7 @@ fn build_script_needed_for_host_and_target() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("build").arg("--target").arg(&target).arg("-v"),
|
||||
p.cargo("build -v --target").arg(&target),
|
||||
execs()
|
||||
.with_stderr_contains(&format!(
|
||||
"[COMPILING] d1 v0.0.0 ({url}/d1)",
|
||||
@ -896,7 +896,7 @@ fn build_deps_for_the_right_arch() {
|
||||
|
||||
let target = cross_compile::alternate();
|
||||
assert_that(
|
||||
p.cargo("build").arg("--target").arg(&target).arg("-v"),
|
||||
p.cargo("build -v --target").arg(&target),
|
||||
execs(),
|
||||
);
|
||||
}
|
||||
@ -950,7 +950,7 @@ fn build_script_only_host() {
|
||||
|
||||
let target = cross_compile::alternate();
|
||||
assert_that(
|
||||
p.cargo("build").arg("--target").arg(&target).arg("-v"),
|
||||
p.cargo("build -v --target").arg(&target),
|
||||
execs(),
|
||||
);
|
||||
}
|
||||
@ -980,9 +980,7 @@ fn plugin_build_script_right_arch() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("build")
|
||||
.arg("-v")
|
||||
.arg("--target")
|
||||
p.cargo("build -v --target")
|
||||
.arg(cross_compile::alternate()),
|
||||
execs().with_stderr(
|
||||
"\
|
||||
@ -1048,7 +1046,7 @@ fn build_script_with_platform_specific_dependencies() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("build").arg("-v").arg("--target").arg(&target),
|
||||
p.cargo("build -v --target").arg(&target),
|
||||
execs().with_stderr(&format!(
|
||||
"\
|
||||
[COMPILING] d2 v0.0.0 ([..])
|
||||
@ -1115,7 +1113,7 @@ fn platform_specific_dependencies_do_not_leak() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("build").arg("-v").arg("--target").arg(&target),
|
||||
p.cargo("build -v --target").arg(&target),
|
||||
execs()
|
||||
.with_status(101)
|
||||
.with_stderr_contains("[..] can't find crate for `d2`[..]"),
|
||||
@ -1204,9 +1202,9 @@ fn platform_specific_variables_reflected_in_build_scripts() {
|
||||
.file("d2/src/lib.rs", "")
|
||||
.build();
|
||||
|
||||
assert_that(p.cargo("build").arg("-v"), execs());
|
||||
assert_that(p.cargo("build -v"), execs());
|
||||
assert_that(
|
||||
p.cargo("build").arg("-v").arg("--target").arg(&target),
|
||||
p.cargo("build -v --target").arg(&target),
|
||||
execs(),
|
||||
);
|
||||
}
|
||||
@ -1284,7 +1282,7 @@ fn cross_test_dylib() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("test").arg("--target").arg(&target),
|
||||
p.cargo("test --target").arg(&target),
|
||||
execs()
|
||||
.with_stderr(&format!(
|
||||
"\
|
||||
|
@ -43,7 +43,7 @@ fn simple_cross_package() {
|
||||
let target = cross_compile::alternate();
|
||||
|
||||
assert_that(
|
||||
p.cargo("package").arg("--target").arg(&target),
|
||||
p.cargo("package --target").arg(&target),
|
||||
execs().with_stderr(&format!(
|
||||
" Packaging foo v0.0.0 ({dir})
|
||||
Verifying foo v0.0.0 ({dir})
|
||||
@ -116,8 +116,7 @@ fn publish_with_target() {
|
||||
let target = cross_compile::alternate();
|
||||
|
||||
assert_that(
|
||||
p.cargo("publish")
|
||||
.arg("--index")
|
||||
p.cargo("publish --index")
|
||||
.arg(publish::registry().to_string())
|
||||
.arg("--target")
|
||||
.arg(&target),
|
||||
|
@ -47,19 +47,11 @@ fn custom_target_minimal() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("build")
|
||||
.arg("--lib")
|
||||
.arg("--target")
|
||||
.arg("custom-target.json")
|
||||
.arg("-v"),
|
||||
p.cargo("build --lib --target custom-target.json -v"),
|
||||
execs(),
|
||||
);
|
||||
assert_that(
|
||||
p.cargo("build")
|
||||
.arg("--lib")
|
||||
.arg("--target")
|
||||
.arg("src/../custom-target.json")
|
||||
.arg("-v"),
|
||||
p.cargo("build --lib --target src/../custom-target.json -v"),
|
||||
execs(),
|
||||
);
|
||||
}
|
||||
@ -141,11 +133,7 @@ fn custom_target_dependency() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("build")
|
||||
.arg("--lib")
|
||||
.arg("--target")
|
||||
.arg("custom-target.json")
|
||||
.arg("-v"),
|
||||
p.cargo("build --lib --target custom-target.json -v"),
|
||||
execs(),
|
||||
);
|
||||
}
|
||||
|
@ -37,7 +37,7 @@ fn build_dep_info_lib() {
|
||||
.file("examples/ex.rs", "")
|
||||
.build();
|
||||
|
||||
assert_that(p.cargo("build").arg("--example=ex"), execs());
|
||||
assert_that(p.cargo("build --example=ex"), execs());
|
||||
assert_that(
|
||||
&p.example_lib("ex", "lib").with_extension("d"),
|
||||
existing_file(),
|
||||
@ -64,7 +64,7 @@ fn build_dep_info_rlib() {
|
||||
.file("examples/ex.rs", "")
|
||||
.build();
|
||||
|
||||
assert_that(p.cargo("build").arg("--example=ex"), execs());
|
||||
assert_that(p.cargo("build --example=ex"), execs());
|
||||
assert_that(
|
||||
&p.example_lib("ex", "rlib").with_extension("d"),
|
||||
existing_file(),
|
||||
@ -91,7 +91,7 @@ fn build_dep_info_dylib() {
|
||||
.file("examples/ex.rs", "")
|
||||
.build();
|
||||
|
||||
assert_that(p.cargo("build").arg("--example=ex"), execs());
|
||||
assert_that(p.cargo("build --example=ex"), execs());
|
||||
assert_that(
|
||||
&p.example_lib("ex", "dylib").with_extension("d"),
|
||||
existing_file(),
|
||||
|
@ -168,7 +168,7 @@ fn doc_no_deps() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("doc").arg("--no-deps"),
|
||||
p.cargo("doc --no-deps"),
|
||||
execs().with_stderr(&format!(
|
||||
"\
|
||||
[CHECKING] bar v0.0.1 ({dir}/bar)
|
||||
@ -207,7 +207,7 @@ fn doc_only_bin() {
|
||||
.file("bar/src/lib.rs", "pub fn bar() {}")
|
||||
.build();
|
||||
|
||||
assert_that(p.cargo("doc").arg("-v"), execs());
|
||||
assert_that(p.cargo("doc -v"), execs());
|
||||
|
||||
assert_that(&p.root().join("target/doc"), existing_dir());
|
||||
assert_that(&p.root().join("target/doc/bar/index.html"), existing_file());
|
||||
@ -248,7 +248,7 @@ fn doc_multiple_targets_same_name_lib() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("doc").arg("--all"),
|
||||
p.cargo("doc --all"),
|
||||
execs()
|
||||
.with_status(101)
|
||||
.with_stderr_contains("[..] library `foo_lib` is specified [..]")
|
||||
@ -295,7 +295,7 @@ fn doc_multiple_targets_same_name() {
|
||||
let root = path2url(p.root());
|
||||
|
||||
assert_that(
|
||||
p.cargo("doc").arg("--all"),
|
||||
p.cargo("doc --all"),
|
||||
execs()
|
||||
.with_stderr_contains(&format!("[DOCUMENTING] foo v0.1.0 ({}/foo)", root))
|
||||
.with_stderr_contains(&format!("[DOCUMENTING] bar v0.1.0 ({}/bar)", root))
|
||||
@ -341,7 +341,7 @@ fn doc_multiple_targets_same_name_bin() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("doc").arg("--all"),
|
||||
p.cargo("doc --all"),
|
||||
execs()
|
||||
.with_status(101)
|
||||
.with_stderr_contains("[..] binary `foo_cli` is specified [..]")
|
||||
@ -385,7 +385,7 @@ fn doc_multiple_targets_same_name_undoced() {
|
||||
.file("bar/src/foo-cli.rs", "")
|
||||
.build();
|
||||
|
||||
assert_that(p.cargo("doc").arg("--all"), execs());
|
||||
assert_that(p.cargo("doc --all"), execs());
|
||||
}
|
||||
|
||||
#[test]
|
||||
@ -455,7 +455,7 @@ fn doc_lib_bin_same_name_documents_lib_when_requested() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("doc").arg("--lib"),
|
||||
p.cargo("doc --lib"),
|
||||
execs().with_stderr(&format!(
|
||||
"\
|
||||
[DOCUMENTING] foo v0.0.1 ({dir})
|
||||
@ -499,7 +499,7 @@ fn doc_lib_bin_same_name_documents_named_bin_when_requested() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("doc").arg("--bin").arg("foo"),
|
||||
p.cargo("doc --bin foo"),
|
||||
execs().with_stderr(&format!(
|
||||
"\
|
||||
[CHECKING] foo v0.0.1 ({dir})
|
||||
@ -544,7 +544,7 @@ fn doc_lib_bin_same_name_documents_bins_when_requested() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("doc").arg("--bins"),
|
||||
p.cargo("doc --bins"),
|
||||
execs().with_stderr(&format!(
|
||||
"\
|
||||
[CHECKING] foo v0.0.1 ({dir})
|
||||
@ -600,7 +600,7 @@ fn doc_dash_p() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("doc").arg("-p").arg("a"),
|
||||
p.cargo("doc -p a"),
|
||||
execs().with_stderr(
|
||||
"\
|
||||
[..] b v0.0.1 (file://[..])
|
||||
@ -643,7 +643,7 @@ fn doc_target() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("doc").arg("--target").arg(TARGET).arg("--verbose"),
|
||||
p.cargo("doc --verbose --target").arg(TARGET),
|
||||
execs(),
|
||||
);
|
||||
assert_that(
|
||||
@ -806,9 +806,9 @@ fn doc_release() {
|
||||
.file("src/lib.rs", "")
|
||||
.build();
|
||||
|
||||
assert_that(p.cargo("build").arg("--release"), execs());
|
||||
assert_that(p.cargo("build --release"), execs());
|
||||
assert_that(
|
||||
p.cargo("doc").arg("--release").arg("-v"),
|
||||
p.cargo("doc --release -v"),
|
||||
execs().with_stderr(
|
||||
"\
|
||||
[DOCUMENTING] foo v0.0.1 ([..])
|
||||
@ -845,12 +845,7 @@ fn doc_multiple_deps() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("doc")
|
||||
.arg("-p")
|
||||
.arg("bar")
|
||||
.arg("-p")
|
||||
.arg("baz")
|
||||
.arg("-v"),
|
||||
p.cargo("doc -p bar -p baz -v"),
|
||||
execs(),
|
||||
);
|
||||
|
||||
@ -901,7 +896,7 @@ fn features() {
|
||||
.file("bar/src/lib.rs", r#"#[cfg(feature = "bar")] pub fn bar() {}"#)
|
||||
.build();
|
||||
assert_that(
|
||||
p.cargo("doc").arg("--features").arg("foo"),
|
||||
p.cargo("doc --features foo"),
|
||||
execs(),
|
||||
);
|
||||
assert_that(&p.root().join("target/doc"), existing_dir());
|
||||
@ -957,7 +952,7 @@ fn document_only_lib() {
|
||||
"#,
|
||||
)
|
||||
.build();
|
||||
assert_that(p.cargo("doc").arg("--lib"), execs());
|
||||
assert_that(p.cargo("doc --lib"), execs());
|
||||
assert_that(&p.root().join("target/doc/foo/index.html"), existing_file());
|
||||
}
|
||||
|
||||
@ -982,9 +977,7 @@ fn plugins_no_use_target() {
|
||||
.file("src/lib.rs", "")
|
||||
.build();
|
||||
assert_that(
|
||||
p.cargo("doc")
|
||||
.arg("--target=x86_64-unknown-openbsd")
|
||||
.arg("-v"),
|
||||
p.cargo("doc --target=x86_64-unknown-openbsd -v"),
|
||||
execs(),
|
||||
);
|
||||
}
|
||||
@ -1012,7 +1005,7 @@ fn doc_all_workspace() {
|
||||
|
||||
// The order in which bar is compiled or documented is not deterministic
|
||||
assert_that(
|
||||
p.cargo("doc").arg("--all"),
|
||||
p.cargo("doc --all"),
|
||||
execs()
|
||||
.with_stderr_contains("[..] Documenting bar v0.1.0 ([..])")
|
||||
.with_stderr_contains("[..] Checking bar v0.1.0 ([..])")
|
||||
@ -1038,7 +1031,7 @@ fn doc_all_virtual_manifest() {
|
||||
|
||||
// The order in which bar and baz are documented is not guaranteed
|
||||
assert_that(
|
||||
p.cargo("doc").arg("--all"),
|
||||
p.cargo("doc --all"),
|
||||
execs()
|
||||
.with_stderr_contains("[..] Documenting baz v0.1.0 ([..])")
|
||||
.with_stderr_contains("[..] Documenting bar v0.1.0 ([..])"),
|
||||
@ -1101,7 +1094,7 @@ fn doc_all_member_dependency_same_name() {
|
||||
Package::new("bar", "0.1.0").publish();
|
||||
|
||||
assert_that(
|
||||
p.cargo("doc").arg("--all"),
|
||||
p.cargo("doc --all"),
|
||||
execs()
|
||||
.with_stderr_contains("[..] Updating registry `[..]`")
|
||||
.with_stderr_contains("[..] Documenting bar v0.1.0 ([..])"),
|
||||
@ -1126,7 +1119,7 @@ fn doc_workspace_open_help_message() {
|
||||
|
||||
// The order in which bar is compiled or documented is not deterministic
|
||||
assert_that(
|
||||
p.cargo("doc").arg("--all").arg("--open"),
|
||||
p.cargo("doc --all --open"),
|
||||
execs()
|
||||
.with_status(101)
|
||||
.with_stderr_contains("[..] Documenting bar v0.1.0 ([..])")
|
||||
@ -1353,7 +1346,7 @@ fn doc_private_items() {
|
||||
let foo = project()
|
||||
.file("src/lib.rs", "mod private { fn private_item() {} }")
|
||||
.build();
|
||||
assert_that(foo.cargo("doc").arg("--document-private-items"), execs());
|
||||
assert_that(foo.cargo("doc --document-private-items"), execs());
|
||||
|
||||
assert_that(&foo.root().join("target/doc"), existing_dir());
|
||||
assert_that(&foo.root().join("target/doc/foo/private/index.html"), existing_file());
|
||||
|
@ -146,7 +146,7 @@ failed to select a version for `bar` which could resolve this conflict",
|
||||
p.change_file("Cargo.toml", &basic_manifest("foo", "0.0.1"));
|
||||
|
||||
assert_that(
|
||||
p.cargo("build").arg("--features").arg("test"),
|
||||
p.cargo("build --features test"),
|
||||
execs()
|
||||
.with_status(101)
|
||||
.with_stderr("error: Package `foo v0.0.1 ([..])` does not have these features: `test`"),
|
||||
@ -204,7 +204,7 @@ fn invalid6() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("build").arg("--features").arg("foo"),
|
||||
p.cargo("build --features foo"),
|
||||
execs().with_status(101).with_stderr(
|
||||
"\
|
||||
[ERROR] failed to parse manifest at `[..]`
|
||||
@ -236,7 +236,7 @@ fn invalid7() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("build").arg("--features").arg("foo"),
|
||||
p.cargo("build --features foo"),
|
||||
execs().with_status(101).with_stderr(
|
||||
"\
|
||||
[ERROR] failed to parse manifest at `[..]`
|
||||
@ -270,7 +270,7 @@ fn invalid8() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("build").arg("--features").arg("foo"),
|
||||
p.cargo("build --features foo"),
|
||||
execs()
|
||||
.with_status(101)
|
||||
.with_stderr("[ERROR] feature names may not contain slashes: `foo/bar`"),
|
||||
@ -297,7 +297,7 @@ fn invalid9() {
|
||||
.file("bar/src/lib.rs", "")
|
||||
.build();
|
||||
|
||||
assert_that(p.cargo("build").arg("--features").arg("bar"),
|
||||
assert_that(p.cargo("build --features bar"),
|
||||
execs().with_stderr("\
|
||||
warning: Package `foo v0.0.1 ([..])` does not have feature `bar`. It has a required dependency with \
|
||||
that name, but only optional dependencies can be used as features. [..]
|
||||
@ -465,7 +465,7 @@ fn no_feature_doesnt_build() {
|
||||
);
|
||||
|
||||
assert_that(
|
||||
p.cargo("build").arg("--features").arg("bar"),
|
||||
p.cargo("build --features bar"),
|
||||
execs().with_stderr(format!(
|
||||
"\
|
||||
[COMPILING] bar v0.0.1 ({dir}/bar)
|
||||
@ -532,7 +532,7 @@ fn default_feature_pulled_in() {
|
||||
);
|
||||
|
||||
assert_that(
|
||||
p.cargo("build").arg("--no-default-features"),
|
||||
p.cargo("build --no-default-features"),
|
||||
execs().with_stderr(format!(
|
||||
"\
|
||||
[COMPILING] foo v0.0.1 ({dir})
|
||||
@ -692,7 +692,7 @@ fn many_cli_features() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("build").arg("--features").arg("bar baz"),
|
||||
p.cargo("build --features").arg("bar baz"),
|
||||
execs().with_stderr(format!(
|
||||
"\
|
||||
[COMPILING] ba[..] v0.0.1 ({dir}/ba[..])
|
||||
@ -838,7 +838,7 @@ fn many_features_no_rebuilds() {
|
||||
p.root().move_into_the_past();
|
||||
|
||||
assert_that(
|
||||
p.cargo("build").arg("-v"),
|
||||
p.cargo("build -v"),
|
||||
execs().with_stderr(
|
||||
"\
|
||||
[FRESH] a v0.1.0 ([..]/a)
|
||||
@ -857,7 +857,7 @@ fn empty_features() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("build").arg("--features").arg(""),
|
||||
p.cargo("build --features").arg(""),
|
||||
execs(),
|
||||
);
|
||||
}
|
||||
@ -898,7 +898,7 @@ fn transitive_features() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("build").arg("--features").arg("foo"),
|
||||
p.cargo("build --features foo"),
|
||||
execs(),
|
||||
);
|
||||
}
|
||||
@ -1150,7 +1150,7 @@ fn activating_feature_activates_dep() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("build").arg("--features").arg("a").arg("-v"),
|
||||
p.cargo("build --features a -v"),
|
||||
execs(),
|
||||
);
|
||||
}
|
||||
@ -1222,15 +1222,13 @@ fn dep_feature_in_cmd_line() {
|
||||
// We should be able to enable the feature "derived-feat", which enables "some-feat",
|
||||
// on the command line. The feature is enabled, thus building should be successful:
|
||||
assert_that(
|
||||
p.cargo("build")
|
||||
.arg("--features")
|
||||
.arg("derived/derived-feat"),
|
||||
p.cargo("build --features derived/derived-feat"),
|
||||
execs(),
|
||||
);
|
||||
|
||||
// Trying to enable features of transitive dependencies is an error
|
||||
assert_that(
|
||||
p.cargo("build").arg("--features").arg("bar/some-feat"),
|
||||
p.cargo("build --features bar/some-feat"),
|
||||
execs()
|
||||
.with_status(101)
|
||||
.with_stderr("error: Package `foo v0.0.1 ([..])` does not have these features: `bar`"),
|
||||
@ -1238,9 +1236,7 @@ fn dep_feature_in_cmd_line() {
|
||||
|
||||
// Hierarchical feature specification should still be disallowed
|
||||
assert_that(
|
||||
p.cargo("build")
|
||||
.arg("--features")
|
||||
.arg("derived/bar/some-feat"),
|
||||
p.cargo("build --features derived/bar/some-feat"),
|
||||
execs()
|
||||
.with_status(101)
|
||||
.with_stderr("[ERROR] feature names may not contain slashes: `bar/some-feat`"),
|
||||
@ -1290,7 +1286,7 @@ fn all_features_flag_enables_all_features() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("build").arg("--all-features"),
|
||||
p.cargo("build --all-features"),
|
||||
execs(),
|
||||
);
|
||||
}
|
||||
@ -1332,7 +1328,7 @@ fn many_cli_features_comma_delimited() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("build").arg("--features").arg("bar,baz"),
|
||||
p.cargo("build --features bar,baz"),
|
||||
execs().with_stderr(format!(
|
||||
"\
|
||||
[COMPILING] ba[..] v0.0.1 ({dir}/ba[..])
|
||||
@ -1398,7 +1394,7 @@ fn many_cli_features_comma_and_space_delimited() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("build").arg("--features").arg("bar,baz bam bap"),
|
||||
p.cargo("build --features").arg("bar,baz bam bap"),
|
||||
execs().with_stderr(format!(
|
||||
"\
|
||||
[COMPILING] ba[..] v0.0.1 ({dir}/ba[..])
|
||||
|
@ -104,14 +104,14 @@ fn fetch_platform_specific_dependencies() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("fetch").arg("--target").arg(&host),
|
||||
p.cargo("fetch --target").arg(&host),
|
||||
execs()
|
||||
.with_stderr_contains("[..] Downloading d1 v1.2.3 [..]")
|
||||
.with_stderr_does_not_contain("[..] Downloading d2 v0.1.2 [..]"),
|
||||
);
|
||||
|
||||
assert_that(
|
||||
p.cargo("fetch").arg("--target").arg(&target),
|
||||
p.cargo("fetch --target").arg(&target),
|
||||
execs()
|
||||
.with_stderr_contains("[..] Downloading d2 v0.1.2[..]")
|
||||
.with_stderr_does_not_contain("[..] Downloading d1 v1.2.3 [..]"),
|
||||
|
@ -141,7 +141,7 @@ fn rebuild_sub_package_then_while_package() {
|
||||
.write_all(br#"pub fn b() {}"#)
|
||||
.unwrap();
|
||||
|
||||
assert_that(p.cargo("build").arg("-pb"), execs());
|
||||
assert_that(p.cargo("build -pb"), execs());
|
||||
|
||||
File::create(&p.root().join("src/lib.rs"))
|
||||
.unwrap()
|
||||
@ -180,7 +180,7 @@ fn changing_lib_features_caches_targets() {
|
||||
);
|
||||
|
||||
assert_that(
|
||||
p.cargo("build").arg("--features").arg("foo"),
|
||||
p.cargo("build --features foo"),
|
||||
execs().with_stderr(
|
||||
"\
|
||||
[..]Compiling foo v0.0.1 ([..])
|
||||
@ -200,7 +200,7 @@ fn changing_lib_features_caches_targets() {
|
||||
assert_that(p.cargo("build"), execs().with_stdout(""));
|
||||
|
||||
assert_that(
|
||||
p.cargo("build").arg("--features").arg("foo"),
|
||||
p.cargo("build --features foo"),
|
||||
execs()
|
||||
.with_stderr("[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]"),
|
||||
);
|
||||
@ -255,7 +255,7 @@ fn changing_profiles_caches_targets() {
|
||||
);
|
||||
|
||||
assert_that(
|
||||
p.cargo("test").arg("foo"),
|
||||
p.cargo("test foo"),
|
||||
execs().with_stderr(
|
||||
"\
|
||||
[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]
|
||||
@ -364,7 +364,7 @@ fn changing_bin_paths_common_target_features_caches_targets() {
|
||||
),
|
||||
);
|
||||
assert_that(
|
||||
p.cargo("clean").arg("-p").arg("a").cwd(p.root().join("a")),
|
||||
p.cargo("clean -p a").cwd(p.root().join("a")),
|
||||
execs(),
|
||||
);
|
||||
assert_that(
|
||||
@ -391,7 +391,7 @@ fn changing_bin_paths_common_target_features_caches_targets() {
|
||||
),
|
||||
);
|
||||
assert_that(
|
||||
p.cargo("clean").arg("-p").arg("b").cwd(p.root().join("b")),
|
||||
p.cargo("clean -p b").cwd(p.root().join("b")),
|
||||
execs(),
|
||||
);
|
||||
assert_that(
|
||||
@ -408,7 +408,7 @@ fn changing_bin_paths_common_target_features_caches_targets() {
|
||||
/* Build a/ package again. If we cache different feature dep builds correctly,
|
||||
* this should not cause a rebuild of dep_crate */
|
||||
assert_that(
|
||||
p.cargo("clean").arg("-p").arg("a").cwd(p.root().join("a")),
|
||||
p.cargo("clean -p a").cwd(p.root().join("a")),
|
||||
execs(),
|
||||
);
|
||||
assert_that(
|
||||
@ -425,7 +425,7 @@ fn changing_bin_paths_common_target_features_caches_targets() {
|
||||
/* Build b/ package again. If we cache different feature dep builds correctly,
|
||||
* this should not cause a rebuild */
|
||||
assert_that(
|
||||
p.cargo("clean").arg("-p").arg("b").cwd(p.root().join("b")),
|
||||
p.cargo("clean -p b").cwd(p.root().join("b")),
|
||||
execs(),
|
||||
);
|
||||
assert_that(
|
||||
@ -492,7 +492,7 @@ fn changing_bin_features_caches_targets() {
|
||||
);
|
||||
|
||||
assert_that(
|
||||
p.cargo("build").arg("--features").arg("foo"),
|
||||
p.cargo("build --features foo"),
|
||||
execs().with_stderr(
|
||||
"\
|
||||
[COMPILING] foo v0.0.1 ([..])
|
||||
@ -521,7 +521,7 @@ fn changing_bin_features_caches_targets() {
|
||||
);
|
||||
|
||||
assert_that(
|
||||
p.cargo("build").arg("--features").arg("foo"),
|
||||
p.cargo("build --features foo"),
|
||||
execs().with_stderr(
|
||||
"\
|
||||
[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]
|
||||
@ -554,8 +554,8 @@ fn rebuild_tests_if_lib_changes() {
|
||||
sleep_ms(1000);
|
||||
File::create(&p.root().join("src/lib.rs")).unwrap();
|
||||
|
||||
assert_that(p.cargo("build").arg("-v"), execs());
|
||||
assert_that(p.cargo("test").arg("-v"), execs().with_status(101));
|
||||
assert_that(p.cargo("build -v"), execs());
|
||||
assert_that(p.cargo("test -v"), execs().with_status(101));
|
||||
}
|
||||
|
||||
#[test]
|
||||
@ -609,7 +609,7 @@ fn no_rebuild_transitive_target_deps() {
|
||||
|
||||
assert_that(p.cargo("build"), execs());
|
||||
assert_that(
|
||||
p.cargo("test").arg("--no-run"),
|
||||
p.cargo("test --no-run"),
|
||||
execs().with_stderr(
|
||||
"\
|
||||
[COMPILING] c v0.0.1 ([..])
|
||||
|
@ -92,9 +92,8 @@ fn no_index_update() {
|
||||
);
|
||||
|
||||
assert_that(
|
||||
p.cargo("generate-lockfile")
|
||||
.masquerade_as_nightly_cargo()
|
||||
.arg("-Zno-index-update"),
|
||||
p.cargo("generate-lockfile -Zno-index-update")
|
||||
.masquerade_as_nightly_cargo(),
|
||||
execs().with_stdout("").with_stderr(""),
|
||||
);
|
||||
}
|
||||
|
@ -94,7 +94,7 @@ fn cargo_compile_forbird_git_httpsrepo_offline() {
|
||||
.file("src/main.rs", "")
|
||||
.build();
|
||||
|
||||
assert_that(p.cargo("build").masquerade_as_nightly_cargo().arg("-Zoffline"),
|
||||
assert_that(p.cargo("build -Zoffline").masquerade_as_nightly_cargo(),
|
||||
execs().with_status(101).
|
||||
with_stderr("\
|
||||
error: failed to load source for a dependency on `dep1`
|
||||
@ -198,9 +198,8 @@ fn cargo_compile_offline_with_cached_git_dep() {
|
||||
|
||||
assert_that(
|
||||
p
|
||||
.cargo("build")
|
||||
.masquerade_as_nightly_cargo()
|
||||
.arg("-Zoffline"),
|
||||
.cargo("build -Zoffline")
|
||||
.masquerade_as_nightly_cargo(),
|
||||
execs().with_stderr(format!(
|
||||
"\
|
||||
[COMPILING] dep1 v0.5.0 ({}#[..])
|
||||
@ -236,9 +235,8 @@ fn cargo_compile_offline_with_cached_git_dep() {
|
||||
.unwrap();
|
||||
|
||||
let _out = p
|
||||
.cargo("build")
|
||||
.cargo("build -Zoffline")
|
||||
.masquerade_as_nightly_cargo()
|
||||
.arg("-Zoffline")
|
||||
.exec_with_output();
|
||||
assert_that(
|
||||
process(&p.bin("foo")),
|
||||
@ -718,7 +716,7 @@ fn two_revs_same_deps() {
|
||||
)
|
||||
.build();
|
||||
|
||||
assert_that(foo.cargo("build").arg("-v"), execs());
|
||||
assert_that(foo.cargo("build -v"), execs());
|
||||
assert_that(&foo.bin("foo"), existing_file());
|
||||
assert_that(foo.process(&foo.bin("foo")), execs());
|
||||
}
|
||||
@ -824,7 +822,7 @@ fn recompilation() {
|
||||
|
||||
// Make sure clean only cleans one dep
|
||||
assert_that(
|
||||
p.cargo("clean").arg("-p").arg("foo"),
|
||||
p.cargo("clean -p foo"),
|
||||
execs().with_stdout(""),
|
||||
);
|
||||
assert_that(
|
||||
@ -938,18 +936,14 @@ fn update_with_shared_deps() {
|
||||
// By default, not transitive updates
|
||||
println!("dep1 update");
|
||||
assert_that(
|
||||
p.cargo("update").arg("-p").arg("dep1"),
|
||||
p.cargo("update -p dep1"),
|
||||
execs().with_stdout(""),
|
||||
);
|
||||
|
||||
// Don't do anything bad on a weird --precise argument
|
||||
println!("bar bad precise update");
|
||||
assert_that(
|
||||
p.cargo("update")
|
||||
.arg("-p")
|
||||
.arg("bar")
|
||||
.arg("--precise")
|
||||
.arg("0.1.2"),
|
||||
p.cargo("update -p bar --precise 0.1.2"),
|
||||
execs().with_status(101).with_stderr(
|
||||
"\
|
||||
[UPDATING] git repository [..]
|
||||
@ -965,18 +959,14 @@ Caused by:
|
||||
// anything because we already have the rev in the db.
|
||||
println!("bar precise update");
|
||||
assert_that(
|
||||
p.cargo("update")
|
||||
.arg("-p")
|
||||
.arg("bar")
|
||||
.arg("--precise")
|
||||
.arg(&old_head.to_string()),
|
||||
p.cargo("update -p bar --precise").arg(&old_head.to_string()),
|
||||
execs().with_stdout(""),
|
||||
);
|
||||
|
||||
// Updating aggressively should, however, update the repo.
|
||||
println!("dep1 aggressive update");
|
||||
assert_that(
|
||||
p.cargo("update").arg("-p").arg("dep1").arg("--aggressive"),
|
||||
p.cargo("update -p dep1 --aggressive"),
|
||||
execs().with_stderr(&format!(
|
||||
"[UPDATING] git repository `{}`\n\
|
||||
[UPDATING] bar v0.5.0 ([..]) -> #[..]\n\
|
||||
@ -1003,7 +993,7 @@ Caused by:
|
||||
|
||||
// We should be able to update transitive deps
|
||||
assert_that(
|
||||
p.cargo("update").arg("-p").arg("bar"),
|
||||
p.cargo("update -p bar"),
|
||||
execs().with_stderr(&format!(
|
||||
"[UPDATING] git repository `{}`",
|
||||
git_project.url()
|
||||
@ -1191,7 +1181,7 @@ fn two_deps_only_update_one() {
|
||||
git::commit(&repo);
|
||||
|
||||
assert_that(
|
||||
p.cargo("update").arg("-p").arg("dep1"),
|
||||
p.cargo("update -p dep1"),
|
||||
execs().with_stderr(&format!(
|
||||
"[UPDATING] git repository `{}`\n\
|
||||
[UPDATING] dep1 v0.5.0 ([..]) -> #[..]\n\
|
||||
@ -1386,7 +1376,7 @@ fn dep_with_changed_submodule() {
|
||||
// Update the dependency and carry on!
|
||||
println!("update");
|
||||
assert_that(
|
||||
p.cargo("update").arg("-v"),
|
||||
p.cargo("update -v"),
|
||||
execs().with_stderr("").with_stderr(&format!(
|
||||
"[UPDATING] git repository `{}`\n\
|
||||
[UPDATING] dep1 v0.5.0 ([..]) -> #[..]\n\
|
||||
@ -1873,7 +1863,7 @@ fn update_ambiguous() {
|
||||
|
||||
assert_that(p.cargo("generate-lockfile"), execs());
|
||||
assert_that(
|
||||
p.cargo("update").arg("-p").arg("bar"),
|
||||
p.cargo("update -p bar"),
|
||||
execs().with_status(101).with_stderr(
|
||||
"\
|
||||
[ERROR] There are multiple `bar` packages in your project, and the specification `bar` \
|
||||
@ -1920,7 +1910,7 @@ fn update_one_dep_in_repo_with_many_deps() {
|
||||
|
||||
assert_that(p.cargo("generate-lockfile"), execs());
|
||||
assert_that(
|
||||
p.cargo("update").arg("-p").arg("bar"),
|
||||
p.cargo("update -p bar"),
|
||||
execs()
|
||||
.with_stderr(&format!("[UPDATING] git repository `{}`", bar.url())),
|
||||
);
|
||||
@ -2092,7 +2082,7 @@ fn update_one_source_updates_all_packages_in_that_git_source() {
|
||||
git::commit(&repo);
|
||||
|
||||
assert_that(
|
||||
p.cargo("update").arg("-p").arg("dep"),
|
||||
p.cargo("update -p dep"),
|
||||
execs(),
|
||||
);
|
||||
let mut lockfile = String::new();
|
||||
@ -2225,7 +2215,7 @@ fn dont_require_submodules_are_checked_out() {
|
||||
git2::Repository::clone(&url, &dst).unwrap();
|
||||
|
||||
assert_that(
|
||||
git1.cargo("build").arg("-v").cwd(&dst),
|
||||
git1.cargo("build -v").cwd(&dst),
|
||||
execs(),
|
||||
);
|
||||
}
|
||||
@ -2279,7 +2269,7 @@ fn doctest_same_name() {
|
||||
)
|
||||
.build();
|
||||
|
||||
assert_that(p.cargo("test").arg("-v"), execs());
|
||||
assert_that(p.cargo("test -v"), execs());
|
||||
}
|
||||
|
||||
#[test]
|
||||
@ -2464,7 +2454,7 @@ fn two_at_rev_instead_of_tag() {
|
||||
.build();
|
||||
|
||||
assert_that(p.cargo("generate-lockfile"), execs());
|
||||
assert_that(p.cargo("build").arg("-v"), execs());
|
||||
assert_that(p.cargo("build -v"), execs());
|
||||
}
|
||||
|
||||
#[test]
|
||||
@ -2530,7 +2520,7 @@ fn include_overrides_gitignore() {
|
||||
|
||||
println!("build 1: all is new");
|
||||
assert_that(
|
||||
p.cargo("build").arg("-v"),
|
||||
p.cargo("build -v"),
|
||||
execs().with_stderr(
|
||||
"\
|
||||
[UPDATING] registry `[..]`
|
||||
@ -2551,7 +2541,7 @@ fn include_overrides_gitignore() {
|
||||
|
||||
println!("build 2: nothing changed; file timestamps reset by build script");
|
||||
assert_that(
|
||||
p.cargo("build").arg("-v"),
|
||||
p.cargo("build -v"),
|
||||
execs().with_stderr(
|
||||
"\
|
||||
[FRESH] libc [..]
|
||||
@ -2567,7 +2557,7 @@ fn include_overrides_gitignore() {
|
||||
File::create(p.root().join("src").join("not_incl.rs")).unwrap();
|
||||
|
||||
assert_that(
|
||||
p.cargo("build").arg("-v"),
|
||||
p.cargo("build -v"),
|
||||
execs().with_stderr(
|
||||
"\
|
||||
[FRESH] libc [..]
|
||||
@ -2587,7 +2577,7 @@ fn include_overrides_gitignore() {
|
||||
File::create(p.root().join("src").join("incl.rs")).unwrap();
|
||||
|
||||
assert_that(
|
||||
p.cargo("build").arg("-v"),
|
||||
p.cargo("build -v"),
|
||||
execs().with_stderr(
|
||||
"\
|
||||
[FRESH] libc [..]
|
||||
|
@ -108,7 +108,7 @@ fn multiple_versions() {
|
||||
.publish();
|
||||
|
||||
assert_that(
|
||||
p.cargo("update").arg("-v"),
|
||||
p.cargo("update -v"),
|
||||
execs()
|
||||
.with_stderr("[UPDATING] bar v0.1.0 -> v0.2.0"),
|
||||
);
|
||||
|
@ -110,7 +110,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
.file("Cargo.lock", &old_lockfile)
|
||||
.build();
|
||||
|
||||
assert_that(p.cargo("build").arg("--locked"), execs());
|
||||
assert_that(p.cargo("build --locked"), execs());
|
||||
|
||||
let lock = p.read_lockfile();
|
||||
for (l, r) in old_lockfile.lines().zip(lock.lines()) {
|
||||
@ -489,7 +489,7 @@ fn locked_correct_error() {
|
||||
let p = p.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("build").arg("--locked"),
|
||||
p.cargo("build --locked"),
|
||||
execs().with_status(101).with_stderr(
|
||||
"\
|
||||
[UPDATING] registry `[..]`
|
||||
|
@ -81,7 +81,7 @@ fn cargo_metadata_warns_on_implicit_version() {
|
||||
execs().with_stderr("[WARNING] please specify `--format-version` flag explicitly to avoid compatibility problems"));
|
||||
|
||||
assert_that(
|
||||
p.cargo("metadata").arg("--format-version").arg("1"),
|
||||
p.cargo("metadata --format-version 1"),
|
||||
execs().with_stderr(""),
|
||||
);
|
||||
}
|
||||
@ -277,10 +277,7 @@ fn cargo_metadata_with_deps_and_version() {
|
||||
Package::new("bar", "0.0.1").dep("baz", "0.0.1").publish();
|
||||
|
||||
assert_that(
|
||||
p.cargo("metadata")
|
||||
.arg("-q")
|
||||
.arg("--format-version")
|
||||
.arg("1"),
|
||||
p.cargo("metadata -q --format-version 1"),
|
||||
execs().with_json(
|
||||
r#"
|
||||
{
|
||||
@ -738,7 +735,7 @@ fn workspace_metadata_no_deps() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("metadata").arg("--no-deps"),
|
||||
p.cargo("metadata --no-deps"),
|
||||
execs().with_json(
|
||||
r#"
|
||||
{
|
||||
@ -819,7 +816,7 @@ fn cargo_metadata_with_invalid_manifest() {
|
||||
let p = project().file("Cargo.toml", "").build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("metadata").arg("--format-version").arg("1"),
|
||||
p.cargo("metadata --format-version 1"),
|
||||
execs().with_status(101).with_stderr(
|
||||
"\
|
||||
[ERROR] failed to parse manifest at `[..]`
|
||||
@ -875,10 +872,7 @@ fn cargo_metadata_no_deps_path_to_cargo_toml_relative() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("metadata")
|
||||
.arg("--no-deps")
|
||||
.arg("--manifest-path")
|
||||
.arg("foo/Cargo.toml")
|
||||
p.cargo("metadata --no-deps --manifest-path foo/Cargo.toml")
|
||||
.cwd(p.root().parent().unwrap()),
|
||||
execs().with_json(MANIFEST_OUTPUT),
|
||||
);
|
||||
@ -892,9 +886,7 @@ fn cargo_metadata_no_deps_path_to_cargo_toml_absolute() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("metadata")
|
||||
.arg("--no-deps")
|
||||
.arg("--manifest-path")
|
||||
p.cargo("metadata --no-deps --manifest-path")
|
||||
.arg(p.root().join("Cargo.toml"))
|
||||
.cwd(p.root().parent().unwrap()),
|
||||
execs().with_json(MANIFEST_OUTPUT),
|
||||
@ -909,10 +901,7 @@ fn cargo_metadata_no_deps_path_to_cargo_toml_parent_relative() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("metadata")
|
||||
.arg("--no-deps")
|
||||
.arg("--manifest-path")
|
||||
.arg("foo")
|
||||
p.cargo("metadata --no-deps --manifest-path foo")
|
||||
.cwd(p.root().parent().unwrap()),
|
||||
execs().with_status(101).with_stderr(
|
||||
"[ERROR] the manifest-path must be \
|
||||
@ -929,9 +918,7 @@ fn cargo_metadata_no_deps_path_to_cargo_toml_parent_absolute() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("metadata")
|
||||
.arg("--no-deps")
|
||||
.arg("--manifest-path")
|
||||
p.cargo("metadata --no-deps --manifest-path")
|
||||
.arg(p.root())
|
||||
.cwd(p.root().parent().unwrap()),
|
||||
execs().with_status(101).with_stderr(
|
||||
@ -949,7 +936,7 @@ fn cargo_metadata_no_deps_cwd() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("metadata").arg("--no-deps").cwd(p.root()),
|
||||
p.cargo("metadata --no-deps").cwd(p.root()),
|
||||
execs().with_json(MANIFEST_OUTPUT),
|
||||
);
|
||||
}
|
||||
@ -962,10 +949,7 @@ fn cargo_metadata_bad_version() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("metadata")
|
||||
.arg("--no-deps")
|
||||
.arg("--format-version")
|
||||
.arg("2")
|
||||
p.cargo("metadata --no-deps --format-version 2")
|
||||
.cwd(p.root()),
|
||||
execs().with_status(1).with_stderr_contains(
|
||||
"\
|
||||
@ -996,7 +980,7 @@ fn multiple_features() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("metadata").arg("--features").arg("a b"),
|
||||
p.cargo("metadata --features").arg("a b"),
|
||||
execs(),
|
||||
);
|
||||
}
|
||||
@ -1024,7 +1008,7 @@ fn package_metadata() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("metadata").arg("--no-deps"),
|
||||
p.cargo("metadata --no-deps"),
|
||||
execs().with_json(
|
||||
r#"
|
||||
{
|
||||
@ -1087,16 +1071,14 @@ fn cargo_metadata_path_to_cargo_toml_project() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("package")
|
||||
.arg("--manifest-path")
|
||||
p.cargo("package --manifest-path")
|
||||
.arg(p.root().join("bar/Cargo.toml"))
|
||||
.cwd(p.root().parent().unwrap()),
|
||||
execs()
|
||||
);
|
||||
|
||||
assert_that(
|
||||
p.cargo("metadata")
|
||||
.arg("--manifest-path")
|
||||
p.cargo("metadata --manifest-path")
|
||||
.arg(p.root().join("target/package/bar-0.5.0/Cargo.toml")),
|
||||
execs().with_json(
|
||||
r#"
|
||||
|
@ -29,7 +29,7 @@ fn net_retry_loads_from_config() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("build").arg("-v"),
|
||||
p.cargo("build -v"),
|
||||
execs().with_status(101).with_stderr_contains(
|
||||
"[WARNING] spurious network error \
|
||||
(1 tries remaining): [..]",
|
||||
@ -63,7 +63,7 @@ fn net_retry_git_outputs_warning() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("build").arg("-v").arg("-j").arg("1"),
|
||||
p.cargo("build -v -j 1"),
|
||||
execs()
|
||||
.with_status(101)
|
||||
.with_stderr_contains(
|
||||
|
@ -425,8 +425,7 @@ fn override_adds_some_deps() {
|
||||
|
||||
Package::new("baz", "0.1.2").publish();
|
||||
assert_that(
|
||||
p.cargo("update")
|
||||
.arg("-p")
|
||||
p.cargo("update -p")
|
||||
.arg(&format!("{}#bar", foo.url())),
|
||||
execs().with_stderr(
|
||||
"\
|
||||
@ -436,9 +435,7 @@ fn override_adds_some_deps() {
|
||||
),
|
||||
);
|
||||
assert_that(
|
||||
p.cargo("update")
|
||||
.arg("-p")
|
||||
.arg("https://github.com/rust-lang/crates.io-index#bar"),
|
||||
p.cargo("update -p https://github.com/rust-lang/crates.io-index#bar"),
|
||||
execs().with_stderr(
|
||||
"\
|
||||
[UPDATING] registry `file://[..]`
|
||||
@ -708,7 +705,7 @@ fn test_override_dep() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("test").arg("-p").arg("bar"),
|
||||
p.cargo("test -p bar"),
|
||||
execs().with_status(101).with_stderr_contains(
|
||||
"\
|
||||
error: There are multiple `bar` packages in your project, and the [..]
|
||||
@ -807,7 +804,7 @@ fn no_override_self() {
|
||||
.file("src/lib.rs", "#![no_std] pub extern crate near;")
|
||||
.build();
|
||||
|
||||
assert_that(p.cargo("build").arg("--verbose"), execs());
|
||||
assert_that(p.cargo("build --verbose"), execs());
|
||||
}
|
||||
|
||||
#[test]
|
||||
@ -995,7 +992,7 @@ fn override_an_override() {
|
||||
.file("serde/src/lib.rs", "pub fn serde08_override() {}")
|
||||
.build();
|
||||
|
||||
assert_that(p.cargo("build").arg("-v"), execs());
|
||||
assert_that(p.cargo("build -v"), execs());
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
@ -46,7 +46,7 @@ See [..]
|
||||
existing_file(),
|
||||
);
|
||||
assert_that(
|
||||
p.cargo("package").arg("-l"),
|
||||
p.cargo("package -l"),
|
||||
execs().with_stdout(
|
||||
"\
|
||||
Cargo.toml
|
||||
@ -315,7 +315,7 @@ fn exclude() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("package").arg("--no-verify").arg("-v"),
|
||||
p.cargo("package --no-verify -v"),
|
||||
execs().with_stdout("").with_stderr(
|
||||
"\
|
||||
[WARNING] manifest has no description[..]
|
||||
@ -362,7 +362,7 @@ See [..]
|
||||
);
|
||||
|
||||
assert_that(
|
||||
p.cargo("package").arg("-l"),
|
||||
p.cargo("package -l"),
|
||||
execs().with_stdout(
|
||||
"\
|
||||
Cargo.toml
|
||||
@ -405,7 +405,7 @@ fn include() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("package").arg("--no-verify").arg("-v"),
|
||||
p.cargo("package --no-verify -v"),
|
||||
execs().with_stderr(
|
||||
"\
|
||||
[WARNING] manifest has no description[..]
|
||||
@ -427,7 +427,7 @@ fn package_lib_with_bin() {
|
||||
.file("src/lib.rs", "")
|
||||
.build();
|
||||
|
||||
assert_that(p.cargo("package").arg("-v"), execs());
|
||||
assert_that(p.cargo("package -v"), execs());
|
||||
}
|
||||
|
||||
#[test]
|
||||
@ -534,7 +534,7 @@ See http://doc.crates.io/manifest.html#package-metadata for more info.
|
||||
existing_file(),
|
||||
);
|
||||
assert_that(
|
||||
p.cargo("package").arg("-l"),
|
||||
p.cargo("package -l"),
|
||||
execs().with_stdout(
|
||||
"\
|
||||
Cargo.toml
|
||||
@ -663,7 +663,7 @@ fn broken_symlink() {
|
||||
t!(fs::symlink("nowhere", &p.root().join("src/foo.rs")));
|
||||
|
||||
assert_that(
|
||||
p.cargo("package").arg("-v"),
|
||||
p.cargo("package -v"),
|
||||
execs().with_status(101).with_stderr_contains(
|
||||
"\
|
||||
error: failed to prepare local package for uploading
|
||||
@ -769,9 +769,8 @@ fn generated_manifest() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("package")
|
||||
.masquerade_as_nightly_cargo()
|
||||
.arg("--no-verify"),
|
||||
p.cargo("package --no-verify")
|
||||
.masquerade_as_nightly_cargo(),
|
||||
execs(),
|
||||
);
|
||||
|
||||
@ -867,8 +866,7 @@ fn ignore_workspace_specifier() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("package")
|
||||
.arg("--no-verify")
|
||||
p.cargo("package --no-verify")
|
||||
.cwd(p.root().join("bar")),
|
||||
execs(),
|
||||
);
|
||||
@ -929,7 +927,7 @@ fn package_two_kinds_of_deps() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("package").arg("--no-verify"),
|
||||
p.cargo("package --no-verify"),
|
||||
execs(),
|
||||
);
|
||||
}
|
||||
@ -955,7 +953,7 @@ fn test_edition() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("build").arg("-v").masquerade_as_nightly_cargo(),
|
||||
p.cargo("build -v").masquerade_as_nightly_cargo(),
|
||||
execs()
|
||||
// --edition is still in flux and we're not passing -Zunstable-options
|
||||
// from Cargo so it will probably error. Only partially match the output
|
||||
@ -985,7 +983,7 @@ fn test_edition_missing() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("build").arg("-v").masquerade_as_nightly_cargo(),
|
||||
p.cargo("build -v").masquerade_as_nightly_cargo(),
|
||||
execs()
|
||||
// --edition is still in flux and we're not passing -Zunstable-options
|
||||
// from Cargo so it will probably error. Only partially match the output
|
||||
@ -1015,7 +1013,7 @@ fn test_edition_malformed() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("build").arg("-v").masquerade_as_nightly_cargo(),
|
||||
p.cargo("build -v").masquerade_as_nightly_cargo(),
|
||||
execs().with_status(101).with_stderr(
|
||||
"\
|
||||
error: failed to parse manifest at `[..]`
|
||||
@ -1047,7 +1045,7 @@ fn test_edition_nightly() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("build").arg("-v").masquerade_as_nightly_cargo(),
|
||||
p.cargo("build -v").masquerade_as_nightly_cargo(),
|
||||
execs().with_status(101).with_stderr(
|
||||
"\
|
||||
error: failed to parse manifest at `[..]`
|
||||
@ -1103,7 +1101,7 @@ See [..]
|
||||
existing_file(),
|
||||
);
|
||||
assert_that(
|
||||
p.cargo("package").arg("-l").masquerade_as_nightly_cargo(),
|
||||
p.cargo("package -l").masquerade_as_nightly_cargo(),
|
||||
execs().with_stdout(
|
||||
"\
|
||||
Cargo.lock
|
||||
@ -1161,7 +1159,7 @@ fn package_lockfile_git_repo() {
|
||||
.file("src/main.rs", "fn main() {}")
|
||||
.build();
|
||||
assert_that(
|
||||
p.cargo("package").arg("-l").masquerade_as_nightly_cargo(),
|
||||
p.cargo("package -l").masquerade_as_nightly_cargo(),
|
||||
execs().with_stdout(
|
||||
"\
|
||||
Cargo.lock
|
||||
|
@ -92,12 +92,12 @@ fn cargo_compile_with_nested_deps_shorthand() {
|
||||
|
||||
println!("cleaning");
|
||||
assert_that(
|
||||
p.cargo("clean").arg("-v"),
|
||||
p.cargo("clean -v"),
|
||||
execs().with_stdout(""),
|
||||
);
|
||||
println!("building baz");
|
||||
assert_that(
|
||||
p.cargo("build").arg("-p").arg("baz"),
|
||||
p.cargo("build -p baz"),
|
||||
execs().with_stderr(&format!(
|
||||
"[COMPILING] baz v0.5.0 ({}/bar/baz)\n\
|
||||
[FINISHED] dev [unoptimized + debuginfo] target(s) \
|
||||
@ -107,7 +107,7 @@ fn cargo_compile_with_nested_deps_shorthand() {
|
||||
);
|
||||
println!("building foo");
|
||||
assert_that(
|
||||
p.cargo("build").arg("-p").arg("foo"),
|
||||
p.cargo("build -p foo"),
|
||||
execs().with_stderr(&format!(
|
||||
"[COMPILING] bar v0.5.0 ({}/bar)\n\
|
||||
[COMPILING] foo v0.5.0 ({})\n\
|
||||
@ -603,7 +603,7 @@ fn override_relative() {
|
||||
)
|
||||
.file("src/lib.rs", "")
|
||||
.build();
|
||||
assert_that(p.cargo("build").arg("-v"), execs());
|
||||
assert_that(p.cargo("build -v"), execs());
|
||||
}
|
||||
|
||||
#[test]
|
||||
@ -690,7 +690,7 @@ fn override_path_dep() {
|
||||
.file("src/lib.rs", "")
|
||||
.build();
|
||||
|
||||
assert_that(p.cargo("build").arg("-v"), execs());
|
||||
assert_that(p.cargo("build -v"), execs());
|
||||
}
|
||||
|
||||
#[test]
|
||||
@ -881,8 +881,7 @@ fn custom_target_no_rebuild() {
|
||||
p.root().join("target_moved")
|
||||
));
|
||||
assert_that(
|
||||
p.cargo("build")
|
||||
.arg("--manifest-path=b/Cargo.toml")
|
||||
p.cargo("build --manifest-path=b/Cargo.toml")
|
||||
.env("CARGO_TARGET_DIR", "target_moved"),
|
||||
execs().with_stderr(
|
||||
"\
|
||||
@ -1082,7 +1081,7 @@ fn thin_lto_works() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("build").arg("--release").arg("-v"),
|
||||
p.cargo("build --release -v"),
|
||||
execs().with_stderr(
|
||||
"\
|
||||
[COMPILING] top [..]
|
||||
|
@ -216,7 +216,7 @@ fn plugin_with_dynamic_native_dependency() {
|
||||
.unwrap();
|
||||
|
||||
assert_that(
|
||||
foo.cargo("build").env("SRC", &lib).arg("-v"),
|
||||
foo.cargo("build -v").env("SRC", &lib),
|
||||
execs(),
|
||||
);
|
||||
}
|
||||
@ -244,7 +244,7 @@ fn plugin_integration() {
|
||||
.file("tests/it_works.rs", "")
|
||||
.build();
|
||||
|
||||
assert_that(p.cargo("test").arg("-v"), execs());
|
||||
assert_that(p.cargo("test -v"), execs());
|
||||
}
|
||||
|
||||
#[test]
|
||||
@ -279,7 +279,7 @@ fn doctest_a_plugin() {
|
||||
.file("bar/src/lib.rs", "pub fn bar() {}")
|
||||
.build();
|
||||
|
||||
assert_that(p.cargo("test").arg("-v"), execs());
|
||||
assert_that(p.cargo("test -v"), execs());
|
||||
}
|
||||
|
||||
// See #1515
|
||||
@ -331,7 +331,7 @@ fn native_plugin_dependency_with_custom_ar_linker() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
bar.cargo("build").arg("--verbose"),
|
||||
bar.cargo("build --verbose"),
|
||||
execs().with_status(101).with_stderr_contains(
|
||||
"\
|
||||
[COMPILING] foo v0.0.1 ([..])
|
||||
|
@ -25,7 +25,7 @@ fn profile_overrides() {
|
||||
.file("src/lib.rs", "")
|
||||
.build();
|
||||
assert_that(
|
||||
p.cargo("build").arg("-v"),
|
||||
p.cargo("build -v"),
|
||||
execs().with_stderr(&format!(
|
||||
"\
|
||||
[COMPILING] test v0.0.0 ({url})
|
||||
@ -64,7 +64,7 @@ fn opt_level_override_0() {
|
||||
.file("src/lib.rs", "")
|
||||
.build();
|
||||
assert_that(
|
||||
p.cargo("build").arg("-v"),
|
||||
p.cargo("build -v"),
|
||||
execs().with_stderr(&format!(
|
||||
"\
|
||||
[COMPILING] test v0.0.0 ({url})
|
||||
@ -100,7 +100,7 @@ fn debug_override_1() {
|
||||
.file("src/lib.rs", "")
|
||||
.build();
|
||||
assert_that(
|
||||
p.cargo("build").arg("-v"),
|
||||
p.cargo("build -v"),
|
||||
execs().with_stderr(&format!(
|
||||
"\
|
||||
[COMPILING] test v0.0.0 ({url})
|
||||
@ -139,7 +139,7 @@ fn check_opt_level_override(profile_level: &str, rustc_level: &str) {
|
||||
.file("src/lib.rs", "")
|
||||
.build();
|
||||
assert_that(
|
||||
p.cargo("build").arg("-v"),
|
||||
p.cargo("build -v"),
|
||||
execs().with_stderr(&format!(
|
||||
"\
|
||||
[COMPILING] test v0.0.0 ({url})
|
||||
@ -219,7 +219,7 @@ fn top_level_overrides_deps() {
|
||||
.file("foo/src/lib.rs", "")
|
||||
.build();
|
||||
assert_that(
|
||||
p.cargo("build").arg("-v").arg("--release"),
|
||||
p.cargo("build -v --release"),
|
||||
execs().with_stderr(&format!(
|
||||
"\
|
||||
[COMPILING] foo v0.0.0 ({url}/foo)
|
||||
@ -289,7 +289,7 @@ fn profile_in_non_root_manifest_triggers_a_warning() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("build").cwd(p.root().join("bar")).arg("-v"),
|
||||
p.cargo("build -v").cwd(p.root().join("bar")),
|
||||
execs().with_stderr(
|
||||
"\
|
||||
[WARNING] profiles for the non root package will be ignored, specify profiles at the workspace root:
|
||||
@ -331,7 +331,7 @@ fn profile_in_virtual_manifest_works() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("build").cwd(p.root().join("bar")).arg("-v"),
|
||||
p.cargo("build -v").cwd(p.root().join("bar")),
|
||||
execs().with_stderr(
|
||||
"\
|
||||
[COMPILING] bar v0.1.0 ([..])
|
||||
|
@ -30,9 +30,7 @@ fn simple() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("publish")
|
||||
.arg("--no-verify")
|
||||
.arg("--index")
|
||||
p.cargo("publish --no-verify --index")
|
||||
.arg(publish::registry().to_string()),
|
||||
execs().with_stderr(&format!(
|
||||
"\
|
||||
@ -106,9 +104,7 @@ fn old_token_location() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("publish")
|
||||
.arg("--no-verify")
|
||||
.arg("--index")
|
||||
p.cargo("publish --no-verify --index")
|
||||
.arg(publish::registry().to_string()),
|
||||
execs().with_stderr(&format!(
|
||||
"\
|
||||
@ -175,9 +171,7 @@ fn simple_with_host() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("publish")
|
||||
.arg("--no-verify")
|
||||
.arg("--host")
|
||||
p.cargo("publish --no-verify --host")
|
||||
.arg(publish::registry().to_string()),
|
||||
execs().with_stderr(&format!(
|
||||
"\
|
||||
@ -253,9 +247,7 @@ fn simple_with_index_and_host() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("publish")
|
||||
.arg("--no-verify")
|
||||
.arg("--index")
|
||||
p.cargo("publish --no-verify --index")
|
||||
.arg(publish::registry().to_string())
|
||||
.arg("--host")
|
||||
.arg(publish::registry().to_string()),
|
||||
@ -334,10 +326,7 @@ fn git_deps() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("publish")
|
||||
.arg("-v")
|
||||
.arg("--no-verify")
|
||||
.arg("--index")
|
||||
p.cargo("publish -v --no-verify --index")
|
||||
.arg(publish::registry().to_string()),
|
||||
execs().with_status(101).with_stderr(
|
||||
"\
|
||||
@ -377,8 +366,7 @@ fn path_dependency_no_version() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("publish")
|
||||
.arg("--index")
|
||||
p.cargo("publish --index")
|
||||
.arg(publish::registry().to_string()),
|
||||
execs().with_status(101).with_stderr(
|
||||
"\
|
||||
@ -411,8 +399,7 @@ fn unpublishable_crate() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("publish")
|
||||
.arg("--index")
|
||||
p.cargo("publish --index")
|
||||
.arg(publish::registry().to_string()),
|
||||
execs().with_status(101).with_stderr(
|
||||
"\
|
||||
@ -447,8 +434,7 @@ fn dont_publish_dirty() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("publish")
|
||||
.arg("--index")
|
||||
p.cargo("publish --index")
|
||||
.arg(publish::registry().to_string()),
|
||||
execs().with_status(101).with_stderr(
|
||||
"\
|
||||
@ -489,8 +475,7 @@ fn publish_clean() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("publish")
|
||||
.arg("--index")
|
||||
p.cargo("publish --index")
|
||||
.arg(publish::registry().to_string()),
|
||||
execs(),
|
||||
);
|
||||
@ -555,8 +540,7 @@ fn publish_when_ignored() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("publish")
|
||||
.arg("--index")
|
||||
p.cargo("publish --index")
|
||||
.arg(publish::registry().to_string()),
|
||||
execs(),
|
||||
);
|
||||
@ -617,8 +601,7 @@ fn new_crate_rejected() {
|
||||
)
|
||||
.nocommit_file("src/main.rs", "fn main() {}");
|
||||
assert_that(
|
||||
p.cargo("publish")
|
||||
.arg("--index")
|
||||
p.cargo("publish --index")
|
||||
.arg(publish::registry().to_string()),
|
||||
execs().with_status(101),
|
||||
);
|
||||
@ -644,9 +627,7 @@ fn dry_run() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("publish")
|
||||
.arg("--dry-run")
|
||||
.arg("--index")
|
||||
p.cargo("publish --dry-run --index")
|
||||
.arg(publish::registry().to_string()),
|
||||
execs().with_stderr(&format!(
|
||||
"\
|
||||
@ -691,11 +672,8 @@ fn block_publish_feature_not_enabled() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("publish")
|
||||
.masquerade_as_nightly_cargo()
|
||||
.arg("--registry")
|
||||
.arg("alternative")
|
||||
.arg("-Zunstable-options"),
|
||||
p.cargo("publish --registry alternative -Zunstable-options")
|
||||
.masquerade_as_nightly_cargo(),
|
||||
execs().with_status(101).with_stderr(
|
||||
"\
|
||||
error: failed to parse manifest at `[..]`
|
||||
@ -774,11 +752,8 @@ fn publish_empty_list() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("publish")
|
||||
.masquerade_as_nightly_cargo()
|
||||
.arg("--registry")
|
||||
.arg("alternative")
|
||||
.arg("-Zunstable-options"),
|
||||
p.cargo("publish --registry alternative -Zunstable-options")
|
||||
.masquerade_as_nightly_cargo(),
|
||||
execs().with_status(101).with_stderr(
|
||||
"\
|
||||
[ERROR] some crates cannot be published.
|
||||
@ -815,11 +790,8 @@ fn publish_allowed_registry() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("publish")
|
||||
.masquerade_as_nightly_cargo()
|
||||
.arg("--registry")
|
||||
.arg("alternative")
|
||||
.arg("-Zunstable-options"),
|
||||
p.cargo("publish --registry alternative -Zunstable-options")
|
||||
.masquerade_as_nightly_cargo(),
|
||||
execs(),
|
||||
);
|
||||
}
|
||||
@ -847,11 +819,8 @@ fn block_publish_no_registry() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("publish")
|
||||
.masquerade_as_nightly_cargo()
|
||||
.arg("--registry")
|
||||
.arg("alternative")
|
||||
.arg("-Zunstable-options"),
|
||||
p.cargo("publish --registry alternative -Zunstable-options")
|
||||
.masquerade_as_nightly_cargo(),
|
||||
execs().with_status(101).with_stderr(
|
||||
"\
|
||||
[ERROR] some crates cannot be published.
|
||||
|
@ -39,9 +39,7 @@ fn cargo_read_manifest_path_to_cargo_toml_relative() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("read-manifest")
|
||||
.arg("--manifest-path")
|
||||
.arg("foo/Cargo.toml")
|
||||
p.cargo("read-manifest --manifest-path foo/Cargo.toml")
|
||||
.cwd(p.root().parent().unwrap()),
|
||||
execs().with_json(MANIFEST_OUTPUT),
|
||||
);
|
||||
@ -55,8 +53,7 @@ fn cargo_read_manifest_path_to_cargo_toml_absolute() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("read-manifest")
|
||||
.arg("--manifest-path")
|
||||
p.cargo("read-manifest --manifest-path")
|
||||
.arg(p.root().join("Cargo.toml"))
|
||||
.cwd(p.root().parent().unwrap()),
|
||||
execs().with_json(MANIFEST_OUTPUT),
|
||||
@ -71,9 +68,7 @@ fn cargo_read_manifest_path_to_cargo_toml_parent_relative() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("read-manifest")
|
||||
.arg("--manifest-path")
|
||||
.arg("foo")
|
||||
p.cargo("read-manifest --manifest-path foo")
|
||||
.cwd(p.root().parent().unwrap()),
|
||||
execs().with_status(101).with_stderr(
|
||||
"[ERROR] the manifest-path must be \
|
||||
@ -90,8 +85,7 @@ fn cargo_read_manifest_path_to_cargo_toml_parent_absolute() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("read-manifest")
|
||||
.arg("--manifest-path")
|
||||
p.cargo("read-manifest --manifest-path")
|
||||
.arg(p.root())
|
||||
.cwd(p.root().parent().unwrap()),
|
||||
execs().with_status(101).with_stderr(
|
||||
|
@ -672,11 +672,7 @@ fn update_lockfile() {
|
||||
paths::home().join(".cargo/registry").rm_rf();
|
||||
println!("0.0.2 update");
|
||||
assert_that(
|
||||
p.cargo("update")
|
||||
.arg("-p")
|
||||
.arg("bar")
|
||||
.arg("--precise")
|
||||
.arg("0.0.2"),
|
||||
p.cargo("update -p bar --precise 0.0.2"),
|
||||
execs().with_stderr(
|
||||
"\
|
||||
[UPDATING] registry `[..]`
|
||||
@ -771,9 +767,8 @@ fn update_offline() {
|
||||
.file("src/main.rs", "fn main() {}")
|
||||
.build();
|
||||
assert_that(
|
||||
p.cargo("update")
|
||||
.masquerade_as_nightly_cargo()
|
||||
.arg("-Zoffline"),
|
||||
p.cargo("update -Zoffline")
|
||||
.masquerade_as_nightly_cargo(),
|
||||
execs()
|
||||
.with_status(101)
|
||||
.with_stderr("error: you can't update in the offline mode[..]"),
|
||||
@ -864,9 +859,7 @@ fn bad_license_file() {
|
||||
.file("src/main.rs", "fn main() {}")
|
||||
.build();
|
||||
assert_that(
|
||||
p.cargo("publish")
|
||||
.arg("-v")
|
||||
.arg("--index")
|
||||
p.cargo("publish -v --index")
|
||||
.arg(registry().to_string()),
|
||||
execs()
|
||||
.with_status(101)
|
||||
|
@ -350,7 +350,7 @@ fn can_run_doc_tests() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
foo.cargo("test").arg("-v").masquerade_as_nightly_cargo(),
|
||||
foo.cargo("test -v").masquerade_as_nightly_cargo(),
|
||||
execs().with_stderr_contains(format!(
|
||||
"\
|
||||
[DOCTEST] foo
|
||||
|
@ -43,17 +43,15 @@ fn build_bin_default_features() {
|
||||
assert_that(&p.bin("foo"), existing_file());
|
||||
|
||||
assert_that(
|
||||
p.cargo("build").arg("--no-default-features"),
|
||||
p.cargo("build --no-default-features"),
|
||||
execs(),
|
||||
);
|
||||
|
||||
assert_that(p.cargo("build").arg("--bin=foo"), execs());
|
||||
assert_that(p.cargo("build --bin=foo"), execs());
|
||||
assert_that(&p.bin("foo"), existing_file());
|
||||
|
||||
assert_that(
|
||||
p.cargo("build")
|
||||
.arg("--bin=foo")
|
||||
.arg("--no-default-features"),
|
||||
p.cargo("build --bin=foo --no-default-features"),
|
||||
execs().with_status(101).with_stderr(
|
||||
"\
|
||||
error: target `foo` in package `foo` requires the features: `a`
|
||||
@ -86,7 +84,7 @@ fn build_bin_arg_features() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("build").arg("--features").arg("a"),
|
||||
p.cargo("build --features a"),
|
||||
execs(),
|
||||
);
|
||||
assert_that(&p.bin("foo"), existing_file());
|
||||
@ -130,7 +128,7 @@ fn build_bin_multiple_required_features() {
|
||||
assert_that(&p.bin("foo_2"), existing_file());
|
||||
|
||||
assert_that(
|
||||
p.cargo("build").arg("--features").arg("c"),
|
||||
p.cargo("build --features c"),
|
||||
execs(),
|
||||
);
|
||||
|
||||
@ -138,7 +136,7 @@ fn build_bin_multiple_required_features() {
|
||||
assert_that(&p.bin("foo_2"), existing_file());
|
||||
|
||||
assert_that(
|
||||
p.cargo("build").arg("--no-default-features"),
|
||||
p.cargo("build --no-default-features"),
|
||||
execs(),
|
||||
);
|
||||
}
|
||||
@ -167,15 +165,13 @@ fn build_example_default_features() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("build").arg("--example=foo"),
|
||||
p.cargo("build --example=foo"),
|
||||
execs(),
|
||||
);
|
||||
assert_that(&p.bin("examples/foo"), existing_file());
|
||||
|
||||
assert_that(
|
||||
p.cargo("build")
|
||||
.arg("--example=foo")
|
||||
.arg("--no-default-features"),
|
||||
p.cargo("build --example=foo --no-default-features"),
|
||||
execs().with_status(101).with_stderr(
|
||||
"\
|
||||
error: target `foo` in package `foo` requires the features: `a`
|
||||
@ -208,10 +204,7 @@ fn build_example_arg_features() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("build")
|
||||
.arg("--example=foo")
|
||||
.arg("--features")
|
||||
.arg("a"),
|
||||
p.cargo("build --example=foo --features a"),
|
||||
execs(),
|
||||
);
|
||||
assert_that(&p.bin("examples/foo"), existing_file());
|
||||
@ -248,7 +241,7 @@ fn build_example_multiple_required_features() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("build").arg("--example=foo_1"),
|
||||
p.cargo("build --example=foo_1"),
|
||||
execs().with_status(101).with_stderr(
|
||||
"\
|
||||
error: target `foo_1` in package `foo` requires the features: `b`, `c`
|
||||
@ -257,7 +250,7 @@ Consider enabling them by passing e.g. `--features=\"b c\"`
|
||||
),
|
||||
);
|
||||
assert_that(
|
||||
p.cargo("build").arg("--example=foo_2"),
|
||||
p.cargo("build --example=foo_2"),
|
||||
execs(),
|
||||
);
|
||||
|
||||
@ -265,17 +258,11 @@ Consider enabling them by passing e.g. `--features=\"b c\"`
|
||||
assert_that(&p.bin("examples/foo_2"), existing_file());
|
||||
|
||||
assert_that(
|
||||
p.cargo("build")
|
||||
.arg("--example=foo_1")
|
||||
.arg("--features")
|
||||
.arg("c"),
|
||||
p.cargo("build --example=foo_1 --features c"),
|
||||
execs(),
|
||||
);
|
||||
assert_that(
|
||||
p.cargo("build")
|
||||
.arg("--example=foo_2")
|
||||
.arg("--features")
|
||||
.arg("c"),
|
||||
p.cargo("build --example=foo_2 --features c"),
|
||||
execs(),
|
||||
);
|
||||
|
||||
@ -283,9 +270,7 @@ Consider enabling them by passing e.g. `--features=\"b c\"`
|
||||
assert_that(&p.bin("examples/foo_2"), existing_file());
|
||||
|
||||
assert_that(
|
||||
p.cargo("build")
|
||||
.arg("--example=foo_1")
|
||||
.arg("--no-default-features"),
|
||||
p.cargo("build --example=foo_1 --no-default-features"),
|
||||
execs().with_status(101).with_stderr(
|
||||
"\
|
||||
error: target `foo_1` in package `foo` requires the features: `b`, `c`
|
||||
@ -294,9 +279,7 @@ Consider enabling them by passing e.g. `--features=\"b c\"`
|
||||
),
|
||||
);
|
||||
assert_that(
|
||||
p.cargo("build")
|
||||
.arg("--example=foo_2")
|
||||
.arg("--no-default-features"),
|
||||
p.cargo("build --example=foo_2 --no-default-features"),
|
||||
execs().with_status(101).with_stderr(
|
||||
"\
|
||||
error: target `foo_2` in package `foo` requires the features: `a`
|
||||
@ -343,7 +326,7 @@ fn test_default_features() {
|
||||
);
|
||||
|
||||
assert_that(
|
||||
p.cargo("test").arg("--no-default-features"),
|
||||
p.cargo("test --no-default-features"),
|
||||
execs()
|
||||
.with_stderr(
|
||||
"[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]"
|
||||
@ -352,7 +335,7 @@ fn test_default_features() {
|
||||
);
|
||||
|
||||
assert_that(
|
||||
p.cargo("test").arg("--test=foo"),
|
||||
p.cargo("test --test=foo"),
|
||||
execs()
|
||||
.with_stderr(
|
||||
"\
|
||||
@ -363,9 +346,7 @@ fn test_default_features() {
|
||||
);
|
||||
|
||||
assert_that(
|
||||
p.cargo("test")
|
||||
.arg("--test=foo")
|
||||
.arg("--no-default-features"),
|
||||
p.cargo("test --test=foo --no-default-features"),
|
||||
execs().with_status(101).with_stderr(
|
||||
"\
|
||||
error: target `foo` in package `foo` requires the features: `a`
|
||||
@ -398,7 +379,7 @@ fn test_arg_features() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("test").arg("--features").arg("a"),
|
||||
p.cargo("test --features a"),
|
||||
execs()
|
||||
.with_stderr(format!(
|
||||
"\
|
||||
@ -455,7 +436,7 @@ fn test_multiple_required_features() {
|
||||
);
|
||||
|
||||
assert_that(
|
||||
p.cargo("test").arg("--features").arg("c"),
|
||||
p.cargo("test --features c"),
|
||||
execs()
|
||||
.with_stderr(format!(
|
||||
"\
|
||||
@ -469,7 +450,7 @@ fn test_multiple_required_features() {
|
||||
);
|
||||
|
||||
assert_that(
|
||||
p.cargo("test").arg("--no-default-features"),
|
||||
p.cargo("test --no-default-features"),
|
||||
execs()
|
||||
.with_stderr(
|
||||
"[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]"
|
||||
@ -528,14 +509,14 @@ fn bench_default_features() {
|
||||
);
|
||||
|
||||
assert_that(
|
||||
p.cargo("bench").arg("--no-default-features"),
|
||||
p.cargo("bench --no-default-features"),
|
||||
execs()
|
||||
.with_stderr("[FINISHED] release [optimized] target(s) in [..]".to_string())
|
||||
.with_stdout(""),
|
||||
);
|
||||
|
||||
assert_that(
|
||||
p.cargo("bench").arg("--bench=foo"),
|
||||
p.cargo("bench --bench=foo"),
|
||||
execs()
|
||||
.with_stderr(
|
||||
"\
|
||||
@ -546,9 +527,7 @@ fn bench_default_features() {
|
||||
);
|
||||
|
||||
assert_that(
|
||||
p.cargo("bench")
|
||||
.arg("--bench=foo")
|
||||
.arg("--no-default-features"),
|
||||
p.cargo("bench --bench=foo --no-default-features"),
|
||||
execs().with_status(101).with_stderr(
|
||||
"\
|
||||
error: target `foo` in package `foo` requires the features: `a`
|
||||
@ -594,7 +573,7 @@ fn bench_arg_features() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("bench").arg("--features").arg("a"),
|
||||
p.cargo("bench --features a"),
|
||||
execs()
|
||||
.with_stderr(format!(
|
||||
"\
|
||||
@ -673,7 +652,7 @@ fn bench_multiple_required_features() {
|
||||
);
|
||||
|
||||
assert_that(
|
||||
p.cargo("bench").arg("--features").arg("c"),
|
||||
p.cargo("bench --features c"),
|
||||
execs()
|
||||
.with_stderr(format!(
|
||||
"\
|
||||
@ -687,7 +666,7 @@ fn bench_multiple_required_features() {
|
||||
);
|
||||
|
||||
assert_that(
|
||||
p.cargo("bench").arg("--no-default-features"),
|
||||
p.cargo("bench --no-default-features"),
|
||||
execs()
|
||||
.with_stderr("[FINISHED] release [optimized] target(s) in [..]")
|
||||
.with_stdout(""),
|
||||
@ -724,10 +703,10 @@ fn install_default_features() {
|
||||
|
||||
assert_that(p.cargo("install --path ."), execs());
|
||||
assert_that(cargo_home(), has_installed_exe("foo"));
|
||||
assert_that(p.cargo("uninstall").arg("foo"), execs());
|
||||
assert_that(p.cargo("uninstall foo"), execs());
|
||||
|
||||
assert_that(
|
||||
p.cargo("install --path .").arg("--no-default-features"),
|
||||
p.cargo("install --path . --no-default-features"),
|
||||
execs().with_status(101).with_stderr(
|
||||
"\
|
||||
[INSTALLING] foo v0.0.1 ([..])
|
||||
@ -739,16 +718,14 @@ fn install_default_features() {
|
||||
assert_that(cargo_home(), is_not(has_installed_exe("foo")));
|
||||
|
||||
assert_that(
|
||||
p.cargo("install --path .").arg("--bin=foo"),
|
||||
p.cargo("install --path . --bin=foo"),
|
||||
execs(),
|
||||
);
|
||||
assert_that(cargo_home(), has_installed_exe("foo"));
|
||||
assert_that(p.cargo("uninstall").arg("foo"), execs());
|
||||
assert_that(p.cargo("uninstall foo"), execs());
|
||||
|
||||
assert_that(
|
||||
p.cargo("install --path .")
|
||||
.arg("--bin=foo")
|
||||
.arg("--no-default-features"),
|
||||
p.cargo("install --path . --bin=foo --no-default-features"),
|
||||
execs().with_status(101).with_stderr(
|
||||
"\
|
||||
[INSTALLING] foo v0.0.1 ([..])
|
||||
@ -764,16 +741,14 @@ Consider enabling them by passing e.g. `--features=\"a\"`
|
||||
assert_that(cargo_home(), is_not(has_installed_exe("foo")));
|
||||
|
||||
assert_that(
|
||||
p.cargo("install --path .").arg("--example=foo"),
|
||||
p.cargo("install --path . --example=foo"),
|
||||
execs(),
|
||||
);
|
||||
assert_that(cargo_home(), has_installed_exe("foo"));
|
||||
assert_that(p.cargo("uninstall").arg("foo"), execs());
|
||||
assert_that(p.cargo("uninstall foo"), execs());
|
||||
|
||||
assert_that(
|
||||
p.cargo("install --path .")
|
||||
.arg("--example=foo")
|
||||
.arg("--no-default-features"),
|
||||
p.cargo("install --path . --example=foo --no-default-features"),
|
||||
execs().with_status(101).with_stderr(
|
||||
"\
|
||||
[INSTALLING] foo v0.0.1 ([..])
|
||||
@ -812,11 +787,11 @@ fn install_arg_features() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("install").arg("--features").arg("a"),
|
||||
p.cargo("install --features a"),
|
||||
execs(),
|
||||
);
|
||||
assert_that(cargo_home(), has_installed_exe("foo"));
|
||||
assert_that(p.cargo("uninstall").arg("foo"), execs());
|
||||
assert_that(p.cargo("uninstall foo"), execs());
|
||||
}
|
||||
|
||||
#[test]
|
||||
@ -854,18 +829,18 @@ fn install_multiple_required_features() {
|
||||
assert_that(p.cargo("install --path ."), execs());
|
||||
assert_that(cargo_home(), is_not(has_installed_exe("foo_1")));
|
||||
assert_that(cargo_home(), has_installed_exe("foo_2"));
|
||||
assert_that(p.cargo("uninstall").arg("foo"), execs());
|
||||
assert_that(p.cargo("uninstall foo"), execs());
|
||||
|
||||
assert_that(
|
||||
p.cargo("install --path .").arg("--features").arg("c"),
|
||||
p.cargo("install --path . --features c"),
|
||||
execs(),
|
||||
);
|
||||
assert_that(cargo_home(), has_installed_exe("foo_1"));
|
||||
assert_that(cargo_home(), has_installed_exe("foo_2"));
|
||||
assert_that(p.cargo("uninstall").arg("foo"), execs());
|
||||
assert_that(p.cargo("uninstall foo"), execs());
|
||||
|
||||
assert_that(
|
||||
p.cargo("install --path .").arg("--no-default-features"),
|
||||
p.cargo("install --path . --no-default-features"),
|
||||
execs().with_status(101).with_stderr(
|
||||
"\
|
||||
[INSTALLING] foo v0.0.1 ([..])
|
||||
@ -940,19 +915,19 @@ fn dep_feature_in_toml() {
|
||||
assert_that(p.cargo("build"), execs());
|
||||
|
||||
// bin
|
||||
assert_that(p.cargo("build").arg("--bin=foo"), execs());
|
||||
assert_that(p.cargo("build --bin=foo"), execs());
|
||||
assert_that(&p.bin("foo"), existing_file());
|
||||
|
||||
// example
|
||||
assert_that(
|
||||
p.cargo("build").arg("--example=foo"),
|
||||
p.cargo("build --example=foo"),
|
||||
execs(),
|
||||
);
|
||||
assert_that(&p.bin("examples/foo"), existing_file());
|
||||
|
||||
// test
|
||||
assert_that(
|
||||
p.cargo("test").arg("--test=foo"),
|
||||
p.cargo("test --test=foo"),
|
||||
execs()
|
||||
.with_stderr(format!(
|
||||
"\
|
||||
@ -967,7 +942,7 @@ fn dep_feature_in_toml() {
|
||||
// bench
|
||||
if is_nightly() {
|
||||
assert_that(
|
||||
p.cargo("bench").arg("--bench=foo"),
|
||||
p.cargo("bench --bench=foo"),
|
||||
execs()
|
||||
.with_stderr(format!(
|
||||
"\
|
||||
@ -984,7 +959,7 @@ fn dep_feature_in_toml() {
|
||||
// install
|
||||
assert_that(p.cargo("install"), execs());
|
||||
assert_that(cargo_home(), has_installed_exe("foo"));
|
||||
assert_that(p.cargo("uninstall").arg("foo"), execs());
|
||||
assert_that(p.cargo("uninstall foo"), execs());
|
||||
}
|
||||
|
||||
#[test]
|
||||
@ -1050,7 +1025,7 @@ fn dep_feature_in_cmd_line() {
|
||||
|
||||
// bin
|
||||
assert_that(
|
||||
p.cargo("build").arg("--bin=foo"),
|
||||
p.cargo("build --bin=foo"),
|
||||
execs().with_status(101).with_stderr(
|
||||
"\
|
||||
error: target `foo` in package `foo` requires the features: `bar/a`
|
||||
@ -1060,17 +1035,14 @@ Consider enabling them by passing e.g. `--features=\"bar/a\"`
|
||||
);
|
||||
|
||||
assert_that(
|
||||
p.cargo("build")
|
||||
.arg("--bin=foo")
|
||||
.arg("--features")
|
||||
.arg("bar/a"),
|
||||
p.cargo("build --bin=foo --features bar/a"),
|
||||
execs(),
|
||||
);
|
||||
assert_that(&p.bin("foo"), existing_file());
|
||||
|
||||
// example
|
||||
assert_that(
|
||||
p.cargo("build").arg("--example=foo"),
|
||||
p.cargo("build --example=foo"),
|
||||
execs().with_status(101).with_stderr(
|
||||
"\
|
||||
error: target `foo` in package `foo` requires the features: `bar/a`
|
||||
@ -1080,10 +1052,7 @@ Consider enabling them by passing e.g. `--features=\"bar/a\"`
|
||||
);
|
||||
|
||||
assert_that(
|
||||
p.cargo("build")
|
||||
.arg("--example=foo")
|
||||
.arg("--features")
|
||||
.arg("bar/a"),
|
||||
p.cargo("build --example=foo --features bar/a"),
|
||||
execs(),
|
||||
);
|
||||
assert_that(&p.bin("examples/foo"), existing_file());
|
||||
@ -1099,10 +1068,7 @@ Consider enabling them by passing e.g. `--features=\"bar/a\"`
|
||||
);
|
||||
|
||||
assert_that(
|
||||
p.cargo("test")
|
||||
.arg("--test=foo")
|
||||
.arg("--features")
|
||||
.arg("bar/a"),
|
||||
p.cargo("test --test=foo --features bar/a"),
|
||||
execs()
|
||||
.with_stderr(format!(
|
||||
"\
|
||||
@ -1124,10 +1090,7 @@ Consider enabling them by passing e.g. `--features=\"bar/a\"`
|
||||
);
|
||||
|
||||
assert_that(
|
||||
p.cargo("bench")
|
||||
.arg("--bench=foo")
|
||||
.arg("--features")
|
||||
.arg("bar/a"),
|
||||
p.cargo("bench --bench=foo --features bar/a"),
|
||||
execs()
|
||||
.with_stderr(format!(
|
||||
"\
|
||||
@ -1155,11 +1118,11 @@ Consider enabling them by passing e.g. `--features=\"bar/a\"`
|
||||
assert_that(cargo_home(), is_not(has_installed_exe("foo")));
|
||||
|
||||
assert_that(
|
||||
p.cargo("install").arg("--features").arg("bar/a"),
|
||||
p.cargo("install --features bar/a"),
|
||||
execs(),
|
||||
);
|
||||
assert_that(cargo_home(), has_installed_exe("foo"));
|
||||
assert_that(p.cargo("uninstall").arg("foo"), execs());
|
||||
assert_that(p.cargo("uninstall foo"), execs());
|
||||
}
|
||||
|
||||
#[test]
|
||||
@ -1201,11 +1164,7 @@ fn test_skips_compiling_bin_with_missing_required_features() {
|
||||
);
|
||||
|
||||
assert_that(
|
||||
p.cargo("test")
|
||||
.arg("--features")
|
||||
.arg("a")
|
||||
.arg("-j")
|
||||
.arg("1"),
|
||||
p.cargo("test --features a -j 1"),
|
||||
execs().with_status(101).with_stderr_contains(format!(
|
||||
"\
|
||||
[COMPILING] foo v0.0.1 ({})
|
||||
@ -1229,11 +1188,7 @@ error[E0463]: can't find crate for `bar`",
|
||||
);
|
||||
|
||||
assert_that(
|
||||
p.cargo("bench")
|
||||
.arg("--features")
|
||||
.arg("a")
|
||||
.arg("-j")
|
||||
.arg("1"),
|
||||
p.cargo("bench --features a -j 1"),
|
||||
execs().with_status(101).with_stderr_contains(format!(
|
||||
"\
|
||||
[COMPILING] foo v0.0.1 ({})
|
||||
@ -1279,7 +1234,7 @@ Consider enabling them by passing e.g. `--features=\"a\"`
|
||||
);
|
||||
|
||||
assert_that(
|
||||
p.cargo("run").arg("--features").arg("a"),
|
||||
p.cargo("run --features a"),
|
||||
execs(),
|
||||
);
|
||||
}
|
||||
|
@ -412,9 +412,8 @@ fn minimal_version_cli() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("generate-lockfile")
|
||||
.masquerade_as_nightly_cargo()
|
||||
.arg("-Zminimal-versions"),
|
||||
p.cargo("generate-lockfile -Zminimal-versions")
|
||||
.masquerade_as_nightly_cargo(),
|
||||
execs(),
|
||||
);
|
||||
|
||||
|
@ -48,7 +48,7 @@ fn simple_quiet_and_verbose() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("run").arg("-q").arg("-v"),
|
||||
p.cargo("run -q -v"),
|
||||
execs()
|
||||
.with_status(101)
|
||||
.with_stderr("[ERROR] cannot set both --verbose and --quiet"),
|
||||
@ -68,7 +68,7 @@ fn quiet_and_verbose_config() {
|
||||
.file("src/main.rs", r#"fn main() { println!("hello"); }"#)
|
||||
.build();
|
||||
|
||||
assert_that(p.cargo("run").arg("-q"), execs());
|
||||
assert_that(p.cargo("run -q"), execs());
|
||||
}
|
||||
|
||||
#[test]
|
||||
@ -86,7 +86,7 @@ fn simple_with_args() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("run").arg("hello").arg("world"),
|
||||
p.cargo("run hello world"),
|
||||
execs(),
|
||||
);
|
||||
}
|
||||
@ -133,7 +133,7 @@ fn exit_code_verbose() {
|
||||
}
|
||||
|
||||
assert_that(
|
||||
p.cargo("run").arg("-v"),
|
||||
p.cargo("run -v"),
|
||||
execs().with_status(2).with_stderr(output),
|
||||
);
|
||||
}
|
||||
@ -206,7 +206,7 @@ fn specify_name() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("run").arg("--bin").arg("a").arg("-v"),
|
||||
p.cargo("run --bin a -v"),
|
||||
execs()
|
||||
.with_stderr(&format!(
|
||||
"\
|
||||
@ -221,7 +221,7 @@ fn specify_name() {
|
||||
);
|
||||
|
||||
assert_that(
|
||||
p.cargo("run").arg("--bin").arg("b").arg("-v"),
|
||||
p.cargo("run --bin b -v"),
|
||||
execs()
|
||||
.with_stderr(
|
||||
"\
|
||||
@ -260,12 +260,12 @@ fn specify_default_run() {
|
||||
.with_stdout("hello A"),
|
||||
);
|
||||
assert_that(
|
||||
p.cargo("run").masquerade_as_nightly_cargo().arg("--bin").arg("a"),
|
||||
p.cargo("run --bin a").masquerade_as_nightly_cargo(),
|
||||
execs()
|
||||
.with_stdout("hello A"),
|
||||
);
|
||||
assert_that(
|
||||
p.cargo("run").masquerade_as_nightly_cargo().arg("--bin").arg("b"),
|
||||
p.cargo("run --bin b").masquerade_as_nightly_cargo(),
|
||||
execs()
|
||||
.with_stdout("hello B"),
|
||||
);
|
||||
@ -358,7 +358,7 @@ fn run_example() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("run").arg("--example").arg("a"),
|
||||
p.cargo("run --example a"),
|
||||
execs()
|
||||
.with_stderr(&format!(
|
||||
"\
|
||||
@ -391,7 +391,7 @@ fn run_library_example() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("run").arg("--example").arg("bar"),
|
||||
p.cargo("run --example bar"),
|
||||
execs()
|
||||
.with_status(101)
|
||||
.with_stderr("[ERROR] example target `bar` is a library and cannot be executed"),
|
||||
@ -446,9 +446,7 @@ fn run_example_autodiscover_2015() {
|
||||
|
||||
let p = autodiscover_examples_project("2015", None);
|
||||
assert_that(
|
||||
p.cargo("run")
|
||||
.arg("--example")
|
||||
.arg("a")
|
||||
p.cargo("run --example a")
|
||||
.masquerade_as_nightly_cargo(),
|
||||
execs().with_status(101).with_stderr(
|
||||
"warning: \
|
||||
@ -481,9 +479,7 @@ fn run_example_autodiscover_2015_with_autoexamples_enabled() {
|
||||
|
||||
let p = autodiscover_examples_project("2015", Some(true));
|
||||
assert_that(
|
||||
p.cargo("run")
|
||||
.arg("--example")
|
||||
.arg("a")
|
||||
p.cargo("run --example a")
|
||||
.masquerade_as_nightly_cargo(),
|
||||
execs()
|
||||
.with_stderr(&format!(
|
||||
@ -505,9 +501,7 @@ fn run_example_autodiscover_2015_with_autoexamples_disabled() {
|
||||
|
||||
let p = autodiscover_examples_project("2015", Some(false));
|
||||
assert_that(
|
||||
p.cargo("run")
|
||||
.arg("--example")
|
||||
.arg("a")
|
||||
p.cargo("run --example a")
|
||||
.masquerade_as_nightly_cargo(),
|
||||
execs()
|
||||
.with_status(101)
|
||||
@ -523,9 +517,7 @@ fn run_example_autodiscover_2018() {
|
||||
|
||||
let p = autodiscover_examples_project("2018", None);
|
||||
assert_that(
|
||||
p.cargo("run")
|
||||
.arg("--example")
|
||||
.arg("a")
|
||||
p.cargo("run --example a")
|
||||
.masquerade_as_nightly_cargo(),
|
||||
execs()
|
||||
.with_stderr(&format!(
|
||||
@ -548,7 +540,7 @@ fn run_bins() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("run").arg("--bins"),
|
||||
p.cargo("run --bins"),
|
||||
execs().with_status(1).with_stderr_contains(
|
||||
"error: Found argument '--bins' which wasn't expected, or isn't valid in this context",
|
||||
),
|
||||
@ -570,14 +562,14 @@ fn run_with_filename() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("run").arg("--bin").arg("bin.rs"),
|
||||
p.cargo("run --bin bin.rs"),
|
||||
execs()
|
||||
.with_status(101)
|
||||
.with_stderr("[ERROR] no bin target named `bin.rs`"),
|
||||
);
|
||||
|
||||
assert_that(
|
||||
p.cargo("run").arg("--bin").arg("a.rs"),
|
||||
p.cargo("run --bin a.rs"),
|
||||
execs().with_status(101).with_stderr(
|
||||
"\
|
||||
[ERROR] no bin target named `a.rs`
|
||||
@ -587,14 +579,14 @@ Did you mean `a`?",
|
||||
);
|
||||
|
||||
assert_that(
|
||||
p.cargo("run").arg("--example").arg("example.rs"),
|
||||
p.cargo("run --example example.rs"),
|
||||
execs()
|
||||
.with_status(101)
|
||||
.with_stderr("[ERROR] no example target named `example.rs`"),
|
||||
);
|
||||
|
||||
assert_that(
|
||||
p.cargo("run").arg("--example").arg("a.rs"),
|
||||
p.cargo("run --example a.rs"),
|
||||
execs().with_status(101).with_stderr(
|
||||
"\
|
||||
[ERROR] no example target named `a.rs`
|
||||
@ -612,11 +604,7 @@ fn either_name_or_example() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("run")
|
||||
.arg("--bin")
|
||||
.arg("a")
|
||||
.arg("--example")
|
||||
.arg("b"),
|
||||
p.cargo("run --bin a --example b"),
|
||||
execs().with_status(101).with_stderr(
|
||||
"[ERROR] `cargo run` can run at most one \
|
||||
executable, but multiple were \
|
||||
@ -695,11 +683,7 @@ fn example_with_release_flag() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("run")
|
||||
.arg("-v")
|
||||
.arg("--release")
|
||||
.arg("--example")
|
||||
.arg("a"),
|
||||
p.cargo("run -v --release --example a"),
|
||||
execs()
|
||||
.with_stderr(&format!(
|
||||
"\
|
||||
@ -732,7 +716,7 @@ fast2",
|
||||
);
|
||||
|
||||
assert_that(
|
||||
p.cargo("run").arg("-v").arg("--example").arg("a"),
|
||||
p.cargo("run -v --example a"),
|
||||
execs()
|
||||
.with_stderr(&format!(
|
||||
"\
|
||||
@ -798,7 +782,7 @@ fn run_dylib_dep() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("run").arg("hello").arg("world"),
|
||||
p.cargo("run hello world"),
|
||||
execs(),
|
||||
);
|
||||
}
|
||||
@ -815,7 +799,7 @@ fn release_works() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("run").arg("--release"),
|
||||
p.cargo("run --release"),
|
||||
execs().with_stderr(&format!(
|
||||
"\
|
||||
[COMPILING] foo v0.0.1 ({dir})
|
||||
@ -1013,7 +997,7 @@ fn fail_no_extra_verbose() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("run").arg("-q"),
|
||||
p.cargo("run -q"),
|
||||
execs().with_status(1).with_stdout("").with_stderr(""),
|
||||
);
|
||||
}
|
||||
|
@ -13,7 +13,7 @@ fn build_lib_for_foo() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("rustc").arg("--lib").arg("-v"),
|
||||
p.cargo("rustc --lib -v"),
|
||||
execs().with_stderr(format!(
|
||||
"\
|
||||
[COMPILING] foo v0.0.1 ({url})
|
||||
@ -38,12 +38,7 @@ fn lib() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("rustc")
|
||||
.arg("--lib")
|
||||
.arg("-v")
|
||||
.arg("--")
|
||||
.arg("-C")
|
||||
.arg("debug-assertions=off"),
|
||||
p.cargo("rustc --lib -v -- -C debug-assertions=off"),
|
||||
execs().with_stderr(format!(
|
||||
"\
|
||||
[COMPILING] foo v0.0.1 ({url})
|
||||
@ -103,11 +98,7 @@ fn fails_when_trying_to_build_main_and_lib_with_args() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("rustc")
|
||||
.arg("-v")
|
||||
.arg("--")
|
||||
.arg("-C")
|
||||
.arg("debug-assertions"),
|
||||
p.cargo("rustc -v -- -C debug-assertions"),
|
||||
execs().with_status(101).with_stderr(CARGO_RUSTC_ERROR),
|
||||
);
|
||||
}
|
||||
@ -148,11 +139,7 @@ fn fails_with_args_to_all_binaries() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("rustc")
|
||||
.arg("-v")
|
||||
.arg("--")
|
||||
.arg("-C")
|
||||
.arg("debug-assertions"),
|
||||
p.cargo("rustc -v -- -C debug-assertions"),
|
||||
execs().with_status(101).with_stderr(CARGO_RUSTC_ERROR),
|
||||
);
|
||||
}
|
||||
@ -206,11 +193,7 @@ fn build_foo_with_bar_dependency() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
foo.cargo("rustc")
|
||||
.arg("-v")
|
||||
.arg("--")
|
||||
.arg("-C")
|
||||
.arg("debug-assertions"),
|
||||
foo.cargo("rustc -v -- -C debug-assertions"),
|
||||
execs().with_stderr(format!(
|
||||
"\
|
||||
[COMPILING] bar v0.1.0 ([..])
|
||||
@ -264,7 +247,7 @@ fn targets_selected_default() {
|
||||
.file("src/main.rs", "fn main() {}")
|
||||
.build();
|
||||
assert_that(
|
||||
p.cargo("rustc").arg("-v"),
|
||||
p.cargo("rustc -v"),
|
||||
execs()
|
||||
// bin
|
||||
.with_stderr_contains("\
|
||||
@ -287,7 +270,7 @@ fn targets_selected_all() {
|
||||
.file("src/main.rs", "fn main() {}")
|
||||
.build();
|
||||
assert_that(
|
||||
p.cargo("rustc").arg("-v").arg("--all-targets"),
|
||||
p.cargo("rustc -v --all-targets"),
|
||||
execs()
|
||||
// bin
|
||||
.with_stderr_contains("\
|
||||
@ -389,7 +372,7 @@ fn rustc_with_other_profile() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("rustc").arg("--profile").arg("test"),
|
||||
p.cargo("rustc --profile test"),
|
||||
execs(),
|
||||
);
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ fn rustdoc_simple() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("rustdoc").arg("-v"),
|
||||
p.cargo("rustdoc -v"),
|
||||
execs().with_stderr(format!(
|
||||
"\
|
||||
[DOCUMENTING] foo v0.0.1 ({url})
|
||||
@ -30,7 +30,7 @@ fn rustdoc_args() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("rustdoc").arg("-v").arg("--").arg("--cfg=foo"),
|
||||
p.cargo("rustdoc -v -- --cfg=foo"),
|
||||
execs().with_stderr(format!(
|
||||
"\
|
||||
[DOCUMENTING] foo v0.0.1 ({url})
|
||||
@ -69,7 +69,7 @@ fn rustdoc_foo_with_bar_dependency() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
foo.cargo("rustdoc").arg("-v").arg("--").arg("--cfg=foo"),
|
||||
foo.cargo("rustdoc -v -- --cfg=foo"),
|
||||
execs().with_stderr(format!(
|
||||
"\
|
||||
[CHECKING] bar v0.0.1 ([..])
|
||||
@ -111,12 +111,7 @@ fn rustdoc_only_bar_dependency() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
foo.cargo("rustdoc")
|
||||
.arg("-v")
|
||||
.arg("-p")
|
||||
.arg("bar")
|
||||
.arg("--")
|
||||
.arg("--cfg=foo"),
|
||||
foo.cargo("rustdoc -v -p bar -- --cfg=foo"),
|
||||
execs().with_stderr(format!(
|
||||
"\
|
||||
[DOCUMENTING] bar v0.0.1 ([..])
|
||||
@ -139,7 +134,7 @@ fn rustdoc_same_name_documents_lib() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("rustdoc").arg("-v").arg("--").arg("--cfg=foo"),
|
||||
p.cargo("rustdoc -v -- --cfg=foo"),
|
||||
execs().with_stderr(format!(
|
||||
"\
|
||||
[DOCUMENTING] foo v0.0.1 ([..])
|
||||
|
@ -8,7 +8,7 @@ fn parses_env() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("doc").env("RUSTDOCFLAGS", "--cfg=foo").arg("-v"),
|
||||
p.cargo("doc -v").env("RUSTDOCFLAGS", "--cfg=foo"),
|
||||
execs()
|
||||
.with_stderr_contains("[RUNNING] `rustdoc [..] --cfg=foo[..]`"),
|
||||
);
|
||||
@ -28,7 +28,7 @@ fn parses_config() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("doc").arg("-v"),
|
||||
p.cargo("doc -v"),
|
||||
execs()
|
||||
.with_stderr_contains("[RUNNING] `rustdoc [..] --cfg foo[..]`"),
|
||||
);
|
||||
@ -86,8 +86,7 @@ fn rustdocflags_passed_to_rustdoc_through_cargo_test() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("test")
|
||||
.arg("--doc")
|
||||
p.cargo("test --doc")
|
||||
.env("RUSTDOCFLAGS", "--cfg do_not_choke"),
|
||||
execs(),
|
||||
);
|
||||
@ -100,8 +99,7 @@ fn rustdocflags_passed_to_rustdoc_through_cargo_test_only_once() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("test")
|
||||
.arg("--doc")
|
||||
p.cargo("test --doc")
|
||||
.env("RUSTDOCFLAGS", "--markdown-no-toc"),
|
||||
execs(),
|
||||
);
|
||||
|
@ -23,17 +23,16 @@ fn env_rustflags_normal_source() {
|
||||
|
||||
// Use RUSTFLAGS to pass an argument that will generate an error
|
||||
assert_that(
|
||||
p.cargo("build").env("RUSTFLAGS", "-Z bogus").arg("--lib"),
|
||||
p.cargo("build --lib").env("RUSTFLAGS", "-Z bogus"),
|
||||
execs().with_status(101),
|
||||
);
|
||||
assert_that(
|
||||
p.cargo("build").env("RUSTFLAGS", "-Z bogus").arg("--bin=a"),
|
||||
p.cargo("build --bin=a").env("RUSTFLAGS", "-Z bogus"),
|
||||
execs().with_status(101),
|
||||
);
|
||||
assert_that(
|
||||
p.cargo("build")
|
||||
.env("RUSTFLAGS", "-Z bogus")
|
||||
.arg("--example=b"),
|
||||
p.cargo("build --example=b")
|
||||
.env("RUSTFLAGS", "-Z bogus"),
|
||||
execs().with_status(101),
|
||||
);
|
||||
assert_that(
|
||||
@ -212,41 +211,33 @@ fn env_rustflags_normal_source_with_target() {
|
||||
|
||||
// Use RUSTFLAGS to pass an argument that will generate an error
|
||||
assert_that(
|
||||
p.cargo("build")
|
||||
.env("RUSTFLAGS", "-Z bogus")
|
||||
.arg("--lib")
|
||||
.arg("--target")
|
||||
.arg(host),
|
||||
p.cargo("build --lib --target")
|
||||
.arg(host)
|
||||
.env("RUSTFLAGS", "-Z bogus"),
|
||||
execs().with_status(101),
|
||||
);
|
||||
assert_that(
|
||||
p.cargo("build")
|
||||
.env("RUSTFLAGS", "-Z bogus")
|
||||
.arg("--bin=a")
|
||||
.arg("--target")
|
||||
.arg(host),
|
||||
p.cargo("build --bin=a --target")
|
||||
.arg(host)
|
||||
.env("RUSTFLAGS", "-Z bogus"),
|
||||
execs().with_status(101),
|
||||
);
|
||||
assert_that(
|
||||
p.cargo("build")
|
||||
.env("RUSTFLAGS", "-Z bogus")
|
||||
.arg("--example=b")
|
||||
.arg("--target")
|
||||
.arg(host),
|
||||
p.cargo("build --example=b --target")
|
||||
.arg(host)
|
||||
.env("RUSTFLAGS", "-Z bogus"),
|
||||
execs().with_status(101),
|
||||
);
|
||||
assert_that(
|
||||
p.cargo("test")
|
||||
.env("RUSTFLAGS", "-Z bogus")
|
||||
.arg("--target")
|
||||
.arg(host),
|
||||
p.cargo("test --target")
|
||||
.arg(host)
|
||||
.env("RUSTFLAGS", "-Z bogus"),
|
||||
execs().with_status(101),
|
||||
);
|
||||
assert_that(
|
||||
p.cargo("bench")
|
||||
.env("RUSTFLAGS", "-Z bogus")
|
||||
.arg("--target")
|
||||
.arg(host),
|
||||
p.cargo("bench --target")
|
||||
.arg(host)
|
||||
.env("RUSTFLAGS", "-Z bogus"),
|
||||
execs().with_status(101),
|
||||
);
|
||||
}
|
||||
@ -279,10 +270,9 @@ fn env_rustflags_build_script_with_target() {
|
||||
|
||||
let host = rustc_host();
|
||||
assert_that(
|
||||
p.cargo("build")
|
||||
.env("RUSTFLAGS", "--cfg foo")
|
||||
.arg("--target")
|
||||
.arg(host),
|
||||
p.cargo("build --target")
|
||||
.arg(host)
|
||||
.env("RUSTFLAGS", "--cfg foo"),
|
||||
execs(),
|
||||
);
|
||||
}
|
||||
@ -322,10 +312,9 @@ fn env_rustflags_build_script_dep_with_target() {
|
||||
|
||||
let host = rustc_host();
|
||||
assert_that(
|
||||
foo.cargo("build")
|
||||
.env("RUSTFLAGS", "--cfg foo")
|
||||
.arg("--target")
|
||||
.arg(host),
|
||||
foo.cargo("build --target")
|
||||
.arg(host)
|
||||
.env("RUSTFLAGS", "--cfg foo"),
|
||||
execs(),
|
||||
);
|
||||
}
|
||||
@ -360,10 +349,9 @@ fn env_rustflags_plugin_with_target() {
|
||||
|
||||
let host = rustc_host();
|
||||
assert_that(
|
||||
p.cargo("build")
|
||||
.env("RUSTFLAGS", "--cfg foo")
|
||||
.arg("--target")
|
||||
.arg(host),
|
||||
p.cargo("build --target")
|
||||
.arg(host)
|
||||
.env("RUSTFLAGS", "--cfg foo"),
|
||||
execs(),
|
||||
);
|
||||
}
|
||||
@ -405,10 +393,9 @@ fn env_rustflags_plugin_dep_with_target() {
|
||||
|
||||
let host = rustc_host();
|
||||
assert_that(
|
||||
foo.cargo("build")
|
||||
.env("RUSTFLAGS", "--cfg foo")
|
||||
.arg("--target")
|
||||
.arg(host),
|
||||
foo.cargo("build --target")
|
||||
.arg(host)
|
||||
.env("RUSTFLAGS", "--cfg foo"),
|
||||
execs(),
|
||||
);
|
||||
}
|
||||
@ -483,10 +470,10 @@ fn build_rustflags_normal_source() {
|
||||
)
|
||||
.build();
|
||||
|
||||
assert_that(p.cargo("build").arg("--lib"), execs().with_status(101));
|
||||
assert_that(p.cargo("build").arg("--bin=a"), execs().with_status(101));
|
||||
assert_that(p.cargo("build --lib"), execs().with_status(101));
|
||||
assert_that(p.cargo("build --bin=a"), execs().with_status(101));
|
||||
assert_that(
|
||||
p.cargo("build").arg("--example=b"),
|
||||
p.cargo("build --example=b"),
|
||||
execs().with_status(101),
|
||||
);
|
||||
assert_that(p.cargo("test"), execs().with_status(101));
|
||||
@ -682,26 +669,24 @@ fn build_rustflags_normal_source_with_target() {
|
||||
|
||||
// Use RUSTFLAGS to pass an argument that will generate an error
|
||||
assert_that(
|
||||
p.cargo("build").arg("--lib").arg("--target").arg(host),
|
||||
p.cargo("build --lib --target").arg(host),
|
||||
execs().with_status(101),
|
||||
);
|
||||
assert_that(
|
||||
p.cargo("build").arg("--bin=a").arg("--target").arg(host),
|
||||
p.cargo("build --bin=a --target").arg(host),
|
||||
execs().with_status(101),
|
||||
);
|
||||
assert_that(
|
||||
p.cargo("build")
|
||||
.arg("--example=b")
|
||||
.arg("--target")
|
||||
p.cargo("build --example=b --target")
|
||||
.arg(host),
|
||||
execs().with_status(101),
|
||||
);
|
||||
assert_that(
|
||||
p.cargo("test").arg("--target").arg(host),
|
||||
p.cargo("test --target").arg(host),
|
||||
execs().with_status(101),
|
||||
);
|
||||
assert_that(
|
||||
p.cargo("bench").arg("--target").arg(host),
|
||||
p.cargo("bench --target").arg(host),
|
||||
execs().with_status(101),
|
||||
);
|
||||
}
|
||||
@ -741,7 +726,7 @@ fn build_rustflags_build_script_with_target() {
|
||||
|
||||
let host = rustc_host();
|
||||
assert_that(
|
||||
p.cargo("build").arg("--target").arg(host),
|
||||
p.cargo("build --target").arg(host),
|
||||
execs(),
|
||||
);
|
||||
}
|
||||
@ -788,7 +773,7 @@ fn build_rustflags_build_script_dep_with_target() {
|
||||
|
||||
let host = rustc_host();
|
||||
assert_that(
|
||||
foo.cargo("build").arg("--target").arg(host),
|
||||
foo.cargo("build --target").arg(host),
|
||||
execs(),
|
||||
);
|
||||
}
|
||||
@ -830,7 +815,7 @@ fn build_rustflags_plugin_with_target() {
|
||||
|
||||
let host = rustc_host();
|
||||
assert_that(
|
||||
p.cargo("build").arg("--target").arg(host),
|
||||
p.cargo("build --target").arg(host),
|
||||
execs(),
|
||||
);
|
||||
}
|
||||
@ -879,7 +864,7 @@ fn build_rustflags_plugin_dep_with_target() {
|
||||
|
||||
let host = rustc_host();
|
||||
assert_that(
|
||||
foo.cargo("build").arg("--target").arg(host),
|
||||
foo.cargo("build --target").arg(host),
|
||||
execs(),
|
||||
);
|
||||
}
|
||||
@ -974,7 +959,7 @@ fn build_rustflags_with_home_config() {
|
||||
.file("src/lib.rs", "")
|
||||
.build();
|
||||
|
||||
assert_that(p.cargo("build").arg("-v"), execs());
|
||||
assert_that(p.cargo("build -v"), execs());
|
||||
}
|
||||
|
||||
#[test]
|
||||
@ -1003,10 +988,10 @@ fn target_rustflags_normal_source() {
|
||||
)
|
||||
.build();
|
||||
|
||||
assert_that(p.cargo("build").arg("--lib"), execs().with_status(101));
|
||||
assert_that(p.cargo("build").arg("--bin=a"), execs().with_status(101));
|
||||
assert_that(p.cargo("build --lib"), execs().with_status(101));
|
||||
assert_that(p.cargo("build --bin=a"), execs().with_status(101));
|
||||
assert_that(
|
||||
p.cargo("build").arg("--example=b"),
|
||||
p.cargo("build --example=b"),
|
||||
execs().with_status(101),
|
||||
);
|
||||
assert_that(p.cargo("test"), execs().with_status(101));
|
||||
@ -1033,10 +1018,10 @@ fn target_rustflags_precedence() {
|
||||
)
|
||||
.build();
|
||||
|
||||
assert_that(p.cargo("build").arg("--lib"), execs().with_status(101));
|
||||
assert_that(p.cargo("build").arg("--bin=a"), execs().with_status(101));
|
||||
assert_that(p.cargo("build --lib"), execs().with_status(101));
|
||||
assert_that(p.cargo("build --bin=a"), execs().with_status(101));
|
||||
assert_that(
|
||||
p.cargo("build").arg("--example=b"),
|
||||
p.cargo("build --example=b"),
|
||||
execs().with_status(101),
|
||||
);
|
||||
assert_that(p.cargo("test"), execs().with_status(101));
|
||||
@ -1067,7 +1052,7 @@ fn cfg_rustflags_normal_source() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("build").arg("--lib").arg("-v"),
|
||||
p.cargo("build --lib -v"),
|
||||
execs().with_stderr(
|
||||
"\
|
||||
[COMPILING] foo v0.0.1 ([..])
|
||||
@ -1078,7 +1063,7 @@ fn cfg_rustflags_normal_source() {
|
||||
);
|
||||
|
||||
assert_that(
|
||||
p.cargo("build").arg("--bin=a").arg("-v"),
|
||||
p.cargo("build --bin=a -v"),
|
||||
execs().with_stderr(
|
||||
"\
|
||||
[COMPILING] foo v0.0.1 ([..])
|
||||
@ -1089,7 +1074,7 @@ fn cfg_rustflags_normal_source() {
|
||||
);
|
||||
|
||||
assert_that(
|
||||
p.cargo("build").arg("--example=b").arg("-v"),
|
||||
p.cargo("build --example=b -v"),
|
||||
execs().with_stderr(
|
||||
"\
|
||||
[COMPILING] foo v0.0.1 ([..])
|
||||
@ -1100,7 +1085,7 @@ fn cfg_rustflags_normal_source() {
|
||||
);
|
||||
|
||||
assert_that(
|
||||
p.cargo("test").arg("--no-run").arg("-v"),
|
||||
p.cargo("test --no-run -v"),
|
||||
execs().with_stderr(
|
||||
"\
|
||||
[COMPILING] foo v0.0.1 ([..])
|
||||
@ -1113,7 +1098,7 @@ fn cfg_rustflags_normal_source() {
|
||||
);
|
||||
|
||||
assert_that(
|
||||
p.cargo("bench").arg("--no-run").arg("-v"),
|
||||
p.cargo("bench --no-run -v"),
|
||||
execs().with_stderr(
|
||||
"\
|
||||
[COMPILING] foo v0.0.1 ([..])
|
||||
@ -1154,7 +1139,7 @@ fn cfg_rustflags_precedence() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("build").arg("--lib").arg("-v"),
|
||||
p.cargo("build --lib -v"),
|
||||
execs().with_stderr(
|
||||
"\
|
||||
[COMPILING] foo v0.0.1 ([..])
|
||||
@ -1165,7 +1150,7 @@ fn cfg_rustflags_precedence() {
|
||||
);
|
||||
|
||||
assert_that(
|
||||
p.cargo("build").arg("--bin=a").arg("-v"),
|
||||
p.cargo("build --bin=a -v"),
|
||||
execs().with_stderr(
|
||||
"\
|
||||
[COMPILING] foo v0.0.1 ([..])
|
||||
@ -1176,7 +1161,7 @@ fn cfg_rustflags_precedence() {
|
||||
);
|
||||
|
||||
assert_that(
|
||||
p.cargo("build").arg("--example=b").arg("-v"),
|
||||
p.cargo("build --example=b -v"),
|
||||
execs().with_stderr(
|
||||
"\
|
||||
[COMPILING] foo v0.0.1 ([..])
|
||||
@ -1187,7 +1172,7 @@ fn cfg_rustflags_precedence() {
|
||||
);
|
||||
|
||||
assert_that(
|
||||
p.cargo("test").arg("--no-run").arg("-v"),
|
||||
p.cargo("test --no-run -v"),
|
||||
execs().with_stderr(
|
||||
"\
|
||||
[COMPILING] foo v0.0.1 ([..])
|
||||
@ -1200,7 +1185,7 @@ fn cfg_rustflags_precedence() {
|
||||
);
|
||||
|
||||
assert_that(
|
||||
p.cargo("bench").arg("--no-run").arg("-v"),
|
||||
p.cargo("bench --no-run -v"),
|
||||
execs().with_stderr(
|
||||
"\
|
||||
[COMPILING] foo v0.0.1 ([..])
|
||||
@ -1227,7 +1212,7 @@ fn target_rustflags_string_and_array_form1() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p1.cargo("build").arg("-v"),
|
||||
p1.cargo("build -v"),
|
||||
execs().with_stderr(
|
||||
"\
|
||||
[COMPILING] foo v0.0.1 ([..])
|
||||
@ -1249,7 +1234,7 @@ fn target_rustflags_string_and_array_form1() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p2.cargo("build").arg("-v"),
|
||||
p2.cargo("build -v"),
|
||||
execs().with_stderr(
|
||||
"\
|
||||
[COMPILING] foo v0.0.1 ([..])
|
||||
@ -1277,7 +1262,7 @@ fn target_rustflags_string_and_array_form2() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p1.cargo("build").arg("-v"),
|
||||
p1.cargo("build -v"),
|
||||
execs().with_stderr(
|
||||
"\
|
||||
[COMPILING] foo v0.0.1 ([..])
|
||||
@ -1302,7 +1287,7 @@ fn target_rustflags_string_and_array_form2() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p2.cargo("build").arg("-v"),
|
||||
p2.cargo("build -v"),
|
||||
execs().with_stderr(
|
||||
"\
|
||||
[COMPILING] foo v0.0.1 ([..])
|
||||
|
@ -33,8 +33,7 @@ pub fn disabled() -> bool {
|
||||
.file("src/cross_test.rs", &main_file(r#""testing!""#, &[]))
|
||||
.build();
|
||||
|
||||
let result = p.cargo("build")
|
||||
.arg("--target")
|
||||
let result = p.cargo("build --target")
|
||||
.arg(&cross_target)
|
||||
.exec_with_output();
|
||||
|
||||
|
@ -93,7 +93,7 @@ fn cargo_test_release() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("test").arg("-v").arg("--release"),
|
||||
p.cargo("test -v --release"),
|
||||
execs()
|
||||
.with_stderr(format!(
|
||||
"\
|
||||
@ -149,7 +149,7 @@ fn cargo_test_overflow_checks() {
|
||||
)
|
||||
.build();
|
||||
|
||||
assert_that(p.cargo("build").arg("--release"), execs());
|
||||
assert_that(p.cargo("build --release"), execs());
|
||||
assert_that(&p.release_bin("foo"), existing_file());
|
||||
|
||||
assert_that(
|
||||
@ -172,7 +172,7 @@ fn cargo_test_verbose() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("test").arg("-v").arg("hello"),
|
||||
p.cargo("test -v hello"),
|
||||
execs()
|
||||
.with_stderr(format!(
|
||||
"\
|
||||
@ -213,7 +213,7 @@ fn many_similar_names() {
|
||||
)
|
||||
.build();
|
||||
|
||||
let output = p.cargo("test").arg("-v").exec_with_output().unwrap();
|
||||
let output = p.cargo("test -v").exec_with_output().unwrap();
|
||||
let output = str::from_utf8(&output.stdout).unwrap();
|
||||
assert!(
|
||||
output.contains("test bin_test"),
|
||||
@ -648,7 +648,7 @@ fn pass_through_command_line() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("test").arg("bar"),
|
||||
p.cargo("test bar"),
|
||||
execs()
|
||||
.with_stderr(&format!(
|
||||
"\
|
||||
@ -663,7 +663,7 @@ fn pass_through_command_line() {
|
||||
);
|
||||
|
||||
assert_that(
|
||||
p.cargo("test").arg("foo"),
|
||||
p.cargo("test foo"),
|
||||
execs()
|
||||
.with_stderr(
|
||||
"\
|
||||
@ -1120,7 +1120,7 @@ fn bin_there_for_integration() {
|
||||
)
|
||||
.build();
|
||||
|
||||
let output = p.cargo("test").arg("-v").exec_with_output().unwrap();
|
||||
let output = p.cargo("test -v").exec_with_output().unwrap();
|
||||
let output = str::from_utf8(&output.stdout).unwrap();
|
||||
assert!(
|
||||
output.contains("main_test ... ok"),
|
||||
@ -1295,7 +1295,7 @@ fn test_no_run() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("test").arg("--no-run"),
|
||||
p.cargo("test --no-run"),
|
||||
execs().with_stderr(&format!(
|
||||
"\
|
||||
[COMPILING] foo v0.0.1 ({dir})
|
||||
@ -1331,7 +1331,7 @@ fn test_run_specific_bin_target() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
prj.cargo("test").arg("--bin").arg("bin2"),
|
||||
prj.cargo("test --bin bin2"),
|
||||
execs()
|
||||
.with_stderr(format!(
|
||||
"\
|
||||
@ -1375,7 +1375,7 @@ fn test_run_implicit_bin_target() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
prj.cargo("test").arg("--bins"),
|
||||
prj.cargo("test --bins"),
|
||||
execs()
|
||||
.with_stderr(format!(
|
||||
"\
|
||||
@ -1398,7 +1398,7 @@ fn test_run_specific_test_target() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
prj.cargo("test").arg("--test").arg("b"),
|
||||
prj.cargo("test --test b"),
|
||||
execs()
|
||||
.with_stderr(format!(
|
||||
"\
|
||||
@ -1441,7 +1441,7 @@ fn test_run_implicit_test_target() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
prj.cargo("test").arg("--tests"),
|
||||
prj.cargo("test --tests"),
|
||||
execs()
|
||||
.with_stderr(format!(
|
||||
"\
|
||||
@ -1485,7 +1485,7 @@ fn test_run_implicit_bench_target() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
prj.cargo("test").arg("--benches"),
|
||||
prj.cargo("test --benches"),
|
||||
execs()
|
||||
.with_stderr(format!(
|
||||
"\
|
||||
@ -1609,7 +1609,7 @@ fn test_no_harness() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("test").arg("--").arg("--nocapture"),
|
||||
p.cargo("test -- --nocapture"),
|
||||
execs().with_stderr(&format!(
|
||||
"\
|
||||
[COMPILING] foo v0.0.1 ({dir})
|
||||
@ -1683,7 +1683,7 @@ fn selective_testing() {
|
||||
|
||||
println!("d1");
|
||||
assert_that(
|
||||
p.cargo("test").arg("-p").arg("d1"),
|
||||
p.cargo("test -p d1"),
|
||||
execs()
|
||||
.with_stderr(&format!(
|
||||
"\
|
||||
@ -1698,7 +1698,7 @@ fn selective_testing() {
|
||||
|
||||
println!("d2");
|
||||
assert_that(
|
||||
p.cargo("test").arg("-p").arg("d2"),
|
||||
p.cargo("test -p d2"),
|
||||
execs()
|
||||
.with_stderr(&format!(
|
||||
"\
|
||||
@ -1809,7 +1809,7 @@ fn build_then_selective_test() {
|
||||
|
||||
assert_that(p.cargo("build"), execs());
|
||||
p.root().move_into_the_past();
|
||||
assert_that(p.cargo("test").arg("-p").arg("b"), execs());
|
||||
assert_that(p.cargo("test -p b"), execs());
|
||||
}
|
||||
|
||||
#[test]
|
||||
@ -1851,11 +1851,7 @@ fn example_dev_dep() {
|
||||
.build();
|
||||
assert_that(p.cargo("test"), execs());
|
||||
assert_that(
|
||||
p.cargo("run")
|
||||
.arg("--example")
|
||||
.arg("e1")
|
||||
.arg("--release")
|
||||
.arg("-v"),
|
||||
p.cargo("run --example e1 --release -v"),
|
||||
execs(),
|
||||
);
|
||||
}
|
||||
@ -1901,7 +1897,7 @@ fn selective_testing_with_docs() {
|
||||
let p = p.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("test").arg("-p").arg("d1"),
|
||||
p.cargo("test -p d1"),
|
||||
execs()
|
||||
.with_stderr(&format!(
|
||||
"\
|
||||
@ -1923,7 +1919,7 @@ fn example_bin_same_name() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("test").arg("--no-run").arg("-v"),
|
||||
p.cargo("test --no-run -v"),
|
||||
execs().with_stderr(&format!(
|
||||
"\
|
||||
[COMPILING] foo v0.0.1 ({dir})
|
||||
@ -1965,10 +1961,10 @@ fn test_with_example_twice() {
|
||||
.build();
|
||||
|
||||
println!("first");
|
||||
assert_that(p.cargo("test").arg("-v"), execs());
|
||||
assert_that(p.cargo("test -v"), execs());
|
||||
assert_that(&p.bin("examples/foo"), existing_file());
|
||||
println!("second");
|
||||
assert_that(p.cargo("test").arg("-v"), execs());
|
||||
assert_that(p.cargo("test -v"), execs());
|
||||
assert_that(&p.bin("examples/foo"), existing_file());
|
||||
}
|
||||
|
||||
@ -2002,7 +1998,7 @@ fn example_with_dev_dep() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("test").arg("-v"),
|
||||
p.cargo("test -v"),
|
||||
execs().with_stderr(
|
||||
"\
|
||||
[..]
|
||||
@ -2023,11 +2019,11 @@ fn bin_is_preserved() {
|
||||
.file("src/main.rs", "fn main() {}")
|
||||
.build();
|
||||
|
||||
assert_that(p.cargo("build").arg("-v"), execs());
|
||||
assert_that(p.cargo("build -v"), execs());
|
||||
assert_that(&p.bin("foo"), existing_file());
|
||||
|
||||
println!("testing");
|
||||
assert_that(p.cargo("test").arg("-v"), execs());
|
||||
assert_that(p.cargo("test -v"), execs());
|
||||
assert_that(&p.bin("foo"), existing_file());
|
||||
}
|
||||
|
||||
@ -2038,13 +2034,13 @@ fn bad_example() {
|
||||
let p = p.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("run").arg("--example").arg("foo"),
|
||||
p.cargo("run --example foo"),
|
||||
execs()
|
||||
.with_status(101)
|
||||
.with_stderr("[ERROR] no example target named `foo`"),
|
||||
);
|
||||
assert_that(
|
||||
p.cargo("run").arg("--bin").arg("foo"),
|
||||
p.cargo("run --bin foo"),
|
||||
execs()
|
||||
.with_status(101)
|
||||
.with_stderr("[ERROR] no bin target named `foo`"),
|
||||
@ -2078,7 +2074,7 @@ fn doctest_feature() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("test").arg("--features").arg("bar"),
|
||||
p.cargo("test --features bar"),
|
||||
execs()
|
||||
.with_stderr(
|
||||
"\
|
||||
@ -2107,7 +2103,7 @@ fn dashes_to_underscores() {
|
||||
)
|
||||
.build();
|
||||
|
||||
assert_that(p.cargo("test").arg("-v"), execs());
|
||||
assert_that(p.cargo("test -v"), execs());
|
||||
}
|
||||
|
||||
#[test]
|
||||
@ -2138,7 +2134,7 @@ fn doctest_dev_dep() {
|
||||
.file("b/src/lib.rs", "")
|
||||
.build();
|
||||
|
||||
assert_that(p.cargo("test").arg("-v"), execs());
|
||||
assert_that(p.cargo("test -v"), execs());
|
||||
}
|
||||
|
||||
#[test]
|
||||
@ -2157,7 +2153,7 @@ fn filter_no_doc_tests() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("test").arg("--test=foo"),
|
||||
p.cargo("test --test=foo"),
|
||||
execs()
|
||||
.with_stderr(
|
||||
"\
|
||||
@ -2384,7 +2380,7 @@ fn no_fail_fast() {
|
||||
)
|
||||
.build();
|
||||
assert_that(
|
||||
p.cargo("test").arg("--no-fail-fast"),
|
||||
p.cargo("test --no-fail-fast"),
|
||||
execs()
|
||||
.with_status(101)
|
||||
.with_stderr_contains(
|
||||
@ -2459,7 +2455,7 @@ fn test_multiple_packages() {
|
||||
let p = p.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("test").arg("-p").arg("d1").arg("-p").arg("d2"),
|
||||
p.cargo("test -p d1 -p d2"),
|
||||
execs()
|
||||
.with_stderr_contains("[RUNNING] target/debug/deps/d1-[..][EXE]")
|
||||
.with_stderr_contains("[RUNNING] target/debug/deps/d2-[..][EXE]")
|
||||
@ -2475,7 +2471,7 @@ fn bin_does_not_rebuild_tests() {
|
||||
.file("tests/foo.rs", "");
|
||||
let p = p.build();
|
||||
|
||||
assert_that(p.cargo("test").arg("-v"), execs());
|
||||
assert_that(p.cargo("test -v"), execs());
|
||||
|
||||
sleep_ms(1000);
|
||||
File::create(&p.root().join("src/main.rs"))
|
||||
@ -2484,7 +2480,7 @@ fn bin_does_not_rebuild_tests() {
|
||||
.unwrap();
|
||||
|
||||
assert_that(
|
||||
p.cargo("test").arg("-v").arg("--no-run"),
|
||||
p.cargo("test -v --no-run"),
|
||||
execs().with_stderr(
|
||||
"\
|
||||
[COMPILING] foo v0.0.1 ([..])
|
||||
@ -2546,13 +2542,7 @@ fn selective_test_optional_dep() {
|
||||
let p = p.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("test")
|
||||
.arg("-v")
|
||||
.arg("--no-run")
|
||||
.arg("--features")
|
||||
.arg("a")
|
||||
.arg("-p")
|
||||
.arg("a"),
|
||||
p.cargo("test -v --no-run --features a -p a"),
|
||||
execs().with_stderr(
|
||||
"\
|
||||
[COMPILING] a v0.0.1 ([..])
|
||||
@ -2587,7 +2577,7 @@ fn only_test_docs() {
|
||||
let p = p.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("test").arg("--doc"),
|
||||
p.cargo("test --doc"),
|
||||
execs()
|
||||
.with_stderr(
|
||||
"\
|
||||
@ -2629,7 +2619,7 @@ fn test_panic_abort_with_dep() {
|
||||
.file("bar/Cargo.toml", &basic_manifest("bar", "0.0.1"))
|
||||
.file("bar/src/lib.rs", "")
|
||||
.build();
|
||||
assert_that(p.cargo("test").arg("-v"), execs());
|
||||
assert_that(p.cargo("test -v"), execs());
|
||||
}
|
||||
|
||||
#[test]
|
||||
@ -2651,7 +2641,7 @@ fn cfg_test_even_with_no_harness() {
|
||||
.file("src/lib.rs", r#"#[cfg(test)] fn main() { println!("hello!"); }"#)
|
||||
.build();
|
||||
assert_that(
|
||||
p.cargo("test").arg("-v"),
|
||||
p.cargo("test -v"),
|
||||
execs().with_stdout("hello!\n").with_stderr(
|
||||
"\
|
||||
[COMPILING] foo v0.0.1 ([..])
|
||||
@ -2766,10 +2756,7 @@ fn pass_correct_cfgs_flags_to_rustdoc() {
|
||||
let p = p.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("test")
|
||||
.arg("--package")
|
||||
.arg("feature_a")
|
||||
.arg("--verbose"),
|
||||
p.cargo("test --package feature_a --verbose"),
|
||||
execs().with_stderr_contains(
|
||||
"\
|
||||
[DOCTEST] feature_a
|
||||
@ -2778,7 +2765,7 @@ fn pass_correct_cfgs_flags_to_rustdoc() {
|
||||
);
|
||||
|
||||
assert_that(
|
||||
p.cargo("test").arg("--verbose"),
|
||||
p.cargo("test --verbose"),
|
||||
execs().with_stderr_contains(
|
||||
"\
|
||||
[DOCTEST] foo
|
||||
@ -2815,9 +2802,9 @@ fn test_release_ignore_panic() {
|
||||
.file("a/src/lib.rs", "");
|
||||
let p = p.build();
|
||||
println!("test");
|
||||
assert_that(p.cargo("test").arg("-v"), execs());
|
||||
assert_that(p.cargo("test -v"), execs());
|
||||
println!("bench");
|
||||
assert_that(p.cargo("bench").arg("-v"), execs());
|
||||
assert_that(p.cargo("bench -v"), execs());
|
||||
}
|
||||
|
||||
#[test]
|
||||
@ -2873,7 +2860,7 @@ fn test_all_workspace() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("test").arg("--all"),
|
||||
p.cargo("test --all"),
|
||||
execs()
|
||||
.with_stdout_contains("test foo_test ... ok")
|
||||
.with_stdout_contains("test bar_test ... ok"),
|
||||
@ -2902,7 +2889,7 @@ fn test_all_exclude() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("test").arg("--all").arg("--exclude").arg("baz"),
|
||||
p.cargo("test --all --exclude baz"),
|
||||
execs().with_stdout_contains(
|
||||
"running 1 test
|
||||
test bar ... ok",
|
||||
@ -2927,7 +2914,7 @@ fn test_all_virtual_manifest() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("test").arg("--all"),
|
||||
p.cargo("test --all"),
|
||||
execs()
|
||||
.with_stdout_contains("test a ... ok")
|
||||
.with_stdout_contains("test b ... ok"),
|
||||
@ -2985,7 +2972,7 @@ fn test_all_member_dependency_same_name() {
|
||||
Package::new("a", "0.1.0").publish();
|
||||
|
||||
assert_that(
|
||||
p.cargo("test").arg("--all"),
|
||||
p.cargo("test --all"),
|
||||
execs().with_stdout_contains("test a ... ok"),
|
||||
);
|
||||
}
|
||||
@ -3020,7 +3007,7 @@ fn doctest_only_with_dev_dep() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("test").arg("--doc").arg("-v"),
|
||||
p.cargo("test --doc -v"),
|
||||
execs(),
|
||||
);
|
||||
}
|
||||
@ -3070,20 +3057,7 @@ fn test_many_targets() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("test")
|
||||
.arg("--verbose")
|
||||
.arg("--bin")
|
||||
.arg("a")
|
||||
.arg("--bin")
|
||||
.arg("b")
|
||||
.arg("--example")
|
||||
.arg("a")
|
||||
.arg("--example")
|
||||
.arg("b")
|
||||
.arg("--test")
|
||||
.arg("a")
|
||||
.arg("--test")
|
||||
.arg("b"),
|
||||
p.cargo("test --verbose --bin a --bin b --example a --example b --test a --test b"),
|
||||
execs()
|
||||
.with_stdout_contains("test bin_a ... ok")
|
||||
.with_stdout_contains("test bin_b ... ok")
|
||||
@ -3139,7 +3113,7 @@ fn doctest_and_registry() {
|
||||
Package::new("b", "0.1.0").publish();
|
||||
|
||||
assert_that(
|
||||
p.cargo("test").arg("--all").arg("-v"),
|
||||
p.cargo("test --all -v"),
|
||||
execs(),
|
||||
);
|
||||
}
|
||||
@ -3186,7 +3160,7 @@ fn test_order() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("test").arg("--all"),
|
||||
p.cargo("test --all"),
|
||||
execs().with_stdout_contains(
|
||||
"
|
||||
running 1 test
|
||||
@ -3228,7 +3202,7 @@ fn cyclic_dev() {
|
||||
.file("tests/foo.rs", "extern crate foo;")
|
||||
.build();
|
||||
|
||||
assert_that(p.cargo("test").arg("--all"), execs());
|
||||
assert_that(p.cargo("test --all"), execs());
|
||||
}
|
||||
|
||||
#[test]
|
||||
@ -3270,7 +3244,7 @@ fn publish_a_crate_without_tests() {
|
||||
|
||||
assert_that(p.cargo("test"), execs());
|
||||
assert_that(
|
||||
p.cargo("test").arg("--package").arg("testless"),
|
||||
p.cargo("test --package testless"),
|
||||
execs(),
|
||||
);
|
||||
}
|
||||
@ -3341,14 +3315,7 @@ fn find_dependency_of_proc_macro_dependency_with_target() {
|
||||
.dep("bar", "0.1")
|
||||
.file("src/lib.rs", "extern crate bar;")
|
||||
.publish();
|
||||
assert_that(
|
||||
p
|
||||
.cargo("test")
|
||||
.arg("--all")
|
||||
.arg("--target")
|
||||
.arg(rustc_host()),
|
||||
execs(),
|
||||
);
|
||||
assert_that(p.cargo("test --all --target").arg(rustc_host()), execs());
|
||||
}
|
||||
|
||||
#[test]
|
||||
@ -3374,7 +3341,7 @@ fn test_hint_not_masked_by_doctest() {
|
||||
)
|
||||
.build();
|
||||
assert_that(
|
||||
p.cargo("test").arg("--no-fail-fast"),
|
||||
p.cargo("test --no-fail-fast"),
|
||||
execs()
|
||||
.with_status(101)
|
||||
.with_stdout_contains("test this_fails ... FAILED")
|
||||
|
@ -23,7 +23,7 @@ fn pathless_tools() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
foo.cargo("build").arg("--verbose"),
|
||||
foo.cargo("build --verbose"),
|
||||
execs().with_stderr(&format!(
|
||||
"\
|
||||
[COMPILING] foo v0.5.0 ({url})
|
||||
@ -77,7 +77,7 @@ fn absolute_tools() {
|
||||
};
|
||||
|
||||
assert_that(
|
||||
foo.cargo("build").arg("--verbose"),
|
||||
foo.cargo("build --verbose"),
|
||||
execs().with_stderr(&format!(
|
||||
"\
|
||||
[COMPILING] foo v0.5.0 ({url})
|
||||
@ -139,7 +139,7 @@ fn relative_tools() {
|
||||
};
|
||||
|
||||
assert_that(
|
||||
p.cargo("build").cwd(foo_path).arg("--verbose"),
|
||||
p.cargo("build --verbose").cwd(foo_path),
|
||||
execs().with_stderr(&format!(
|
||||
"\
|
||||
[COMPILING] bar v0.5.0 ({url})
|
||||
|
@ -110,7 +110,7 @@ fn transitive_minor_update() {
|
||||
// Also note that this is probably counterintuitive and weird. We may wish
|
||||
// to change this one day.
|
||||
assert_that(
|
||||
p.cargo("update").arg("-p").arg("serde"),
|
||||
p.cargo("update -p serde"),
|
||||
execs().with_stderr(
|
||||
"\
|
||||
[UPDATING] registry `[..]`
|
||||
@ -161,7 +161,7 @@ fn conservative() {
|
||||
Package::new("serde", "0.1.1").dep("log", "0.1").publish();
|
||||
|
||||
assert_that(
|
||||
p.cargo("update").arg("-p").arg("serde"),
|
||||
p.cargo("update -p serde"),
|
||||
execs().with_stderr(
|
||||
"\
|
||||
[UPDATING] registry `[..]`
|
||||
@ -392,11 +392,7 @@ fn update_precise() {
|
||||
Package::new("serde", "0.2.0").publish();
|
||||
|
||||
assert_that(
|
||||
p.cargo("update")
|
||||
.arg("-p")
|
||||
.arg("serde:0.2.1")
|
||||
.arg("--precise")
|
||||
.arg("0.2.0"),
|
||||
p.cargo("update -p serde:0.2.1 --precise 0.2.0"),
|
||||
execs().with_stderr(
|
||||
"\
|
||||
[UPDATING] registry `[..]`
|
||||
|
@ -13,9 +13,7 @@ fn cargo_verify_project_path_to_cargo_toml_relative() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("verify-project")
|
||||
.arg("--manifest-path")
|
||||
.arg("foo/Cargo.toml")
|
||||
p.cargo("verify-project --manifest-path foo/Cargo.toml")
|
||||
.cwd(p.root().parent().unwrap()),
|
||||
execs()
|
||||
.with_stdout(verify_project_success_output()),
|
||||
@ -30,8 +28,7 @@ fn cargo_verify_project_path_to_cargo_toml_absolute() {
|
||||
.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("verify-project")
|
||||
.arg("--manifest-path")
|
||||
p.cargo("verify-project --manifest-path")
|
||||
.arg(p.root().join("Cargo.toml"))
|
||||
.cwd(p.root().parent().unwrap()),
|
||||
execs()
|
||||
|
@ -999,7 +999,7 @@ fn new_warns_you_this_will_not_work() {
|
||||
let p = p.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("new").arg("--lib").arg("bar").env("USER", "foo"),
|
||||
p.cargo("new --lib bar").env("USER", "foo"),
|
||||
execs().with_stderr(
|
||||
"\
|
||||
warning: compiling this new crate may not work due to invalid workspace \
|
||||
@ -1355,18 +1355,14 @@ fn relative_path_for_root_works() {
|
||||
let p = p.build();
|
||||
|
||||
assert_that(
|
||||
p.cargo("build")
|
||||
.cwd(p.root())
|
||||
.arg("--manifest-path")
|
||||
.arg("./Cargo.toml"),
|
||||
p.cargo("build --manifest-path ./Cargo.toml")
|
||||
.cwd(p.root()),
|
||||
execs(),
|
||||
);
|
||||
|
||||
assert_that(
|
||||
p.cargo("build")
|
||||
.cwd(p.root().join("subproj"))
|
||||
.arg("--manifest-path")
|
||||
.arg("../Cargo.toml"),
|
||||
p.cargo("build --manifest-path ../Cargo.toml")
|
||||
.cwd(p.root().join("subproj")),
|
||||
execs(),
|
||||
);
|
||||
}
|
||||
@ -1867,7 +1863,7 @@ fn dep_used_with_separate_features() {
|
||||
|
||||
// Build the entire workspace
|
||||
assert_that(
|
||||
p.cargo("build").arg("--all"),
|
||||
p.cargo("build --all"),
|
||||
execs().with_stderr(
|
||||
"\
|
||||
[..]Compiling feat_lib v0.1.0 ([..])
|
||||
@ -2015,7 +2011,7 @@ fn cargo_home_at_root_works() {
|
||||
|
||||
assert_that(p.cargo("build"), execs());
|
||||
assert_that(
|
||||
p.cargo("build").arg("--frozen").env("CARGO_HOME", p.root()),
|
||||
p.cargo("build --frozen").env("CARGO_HOME", p.root()),
|
||||
execs(),
|
||||
);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user