diff --git a/tests/support/mod.rs b/tests/support/mod.rs index 3ba8be881f5..f42057b6880 100644 --- a/tests/support/mod.rs +++ b/tests/support/mod.rs @@ -682,14 +682,3 @@ fn substitute_macros(input: &str) -> String { } return result; } - -pub static ADDING: &'static str = " Adding"; -pub static REMOVING: &'static str = " Removing"; -pub static DOCTEST: &'static str = " Doc-tests"; -pub static PACKAGING: &'static str = " Packaging"; -pub static DOWNLOADING: &'static str = " Downloading"; -pub static UPLOADING: &'static str = " Uploading"; -pub static VERIFYING: &'static str = " Verifying"; -pub static ARCHIVING: &'static str = " Archiving"; -pub static INSTALLING: &'static str = " Installing"; -pub static REPLACING: &'static str = " Replacing"; diff --git a/tests/test_bad_manifest_path.rs b/tests/test_bad_manifest_path.rs index ed6fc7c9a21..9c95fa8ab81 100644 --- a/tests/test_bad_manifest_path.rs +++ b/tests/test_bad_manifest_path.rs @@ -12,8 +12,8 @@ fn assert_not_a_cargo_toml(command: &str, manifest_path_argument: &str) { .arg("--manifest-path").arg(manifest_path_argument) .cwd(p.root().parent().unwrap()), execs().with_status(101) - .with_stderr(&format!("[ERROR] the manifest-path must be a path \ - to a Cargo.toml file"))); + .with_stderr("[ERROR] the manifest-path must be a path \ + to a Cargo.toml file")); } #[allow(deprecated)] // connect => join in 1.3 diff --git a/tests/test_cargo.rs b/tests/test_cargo.rs index 222d7bce32b..cbc6f9d75d8 100644 --- a/tests/test_cargo.rs +++ b/tests/test_cargo.rs @@ -102,11 +102,11 @@ test!(find_closest_biuld_to_build { assert_that(pr, execs().with_status(101) - .with_stderr(&format!("[ERROR] no such subcommand + .with_stderr("[ERROR] no such subcommand Did you mean `build`? -"))); +")); }); // if a subcommand is more than 3 edit distance away, we don't make a suggestion @@ -117,8 +117,8 @@ test!(find_closest_dont_correct_nonsense { assert_that(pr, execs().with_status(101) - .with_stderr(&format!("[ERROR] no such subcommand -"))); + .with_stderr("[ERROR] no such subcommand +")); }); test!(override_cargo_home { diff --git a/tests/test_cargo_bench.rs b/tests/test_cargo_bench.rs index b6e735e4a66..b75207a4c7e 100644 --- a/tests/test_cargo_bench.rs +++ b/tests/test_cargo_bench.rs @@ -460,7 +460,7 @@ test result: ok. 0 passed; 0 failed; 0 ignored; 1 measured assert_that(p.cargo("bench").arg("foo"), execs().with_status(0) - .with_stdout(&format!("\ + .with_stdout("\ [RUNNING] target[..]release[..]foo-[..] running 1 test @@ -468,7 +468,7 @@ test foo ... bench: [..] 0 ns/iter (+/- 0) test result: ok. 0 passed; 0 failed; 0 ignored; 1 measured -"))); +")); }); // Regression test for running cargo-bench twice with @@ -776,7 +776,7 @@ test result: ok. 0 passed; 0 failed; 0 ignored; 1 measured assert_that(p.cargo("bench"), execs().with_status(0) - .with_stdout(&format!("\ + .with_stdout("\ [RUNNING] target[..]release[..]foo-[..] running 1 test @@ -784,7 +784,7 @@ test foo ... bench: [..] 0 ns/iter (+/- 0) test result: ok. 0 passed; 0 failed; 0 ignored; 1 measured -"))); +")); }); test!(bench_with_examples { @@ -893,7 +893,7 @@ test!(test_a_bench { assert_that(p.cargo_process("test"), execs().with_status(0) - .with_stdout(&format!("\ + .with_stdout("\ [COMPILING] foo v0.1.0 ([..]) [RUNNING] target[..]debug[..]b-[..] @@ -902,7 +902,7 @@ test foo ... ok test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured -"))); +")); }); test!(test_bench_no_run { @@ -929,9 +929,9 @@ test!(test_bench_no_run { assert_that(p.cargo_process("bench").arg("--no-run"), execs().with_status(0) - .with_stdout(&format!("\ + .with_stdout("\ [COMPILING] foo v0.1.0 ([..]) -"))); +")); }); test!(test_bench_multiple_packages { @@ -1001,20 +1001,20 @@ test!(test_bench_multiple_packages { assert_that(p.cargo_process("bench").arg("-p").arg("bar").arg("-p").arg("baz"), execs().with_status(0) - .with_stdout_contains(&format!("\ + .with_stdout_contains("\ [RUNNING] target[..]release[..]bbaz-[..] running 1 test test bench_baz ... bench: 0 ns/iter (+/- 0) test result: ok. 0 passed; 0 failed; 0 ignored; 1 measured -")) - .with_stdout_contains(&format!("\ +") + .with_stdout_contains("\ [RUNNING] target[..]release[..]bbar-[..] running 1 test test bench_bar ... bench: 0 ns/iter (+/- 0) test result: ok. 0 passed; 0 failed; 0 ignored; 1 measured -"))); +")); }); diff --git a/tests/test_cargo_build_lib.rs b/tests/test_cargo_build_lib.rs index c6d111835a7..5bd2373c77d 100644 --- a/tests/test_cargo_build_lib.rs +++ b/tests/test_cargo_build_lib.rs @@ -48,7 +48,7 @@ test!(build_with_no_lib { assert_that(p.cargo_process("build").arg("--lib"), execs().with_status(101) - .with_stderr(&format!("[ERROR] no library targets found"))); + .with_stderr("[ERROR] no library targets found")); }); test!(build_with_relative_cargo_home_path { diff --git a/tests/test_cargo_cfg.rs b/tests/test_cargo_cfg.rs index 9e1971107b7..490a4c56482 100644 --- a/tests/test_cargo_cfg.rs +++ b/tests/test_cargo_cfg.rs @@ -4,7 +4,7 @@ use std::fmt; use cargo::util::{Cfg, CfgExpr}; use hamcrest::assert_that; -use support::{project, execs, DOWNLOADING}; +use support::{project, execs}; use support::registry::Package; macro_rules! c { @@ -184,9 +184,9 @@ test!(dont_include { "#) .file("b/src/lib.rs", ""); assert_that(p.cargo_process("build"), - execs().with_status(0).with_stdout(&format!("\ + execs().with_status(0).with_stdout("\ [COMPILING] a v0.0.1 ([..]) -"))); +")); }); test!(works_through_the_registry { @@ -211,14 +211,14 @@ test!(works_through_the_registry { .file("src/lib.rs", "extern crate bar;"); assert_that(p.cargo_process("build"), - execs().with_status(0).with_stdout(&format!("\ + execs().with_status(0).with_stdout("\ [UPDATING] registry [..] -{downloading} [..] -{downloading} [..] +[DOWNLOADING] [..] +[DOWNLOADING] [..] [COMPILING] foo v0.1.0 ([..]) [COMPILING] bar v0.1.0 ([..]) [COMPILING] a v0.0.1 ([..]) -", downloading = DOWNLOADING))); +")); }); test!(bad_target_spec { @@ -235,7 +235,7 @@ test!(bad_target_spec { .file("src/lib.rs", ""); assert_that(p.cargo_process("build"), - execs().with_status(101).with_stderr(&format!("\ + execs().with_status(101).with_stderr("\ [ERROR] failed to parse manifest at `[..]` Caused by: @@ -243,7 +243,7 @@ Caused by: Caused by: unexpected character in cfg `4`, [..] -"))); +")); }); test!(bad_target_spec2 { @@ -260,7 +260,7 @@ test!(bad_target_spec2 { .file("src/lib.rs", ""); assert_that(p.cargo_process("build"), - execs().with_status(101).with_stderr(&format!("\ + execs().with_status(101).with_stderr("\ [ERROR] failed to parse manifest at `[..]` Caused by: @@ -268,7 +268,7 @@ Caused by: Caused by: expected a string, found nothing -"))); +")); }); test!(multiple_match_ok { diff --git a/tests/test_cargo_clean.rs b/tests/test_cargo_clean.rs index ff4f838650b..aeededd6890 100644 --- a/tests/test_cargo_clean.rs +++ b/tests/test_cargo_clean.rs @@ -127,9 +127,9 @@ test!(clean_release { assert_that(p.cargo("clean").arg("-p").arg("foo").arg("--release"), execs().with_status(0)); assert_that(p.cargo("build").arg("--release"), - execs().with_status(0).with_stdout(&format!("\ + execs().with_status(0).with_stdout("\ [COMPILING] foo v0.0.1 ([..]) -"))); +")); }); test!(build_script { @@ -163,12 +163,12 @@ test!(build_script { assert_that(p.cargo("clean").arg("-p").arg("foo"), execs().with_status(0)); assert_that(p.cargo("build").arg("-v"), - execs().with_status(0).with_stdout(&format!("\ + execs().with_status(0).with_stdout("\ [COMPILING] foo v0.0.1 ([..]) [RUNNING] `rustc build.rs [..]` [RUNNING] `[..]build-script-build[..]` [RUNNING] `rustc src[..]main.rs [..]` -"))); +")); }); test!(clean_git { diff --git a/tests/test_cargo_compile.rs b/tests/test_cargo_compile.rs index 8e6d902dac2..d30eb82d516 100644 --- a/tests/test_cargo_compile.rs +++ b/tests/test_cargo_compile.rs @@ -43,12 +43,12 @@ test!(cargo_compile_with_invalid_manifest { assert_that(p.cargo_process("build"), execs() .with_status(101) - .with_stderr(&format!("\ + .with_stderr("\ [ERROR] failed to parse manifest at `[..]` Caused by: no `package` or `project` section found. -"))) +")) }); test!(cargo_compile_with_invalid_manifest2 { @@ -61,14 +61,14 @@ test!(cargo_compile_with_invalid_manifest2 { assert_that(p.cargo_process("build"), execs() .with_status(101) - .with_stderr(&format!("\ + .with_stderr("\ [ERROR] failed to parse manifest at `[..]` Caused by: could not parse input as TOML Cargo.toml:3:19-3:20 expected a value -"))) +")) }); test!(cargo_compile_with_invalid_manifest3 { @@ -85,12 +85,12 @@ test!(cargo_compile_with_invalid_manifest3 { .arg("src/Cargo.toml"), execs() .with_status(101) - .with_stderr(&format!("\ + .with_stderr("\ [ERROR] failed to parse manifest at `[..]` Caused by: could not parse input as TOML\n\ -src[..]Cargo.toml:1:5-1:6 expected a value\n\n"))) +src[..]Cargo.toml:1:5-1:6 expected a value\n\n")) }); test!(cargo_compile_with_invalid_version { @@ -105,12 +105,12 @@ test!(cargo_compile_with_invalid_version { assert_that(p.cargo_process("build"), execs() .with_status(101) - .with_stderr(&format!("\ + .with_stderr("\ [ERROR] failed to parse manifest at `[..]` Caused by: cannot parse '1.0' as a semver for the key `project.version` -"))) +")) }); @@ -126,12 +126,12 @@ test!(cargo_compile_with_invalid_package_name { assert_that(p.cargo_process("build"), execs() .with_status(101) - .with_stderr(&format!("\ + .with_stderr("\ [ERROR] failed to parse manifest at `[..]` Caused by: package name cannot be an empty string. -"))) +")) }); test!(cargo_compile_with_invalid_bin_target_name { @@ -149,12 +149,12 @@ test!(cargo_compile_with_invalid_bin_target_name { assert_that(p.cargo_process("build"), execs() .with_status(101) - .with_stderr(&format!("\ + .with_stderr("\ [ERROR] failed to parse manifest at `[..]` Caused by: binary target names cannot be empty. -"))) +")) }); test!(cargo_compile_with_forbidden_bin_target_name { @@ -172,12 +172,12 @@ test!(cargo_compile_with_forbidden_bin_target_name { assert_that(p.cargo_process("build"), execs() .with_status(101) - .with_stderr(&format!("\ + .with_stderr("\ [ERROR] failed to parse manifest at `[..]` Caused by: the binary target name `build` is forbidden -"))) +")) }); test!(cargo_compile_with_invalid_lib_target_name { @@ -195,12 +195,12 @@ test!(cargo_compile_with_invalid_lib_target_name { assert_that(p.cargo_process("build"), execs() .with_status(101) - .with_stderr(&format!("\ + .with_stderr("\ [ERROR] failed to parse manifest at `[..]` Caused by: library target names cannot be empty. -"))) +")) }); test!(cargo_compile_without_manifest { @@ -209,9 +209,9 @@ test!(cargo_compile_without_manifest { assert_that(p.cargo_process("build"), execs().with_status(101) - .with_stderr(&format!("\ + .with_stderr("\ [ERROR] could not find `Cargo.toml` in `[..]` or any parent directory -"))); +")); }); test!(cargo_compile_with_invalid_code { @@ -227,10 +227,10 @@ src[..]foo.rs:1:1: 1:8 error: expected item[..]found `invalid` src[..]foo.rs:1 invalid rust code! ^~~~~~~ ") - .with_stderr_contains(format!("\ + .with_stderr_contains("\ [ERROR] Could not compile `foo`. -To learn more, run the command again with --verbose.\n"))); +To learn more, run the command again with --verbose.\n")); assert_that(&p.root().join("Cargo.lock"), existing_file()); }); @@ -630,24 +630,24 @@ test!(cargo_compile_with_filename{ "#); assert_that(p.cargo_process("build").arg("--bin").arg("bin.rs"), - execs().with_status(101).with_stderr(&format!("\ -[ERROR] no bin target named `bin.rs`"))); + execs().with_status(101).with_stderr("\ +[ERROR] no bin target named `bin.rs`")); assert_that(p.cargo_process("build").arg("--bin").arg("a.rs"), - execs().with_status(101).with_stderr(&format!("\ + execs().with_status(101).with_stderr("\ [ERROR] no bin target named `a.rs` -Did you mean `a`?"))); +Did you mean `a`?")); assert_that(p.cargo_process("build").arg("--example").arg("example.rs"), - execs().with_status(101).with_stderr(&format!("\ -[ERROR] no example target named `example.rs`"))); + execs().with_status(101).with_stderr("\ +[ERROR] no example target named `example.rs`")); assert_that(p.cargo_process("build").arg("--example").arg("a.rs"), - execs().with_status(101).with_stderr(&format!("\ + execs().with_status(101).with_stderr("\ [ERROR] no example target named `a.rs` -Did you mean `a`?"))); +Did you mean `a`?")); }); test!(compile_path_dep_then_change_version { @@ -680,13 +680,13 @@ test!(compile_path_dep_then_change_version { "#).unwrap(); assert_that(p.cargo("build"), - execs().with_status(101).with_stderr(&format!("\ + execs().with_status(101).with_stderr("\ [ERROR] no matching package named `bar` found (required by `foo`) location searched: [..] version required: = 0.0.1 versions found: 0.0.2 consider running `cargo update` to update a path dependency's locked version -"))); +")); }); test!(ignores_carriage_return_in_lockfile { @@ -805,7 +805,7 @@ test!(crate_authors_env_vars { println!("bin"); assert_that(process(&p.bin("foo")), - execs().with_stdout(&format!("wycats@example.com:neikos@example.com"))); + execs().with_stdout("wycats@example.com:neikos@example.com")); println!("test"); assert_that(p.cargo("test").arg("-v"), @@ -935,9 +935,9 @@ test!(self_dependency { .file("src/test.rs", "fn main() {}"); assert_that(p.cargo_process("build"), execs().with_status(101) - .with_stderr(&format!("\ + .with_stderr("\ [ERROR] cyclic package dependency: package `test v0.0.0 ([..])` depends on itself -"))); +")); }); test!(ignore_broken_symlinks { @@ -968,12 +968,12 @@ test!(missing_lib_and_bin { "#); assert_that(p.cargo_process("build"), execs().with_status(101) - .with_stderr(&format!("\ + .with_stderr("\ [ERROR] failed to parse manifest at `[..]Cargo.toml` Caused by: no targets specified in the manifest - either src/lib.rs, src/main.rs, a [lib] section, or [[bin]] section must be present\n"))); + either src/lib.rs, src/main.rs, a [lib] section, or [[bin]] section must be present\n")); }); test!(lto_build { @@ -1546,7 +1546,7 @@ test!(bad_cargo_config { this is not valid toml "#); assert_that(foo.cargo_process("build").arg("-v"), - execs().with_status(101).with_stderr(&format!("\ + execs().with_status(101).with_stderr("\ [ERROR] Couldn't load Cargo configuration Caused by: @@ -1556,7 +1556,7 @@ Caused by: could not parse input as TOML [..].cargo[..]config:2:20-2:21 expected `=`, but found `i` -"))); +")); }); test!(cargo_platform_specific_dependency { @@ -1769,7 +1769,7 @@ test!(transitive_dependencies_not_available { assert_that(p.cargo_process("build").arg("-v"), execs().with_status(101) - .with_stderr(format!("\ + .with_stderr("\ [..] can't find crate for `bbbbb`[..] [..] extern crate bbbbb; [..] [..] @@ -1778,7 +1778,7 @@ error: aborting due to previous error Caused by: [..] -"))); +")); }); test!(cyclic_deps_rejected { @@ -1806,9 +1806,9 @@ test!(cyclic_deps_rejected { assert_that(p.cargo_process("build").arg("-v"), execs().with_status(101) - .with_stderr(&format!("\ + .with_stderr("\ [ERROR] cyclic package dependency: package `foo v0.0.1 ([..])` depends on itself -"))); +")); }); test!(predictable_filenames { @@ -1882,12 +1882,12 @@ test!(rustc_env_var { assert_that(p.cargo("build") .env("RUSTC", "rustc-that-does-not-exist").arg("-v"), execs().with_status(101) - .with_stderr(&format!("\ + .with_stderr("\ [ERROR] Could not execute process `rustc-that-does-not-exist -vV` ([..]) Caused by: [..] -"))); +")); assert_that(&p.bin("a"), is_not(existing_file())); }); diff --git a/tests/test_cargo_compile_custom_build.rs b/tests/test_cargo_compile_custom_build.rs index b88963de4ec..59889c954fc 100644 --- a/tests/test_cargo_compile_custom_build.rs +++ b/tests/test_cargo_compile_custom_build.rs @@ -2,7 +2,6 @@ use std::fs::{self, File}; use std::io::prelude::*; use support::{project, execs}; -use support::{DOCTEST}; use support::paths::CargoPathExt; use hamcrest::{assert_that, existing_file, existing_dir}; @@ -204,10 +203,10 @@ test!(links_no_build_cmd { assert_that(p.cargo_process("build"), execs().with_status(101) - .with_stderr(&format!("\ + .with_stderr("\ [ERROR] package `foo v0.5.0 (file://[..])` specifies that it links to `a` but does \ not have a custom build script -"))); +")); }); test!(links_duplicates { @@ -238,13 +237,13 @@ test!(links_duplicates { assert_that(p.cargo_process("build"), execs().with_status(101) - .with_stderr(&format!("\ + .with_stderr("\ [ERROR] native library `a` is being linked to by more than one package, and can only be \ linked to by one package [..] v0.5.0 (file://[..]) [..] v0.5.0 (file://[..]) -"))); +")); }); test!(overrides_and_links { @@ -290,14 +289,14 @@ test!(overrides_and_links { assert_that(p.cargo_process("build").arg("-v"), execs().with_status(0) - .with_stdout(&format!("\ + .with_stdout("\ [..] [..] [..] [..] [..] [RUNNING] `rustc [..] --crate-name foo [..] -L foo -L bar[..]` -"))); +")); }); test!(unused_overrides { @@ -387,11 +386,11 @@ test!(only_rerun_build_script { assert_that(p.cargo("build").arg("-v"), execs().with_status(0) - .with_stdout(&format!("\ + .with_stdout("\ [COMPILING] foo v0.5.0 (file://[..]) [RUNNING] `[..]build-script-build[..]` [RUNNING] `rustc [..] --crate-name foo [..]` -"))); +")); }); test!(rebuild_continues_to_pass_env_vars { @@ -471,7 +470,7 @@ test!(testing_and_such { println!("test"); assert_that(p.cargo("test").arg("-vj1"), execs().with_status(0) - .with_stdout(&format!("\ + .with_stdout("\ [COMPILING] foo v0.5.0 (file://[..]) [RUNNING] `[..]build-script-build[..]` [RUNNING] `rustc [..] --crate-name foo [..]` @@ -482,32 +481,32 @@ running 0 tests test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured -{doctest} foo +[DOCTEST] foo [RUNNING] `rustdoc --test [..]` running 0 tests test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured -", doctest = DOCTEST))); +")); println!("doc"); assert_that(p.cargo("doc").arg("-v"), execs().with_status(0) - .with_stdout(&format!("\ + .with_stdout("\ [DOCUMENTING] foo v0.5.0 (file://[..]) [RUNNING] `rustdoc [..]` -"))); +")); File::create(&p.root().join("src/main.rs")).unwrap() .write_all(b"fn main() {}").unwrap(); println!("run"); assert_that(p.cargo("run"), execs().with_status(0) - .with_stdout(&format!("\ + .with_stdout("\ [COMPILING] foo v0.5.0 (file://[..]) [RUNNING] `target[..]foo[..]` -"))); +")); }); test!(propagation_of_l_flags { @@ -556,11 +555,11 @@ test!(propagation_of_l_flags { assert_that(p.cargo_process("build").arg("-v").arg("-j1"), execs().with_status(0) - .with_stdout_contains(&format!("\ + .with_stdout_contains("\ [RUNNING] `rustc [..] --crate-name a [..]-L bar[..]-L foo[..]` [COMPILING] foo v0.5.0 (file://[..]) [RUNNING] `rustc [..] --crate-name foo [..] -L bar -L foo` -"))); +")); }); test!(propagation_of_l_flags_new { @@ -609,11 +608,11 @@ test!(propagation_of_l_flags_new { assert_that(p.cargo_process("build").arg("-v").arg("-j1"), execs().with_status(0) - .with_stdout_contains(&format!("\ + .with_stdout_contains("\ [RUNNING] `rustc [..] --crate-name a [..]-L bar[..]-L foo[..]` [COMPILING] foo v0.5.0 (file://[..]) [RUNNING] `rustc [..] --crate-name foo [..] -L bar -L foo` -"))); +")); }); test!(build_deps_simple { @@ -642,14 +641,14 @@ test!(build_deps_simple { assert_that(p.cargo_process("build").arg("-v"), execs().with_status(0) - .with_stdout(&format!("\ + .with_stdout("\ [COMPILING] a v0.5.0 (file://[..]) [RUNNING] `rustc [..] --crate-name a [..]` [COMPILING] foo v0.5.0 (file://[..]) [RUNNING] `rustc build.rs [..] --extern a=[..]` [RUNNING] `[..]foo-[..]build-script-build[..]` [RUNNING] `rustc [..] --crate-name foo [..]` -"))); +")); }); test!(build_deps_not_for_normal { @@ -679,7 +678,7 @@ test!(build_deps_not_for_normal { assert_that(p.cargo_process("build").arg("-v").arg("--target").arg(&target), execs().with_status(101) - .with_stderr(&format!("\ + .with_stderr("\ [..]lib.rs[..] error: can't find crate for `aaaaa`[..] [..]lib.rs[..] extern crate aaaaa; [..] ^~~~~~~~~~~~~~~~~~~ @@ -688,7 +687,7 @@ error: aborting due to previous error Caused by: Process didn't exit successfully: [..] -"))); +")); }); test!(build_cmd_with_a_build_cmd { @@ -730,7 +729,7 @@ test!(build_cmd_with_a_build_cmd { assert_that(p.cargo_process("build").arg("-v"), execs().with_status(0) - .with_stdout(&format!("\ + .with_stdout("\ [COMPILING] b v0.5.0 (file://[..]) [RUNNING] `rustc [..] --crate-name b [..]` [COMPILING] a v0.5.0 (file://[..]) @@ -750,7 +749,7 @@ test!(build_cmd_with_a_build_cmd { [RUNNING] `rustc [..]lib.rs --crate-name foo --crate-type lib -g \ --out-dir [..]target[..]debug --emit=dep-info,link \ -L [..]target[..]debug -L [..]target[..]deps` -"))); +")); }); test!(out_dir_is_preserved { @@ -819,12 +818,12 @@ test!(output_separate_lines { "#); assert_that(p.cargo_process("build").arg("-v"), execs().with_status(101) - .with_stdout(&format!("\ + .with_stdout("\ [COMPILING] foo v0.5.0 (file://[..]) [RUNNING] `rustc build.rs [..]` [RUNNING] `[..]foo-[..]build-script-build[..]` [RUNNING] `rustc [..] --crate-name foo [..] -L foo -l static=foo` -"))); +")); }); test!(output_separate_lines_new { @@ -845,12 +844,12 @@ test!(output_separate_lines_new { "#); assert_that(p.cargo_process("build").arg("-v"), execs().with_status(101) - .with_stdout(&format!("\ + .with_stdout("\ [COMPILING] foo v0.5.0 (file://[..]) [RUNNING] `rustc build.rs [..]` [RUNNING] `[..]foo-[..]build-script-build[..]` [RUNNING] `rustc [..] --crate-name foo [..] -L foo -l static=foo` -"))); +")); }); #[cfg(not(windows))] // FIXME(#867) @@ -888,11 +887,11 @@ test!(code_generation { "#); assert_that(p.cargo_process("run"), execs().with_status(0) - .with_stdout(&format!("\ + .with_stdout("\ [COMPILING] foo v0.5.0 (file://[..]) [RUNNING] `target[..]foo` Hello, World! -"))); +")); assert_that(p.cargo_process("test"), execs().with_status(0)); @@ -928,12 +927,12 @@ test!(build_script_only { .file("build.rs", r#"fn main() {}"#); assert_that(p.cargo_process("build").arg("-v"), execs().with_status(101) - .with_stderr(&format!("\ + .with_stderr("\ [ERROR] failed to parse manifest at `[..]` Caused by: no targets specified in the manifest - either src/lib.rs, src/main.rs, a [lib] section, or [[bin]] section must be present"))); + either src/lib.rs, src/main.rs, a [lib] section, or [[bin]] section must be present")); }); test!(shared_dep_with_a_build_script { @@ -1331,7 +1330,7 @@ test test_bar ... ok test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured -{doctest} foo +[DOCTEST] foo [RUNNING] [..] --cfg foo[..] running 1 test @@ -1339,7 +1338,7 @@ test foo_0 ... ok test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured -", dir = p.url(), doctest = DOCTEST))); +", dir = p.url()))); }); test!(cfg_doc { @@ -1445,7 +1444,7 @@ test test_bar ... ok test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured -{doctest} foo +[DOCTEST] foo [RUNNING] [..] --cfg foo[..] running 1 test @@ -1453,7 +1452,7 @@ test foo_0 ... ok test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured -", dir = p.url(), doctest = DOCTEST))); +", dir = p.url()))); }); test!(cfg_override_doc { @@ -1537,7 +1536,7 @@ test!(flags_go_into_tests { "#); assert_that(p.cargo_process("test").arg("-v").arg("--test=foo"), - execs().with_status(0).with_stdout(&format!("\ + execs().with_status(0).with_stdout("\ [COMPILING] a v0.5.0 ([..] [RUNNING] `rustc a[..]build.rs [..]` [RUNNING] `[..]build-script-build[..]` @@ -1553,10 +1552,10 @@ running 0 tests test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured -"))); +")); assert_that(p.cargo("test").arg("-v").arg("-pb").arg("--lib"), - execs().with_status(0).with_stdout(&format!("\ + execs().with_status(0).with_stdout("\ [FRESH] a v0.5.0 ([..] [COMPILING] b v0.5.0 ([..] [RUNNING] `rustc b[..]src[..]lib.rs [..] -L test[..]` @@ -1566,7 +1565,7 @@ running 0 tests test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured -"))); +")); }); test!(diamond_passes_args_only_once { @@ -1617,7 +1616,7 @@ test!(diamond_passes_args_only_once { .file("c/src/lib.rs", ""); assert_that(p.cargo_process("build").arg("-v"), - execs().with_status(0).with_stdout(&format!("\ + execs().with_status(0).with_stdout("\ [COMPILING] c v0.5.0 ([..] [RUNNING] `rustc [..]` [RUNNING] `[..]` @@ -1628,7 +1627,7 @@ test!(diamond_passes_args_only_once { [RUNNING] `rustc [..]` [COMPILING] foo v0.5.0 ([..] [RUNNING] `[..]rlib -L native=test` -"))); +")); }); test!(adding_an_override_invalidates { @@ -1651,12 +1650,12 @@ test!(adding_an_override_invalidates { "#); assert_that(p.cargo_process("build").arg("-v"), - execs().with_status(0).with_stdout(&format!("\ + execs().with_status(0).with_stdout("\ [COMPILING] foo v0.5.0 ([..] [RUNNING] `rustc [..]` [RUNNING] `[..]` [RUNNING] `rustc [..] -L native=foo` -"))); +")); File::create(p.root().join(".cargo/config")).unwrap().write_all(format!(" [target.{}.foo] @@ -1664,10 +1663,10 @@ test!(adding_an_override_invalidates { ", target).as_bytes()).unwrap(); assert_that(p.cargo("build").arg("-v"), - execs().with_status(0).with_stdout(&format!("\ + execs().with_status(0).with_stdout("\ [COMPILING] foo v0.5.0 ([..] [RUNNING] `rustc [..] -L native=bar` -"))); +")); }); test!(changing_an_override_invalidates { @@ -1689,10 +1688,10 @@ test!(changing_an_override_invalidates { .file("build.rs", ""); assert_that(p.cargo_process("build").arg("-v"), - execs().with_status(0).with_stdout(&format!("\ + execs().with_status(0).with_stdout("\ [COMPILING] foo v0.5.0 ([..] [RUNNING] `rustc [..] -L native=foo` -"))); +")); File::create(p.root().join(".cargo/config")).unwrap().write_all(format!(" [target.{}.foo] @@ -1700,10 +1699,10 @@ test!(changing_an_override_invalidates { ", target).as_bytes()).unwrap(); assert_that(p.cargo("build").arg("-v"), - execs().with_status(0).with_stdout(&format!("\ + execs().with_status(0).with_stdout("\ [COMPILING] foo v0.5.0 ([..] [RUNNING] `rustc [..] -L native=bar` -"))); +")); }); test!(rebuild_only_on_explicit_paths { @@ -1730,11 +1729,11 @@ test!(rebuild_only_on_explicit_paths { // files don't exist, so should always rerun if they don't exist println!("run without"); assert_that(p.cargo("build").arg("-v"), - execs().with_status(0).with_stdout(&format!("\ + execs().with_status(0).with_stdout("\ [COMPILING] a v0.5.0 ([..]) [RUNNING] `[..]build-script-build[..]` [RUNNING] `rustc src[..]lib.rs [..]` -"))); +")); ::sleep_ms(1000); File::create(p.root().join("foo")).unwrap(); @@ -1743,17 +1742,17 @@ test!(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"), - execs().with_status(0).with_stdout(&format!("\ + execs().with_status(0).with_stdout("\ [COMPILING] a v0.5.0 ([..]) [RUNNING] `[..]build-script-build[..]` [RUNNING] `rustc src[..]lib.rs [..]` -"))); +")); println!("run with2"); assert_that(p.cargo("build").arg("-v"), - execs().with_status(0).with_stdout(&format!("\ + execs().with_status(0).with_stdout("\ [FRESH] a v0.5.0 ([..]) -"))); +")); ::sleep_ms(1000); @@ -1761,29 +1760,29 @@ test!(rebuild_only_on_explicit_paths { println!("run baz"); File::create(p.root().join("baz")).unwrap(); assert_that(p.cargo("build").arg("-v"), - execs().with_status(0).with_stdout(&format!("\ + execs().with_status(0).with_stdout("\ [FRESH] a v0.5.0 ([..]) -"))); +")); // but changing dependent files does println!("run foo change"); File::create(p.root().join("foo")).unwrap(); assert_that(p.cargo("build").arg("-v"), - execs().with_status(0).with_stdout(&format!("\ + execs().with_status(0).with_stdout("\ [COMPILING] a v0.5.0 ([..]) [RUNNING] `[..]build-script-build[..]` [RUNNING] `rustc src[..]lib.rs [..]` -"))); +")); // .. as does deleting a file println!("run foo delete"); fs::remove_file(p.root().join("bar")).unwrap(); assert_that(p.cargo("build").arg("-v"), - execs().with_status(0).with_stdout(&format!("\ + execs().with_status(0).with_stdout("\ [COMPILING] a v0.5.0 ([..]) [RUNNING] `[..]build-script-build[..]` [RUNNING] `rustc src[..]lib.rs [..]` -"))); +")); }); @@ -1815,9 +1814,9 @@ test!(doctest_recieves_build_link_args { assert_that(p.cargo_process("test").arg("-v"), execs().with_status(0) - .with_stdout_contains(&format!("\ + .with_stdout_contains("\ [RUNNING] `rustdoc --test [..] --crate-name foo [..]-L native=bar[..]` -"))); +")); }); test!(please_respect_the_dag { @@ -1855,9 +1854,9 @@ test!(please_respect_the_dag { assert_that(p.cargo_process("build").arg("-v"), execs().with_status(0) - .with_stdout_contains(&format!("\ + .with_stdout_contains("\ [RUNNING] `rustc [..] -L native=foo -L native=bar[..]` -"))); +")); }); test!(non_utf8_output { diff --git a/tests/test_cargo_compile_git_deps.rs b/tests/test_cargo_compile_git_deps.rs index a140a982ddf..28e7ffd7572 100644 --- a/tests/test_cargo_compile_git_deps.rs +++ b/tests/test_cargo_compile_git_deps.rs @@ -644,11 +644,11 @@ test!(update_with_shared_deps { assert_that(p.cargo("update") .arg("-p").arg("bar") .arg("--precise").arg("0.1.2"), - execs().with_status(101).with_stderr(&format!("\ + execs().with_status(101).with_stderr("\ [ERROR] Unable to update [..] To learn more, run the command again with --verbose. -"))); +")); // Specifying a precise rev to the old rev shouldn't actually update // anything because we already have the rev in the db. @@ -901,11 +901,11 @@ test!(dep_with_changed_submodule { println!("first run"); assert_that(project.cargo_process("run"), execs() - .with_stdout(&format!("[UPDATING] git repository `[..]`\n\ + .with_stdout("[UPDATING] git repository `[..]`\n\ [COMPILING] dep1 v0.5.0 ([..])\n\ [COMPILING] foo v0.5.0 ([..])\n\ [RUNNING] `target[..]foo[..]`\n\ - project2")) + project2") .with_stderr("") .with_status(0)); @@ -943,11 +943,11 @@ test!(dep_with_changed_submodule { println!("last run"); assert_that(project.cargo("run"), execs() - .with_stdout(&format!("[COMPILING] dep1 v0.5.0 ([..])\n\ + .with_stdout("[COMPILING] dep1 v0.5.0 ([..])\n\ [COMPILING] foo v0.5.0 ([..])\n\ [RUNNING] `target[..]foo[..]`\n\ project3\ - ")) + ") .with_stderr("") .with_status(0)); }); @@ -998,7 +998,7 @@ test!(dev_deps_with_testing { // Make sure we use the previous resolution of `bar` instead of updating it // a second time. assert_that(p.cargo("test"), - execs().with_stdout(&format!("\ + execs().with_stdout("\ [COMPILING] [..] v0.5.0 ([..]) [COMPILING] [..] v0.5.0 ([..] [RUNNING] target[..]foo-[..] @@ -1008,7 +1008,7 @@ test tests::foo ... ok test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured -"))); +")); }); test!(git_build_cmd_freshness { @@ -1328,14 +1328,14 @@ test!(update_ambiguous { assert_that(p.cargo("update") .arg("-p").arg("foo"), execs().with_status(101) - .with_stderr(&format!("\ + .with_stderr("\ [ERROR] There are multiple `foo` packages in your project, and the specification `foo` \ is ambiguous. Please re-run this command with `-p ` where `` is one of the \ following: foo:0.[..].0 foo:0.[..].0 -"))); +")); }); test!(update_one_dep_in_repo_with_many_deps { @@ -1553,12 +1553,12 @@ test!(switch_sources { p.build(); assert_that(p.cargo("build"), execs().with_status(0) - .with_stdout(&format!("\ + .with_stdout("\ [UPDATING] git repository `file://[..]a1` [COMPILING] a v0.5.0 ([..]a1#[..] [COMPILING] b v0.5.0 ([..]) [COMPILING] project v0.5.0 ([..]) -"))); +")); File::create(&p.root().join("b/Cargo.toml")).unwrap().write_all(format!(r#" [project] @@ -1571,12 +1571,12 @@ test!(switch_sources { assert_that(p.cargo("build"), execs().with_status(0) - .with_stdout(&format!("\ + .with_stdout("\ [UPDATING] git repository `file://[..]a2` [COMPILING] a v0.5.1 ([..]a2#[..] [COMPILING] b v0.5.0 ([..]) [COMPILING] project v0.5.0 ([..]) -"))); +")); }); test!(dont_require_submodules_are_checked_out { @@ -1677,11 +1677,11 @@ test!(lints_are_suppressed { .file("src/lib.rs", ""); assert_that(p.cargo_process("build"), - execs().with_status(0).with_stdout(&format!("\ + execs().with_status(0).with_stdout("\ [UPDATING] git repository `[..]` [COMPILING] a v0.5.0 ([..]) [COMPILING] foo v0.0.1 ([..]) -"))); +")); }); test!(denied_lints_are_allowed { @@ -1714,11 +1714,11 @@ test!(denied_lints_are_allowed { .file("src/lib.rs", ""); assert_that(p.cargo_process("build"), - execs().with_status(0).with_stdout(&format!("\ + execs().with_status(0).with_stdout("\ [UPDATING] git repository `[..]` [COMPILING] a v0.5.0 ([..]) [COMPILING] foo v0.0.1 ([..]) -"))); +")); }); test!(add_a_git_dep { diff --git a/tests/test_cargo_compile_path_deps.rs b/tests/test_cargo_compile_path_deps.rs index 3d050403d62..4ac9e2a15a4 100644 --- a/tests/test_cargo_compile_path_deps.rs +++ b/tests/test_cargo_compile_path_deps.rs @@ -174,7 +174,7 @@ test!(cargo_compile_with_root_dev_deps_with_testing { p2.build(); assert_that(p.cargo_process("test"), - execs().with_stdout(&format!("\ + execs().with_stdout("\ [COMPILING] [..] v0.5.0 ([..]) [COMPILING] [..] v0.5.0 ([..]) [RUNNING] target[..]foo-[..] @@ -183,7 +183,7 @@ running 0 tests test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured -"))); +")); }); test!(cargo_compile_with_transitive_dev_deps { @@ -509,7 +509,7 @@ test!(error_message_for_missing_manifest { assert_that(p.cargo_process("build"), execs().with_status(101) - .with_stderr(&format!("\ + .with_stderr("\ [ERROR] Unable to update file://[..] Caused by: @@ -517,7 +517,7 @@ Caused by: Caused by: [..] (os error [..]) -"))); +")); }); @@ -783,18 +783,18 @@ test!(custom_target_no_rebuild { p.build(); assert_that(p.cargo("build"), execs().with_status(0) - .with_stdout(&format!("\ + .with_stdout("\ [COMPILING] a v0.5.0 ([..]) [COMPILING] foo v0.5.0 ([..]) -"))); +")); assert_that(p.cargo("build") .arg("--manifest-path=b/Cargo.toml") .env("CARGO_TARGET_DIR", "target"), execs().with_status(0) - .with_stdout(&format!("\ + .with_stdout("\ [COMPILING] b v0.5.0 ([..]) -"))); +")); }); test!(override_and_depend { @@ -831,11 +831,11 @@ test!(override_and_depend { p.build(); assert_that(p.cargo("build").cwd(p.root().join("b")), execs().with_status(0) - .with_stdout(&format!("\ + .with_stdout("\ [COMPILING] a2 v0.5.0 ([..]) [COMPILING] a1 v0.5.0 ([..]) [COMPILING] b v0.5.0 ([..]) -"))); +")); }); test!(missing_path_dependency { @@ -853,7 +853,7 @@ test!(missing_path_dependency { p.build(); assert_that(p.cargo("build"), execs().with_status(101) - .with_stderr(format!("\ + .with_stderr("\ [ERROR] failed to update path override `[..]../whoa-this-does-not-exist` \ (defined in `[..]`) @@ -862,5 +862,5 @@ Caused by: Caused by: [..] (os error [..]) -"))); +")); }); diff --git a/tests/test_cargo_compile_plugins.rs b/tests/test_cargo_compile_plugins.rs index 94dcdd171de..3d4541fa422 100644 --- a/tests/test_cargo_compile_plugins.rs +++ b/tests/test_cargo_compile_plugins.rs @@ -262,8 +262,8 @@ test!(native_plugin_dependency_with_custom_ar_linker { foo.build(); assert_that(bar.cargo_process("build").arg("--verbose"), - execs().with_stdout(&format!("\ + execs().with_stdout("\ [COMPILING] foo v0.0.1 ([..]) [RUNNING] `rustc [..] -C ar=nonexistent-ar -C linker=nonexistent-linker [..]` -"))); +")); }); diff --git a/tests/test_cargo_concurrent.rs b/tests/test_cargo_concurrent.rs index abb5b4d46ab..eb778f41c32 100644 --- a/tests/test_cargo_concurrent.rs +++ b/tests/test_cargo_concurrent.rs @@ -117,9 +117,9 @@ test!(one_install_should_be_bad { let a = a.join().unwrap(); let (bad, good) = if a.status.code() == Some(101) {(a, b)} else {(b, a)}; - assert_that(bad, execs().with_status(101).with_stderr_contains(&format!("\ + assert_that(bad, execs().with_status(101).with_stderr_contains("\ [ERROR] binary `foo[..]` already exists in destination as part of `[..]` -"))); +")); assert_that(good, execs().with_status(0).with_stderr_contains("\ warning: be sure to add `[..]` to your PATH [..] ")); @@ -409,10 +409,10 @@ test!(debug_release_ok { let b = b.wait_with_output().unwrap(); let a = a.join().unwrap(); - assert_that(a, execs().with_status(0).with_stdout(&format!("\ + assert_that(a, execs().with_status(0).with_stdout("\ [COMPILING] foo v0.0.0 [..] -"))); - assert_that(b, execs().with_status(0).with_stdout(&format!("\ +")); + assert_that(b, execs().with_status(0).with_stdout("\ [COMPILING] foo v0.0.0 [..] -"))); +")); }); diff --git a/tests/test_cargo_cross_compile.rs b/tests/test_cargo_cross_compile.rs index 3b376341918..643431ef8a7 100644 --- a/tests/test_cargo_cross_compile.rs +++ b/tests/test_cargo_cross_compile.rs @@ -1,7 +1,6 @@ use std::env; use support::{project, execs, basic_bin_manifest}; -use support::{DOCTEST}; use hamcrest::{assert_that, existing_file}; use cargo::util::process; @@ -505,14 +504,14 @@ running 0 tests test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured -{doctest} foo +[DOCTEST] foo running 1 test test _0 ... ok test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured -", foo = p.url(), doctest = DOCTEST); +", foo = p.url()); assert_that(p.cargo_process("test"), execs().with_status(0) @@ -672,8 +671,8 @@ test!(build_script_needed_for_host_and_target { .with_stdout_contains(&format!("\ [RUNNING] `{dir}[..]target[..]build[..]d1-[..]build-script-build`", dir = p.root().display())) - .with_stdout_contains(&format!("\ -[RUNNING] `rustc d1[..]src[..]lib.rs [..]`")) + .with_stdout_contains("\ +[RUNNING] `rustc d1[..]src[..]lib.rs [..]`") .with_stdout_contains(&format!("\ [COMPILING] d2 v0.0.0 ({url}/d2)", url = p.url())) .with_stdout_contains(&format!("\ @@ -790,12 +789,12 @@ test!(plugin_build_script_right_arch { assert_that(p.cargo_process("build").arg("-v").arg("--target").arg(alternate()), execs().with_status(0) - .with_stdout(&format!("\ + .with_stdout("\ [COMPILING] foo v0.0.1 ([..]) [RUNNING] `rustc build.rs [..]` [RUNNING] `[..]build-script-build[..]` [RUNNING] `rustc src[..]lib.rs [..]` -"))); +")); }); test!(build_script_with_platform_specific_dependencies { @@ -889,7 +888,7 @@ test!(platform_specific_dependencies_do_not_leak { assert_that(p.cargo_process("build").arg("-v").arg("--target").arg(&target), execs().with_status(101) - .with_stderr(format!("\ + .with_stderr("\ [..] error: can't find crate for `d2`[..] [..] extern crate d2; [..] @@ -898,7 +897,7 @@ error: aborting due to previous error Caused by: [..] -"))); +")); }); test!(platform_specific_variables_reflected_in_build_scripts { diff --git a/tests/test_cargo_doc.rs b/tests/test_cargo_doc.rs index da19600c7f4..dc1b32b6036 100644 --- a/tests/test_cargo_doc.rs +++ b/tests/test_cargo_doc.rs @@ -202,10 +202,10 @@ test!(doc_lib_bin_same_name { assert_that(p.cargo_process("doc"), execs().with_status(101) - .with_stderr(&format!("\ + .with_stderr("\ [ERROR] cannot document a package where a library and a binary have the same name. \ Consider renaming one or marking the target as `doc = false` -"))); +")); }); test!(doc_dash_p { @@ -240,11 +240,11 @@ test!(doc_dash_p { assert_that(p.cargo_process("doc").arg("-p").arg("a"), execs().with_status(0) - .with_stdout(&format!("\ + .with_stdout("\ [..] b v0.0.1 (file://[..]) [..] b v0.0.1 (file://[..]) [DOCUMENTING] a v0.0.1 (file://[..]) -"))); +")); }); test!(doc_same_name { @@ -426,10 +426,10 @@ test!(doc_release { execs().with_status(0)); assert_that(p.cargo("doc").arg("--release").arg("-v"), execs().with_status(0) - .with_stdout(&format!("\ + .with_stdout("\ [DOCUMENTING] foo v0.0.1 ([..]) [RUNNING] `rustdoc src[..]lib.rs [..]` -"))); +")); }); test!(doc_multiple_deps { diff --git a/tests/test_cargo_features.rs b/tests/test_cargo_features.rs index e29d2fc6951..b3c73db7a27 100644 --- a/tests/test_cargo_features.rs +++ b/tests/test_cargo_features.rs @@ -22,12 +22,12 @@ test!(invalid1 { .file("src/main.rs", ""); assert_that(p.cargo_process("build"), - execs().with_status(101).with_stderr(&format!("\ + execs().with_status(101).with_stderr("\ [ERROR] failed to parse manifest at `[..]` Caused by: Feature `bar` includes `baz` which is neither a dependency nor another feature -"))); +")); }); test!(invalid2 { @@ -47,12 +47,12 @@ test!(invalid2 { .file("src/main.rs", ""); assert_that(p.cargo_process("build"), - execs().with_status(101).with_stderr(&format!("\ + execs().with_status(101).with_stderr("\ [ERROR] failed to parse manifest at `[..]` Caused by: Features and dependencies cannot have the same name: `bar` -"))); +")); }); test!(invalid3 { @@ -72,13 +72,13 @@ test!(invalid3 { .file("src/main.rs", ""); assert_that(p.cargo_process("build"), - execs().with_status(101).with_stderr(&format!("\ + execs().with_status(101).with_stderr("\ [ERROR] failed to parse manifest at `[..]` Caused by: Feature `bar` depends on `baz` which is not an optional dependency. Consider adding `optional = true` to the dependency -"))); +")); }); test!(invalid4 { @@ -103,9 +103,9 @@ test!(invalid4 { .file("bar/src/lib.rs", ""); assert_that(p.cargo_process("build"), - execs().with_status(101).with_stderr(&format!("\ + execs().with_status(101).with_stderr("\ [ERROR] Package `bar v0.0.1 ([..])` does not have these features: `bar` -"))); +")); let p = p.file("Cargo.toml", r#" [project] @@ -115,9 +115,9 @@ test!(invalid4 { "#); assert_that(p.cargo_process("build").arg("--features").arg("test"), - execs().with_status(101).with_stderr(&format!("\ + execs().with_status(101).with_stderr("\ [ERROR] Package `foo v0.0.1 ([..])` does not have these features: `test` -"))); +")); }); test!(invalid5 { @@ -135,12 +135,12 @@ test!(invalid5 { .file("src/main.rs", ""); assert_that(p.cargo_process("build"), - execs().with_status(101).with_stderr(&format!("\ + execs().with_status(101).with_stderr("\ [ERROR] failed to parse manifest at `[..]` Caused by: Dev-dependencies are not allowed to be optional: `bar` -"))); +")); }); test!(invalid6 { @@ -157,12 +157,12 @@ test!(invalid6 { .file("src/main.rs", ""); assert_that(p.cargo_process("build").arg("--features").arg("foo"), - execs().with_status(101).with_stderr(&format!("\ + execs().with_status(101).with_stderr("\ [ERROR] failed to parse manifest at `[..]` Caused by: Feature `foo` requires `bar` which is not an optional dependency -"))); +")); }); test!(invalid7 { @@ -180,12 +180,12 @@ test!(invalid7 { .file("src/main.rs", ""); assert_that(p.cargo_process("build").arg("--features").arg("foo"), - execs().with_status(101).with_stderr(&format!("\ + execs().with_status(101).with_stderr("\ [ERROR] failed to parse manifest at `[..]` Caused by: Feature `foo` requires `bar` which is not an optional dependency -"))); +")); }); test!(invalid8 { @@ -210,9 +210,9 @@ test!(invalid8 { .file("bar/src/lib.rs", ""); assert_that(p.cargo_process("build").arg("--features").arg("foo"), - execs().with_status(101).with_stderr(&format!("\ + execs().with_status(101).with_stderr("\ [ERROR] features in dependencies cannot enable features in other dependencies: `foo/bar` -"))); +")); }); test!(no_feature_doesnt_build { @@ -320,9 +320,9 @@ test!(cyclic_feature { .file("src/main.rs", ""); assert_that(p.cargo_process("build"), - execs().with_status(101).with_stderr(&format!("\ + execs().with_status(101).with_stderr("\ [ERROR] Cyclic feature dependency: feature `default` depends on itself -"))); +")); }); test!(cyclic_feature2 { @@ -340,9 +340,9 @@ test!(cyclic_feature2 { .file("src/main.rs", ""); assert_that(p.cargo_process("build"), - execs().with_status(101).with_stderr(&format!("\ + execs().with_status(101).with_stderr("\ [ERROR] Cyclic feature dependency: feature `[..]` depends on itself -"))); +")); }); test!(groups_on_groups_on_groups { @@ -538,10 +538,10 @@ test!(many_features_no_rebuilds { p.root().move_into_the_past().unwrap(); assert_that(p.cargo("build").arg("-v"), - execs().with_status(0).with_stdout(format!("\ + execs().with_status(0).with_stdout("\ [FRESH] a v0.1.0 ([..]/a) [FRESH] b v0.1.0 ([..]) -"))); +")); }); // Tests that all cmd lines work with `--features ""` @@ -764,9 +764,9 @@ test!(optional_and_dev_dep { .file("foo/src/lib.rs", ""); assert_that(p.cargo_process("build"), - execs().with_status(0).with_stdout(format!("\ + execs().with_status(0).with_stdout("\ [COMPILING] test v0.1.0 ([..]) -"))); +")); }); test!(activating_feature_activates_dep { diff --git a/tests/test_cargo_freshness.rs b/tests/test_cargo_freshness.rs index fa4fcd89e4a..6272254792f 100644 --- a/tests/test_cargo_freshness.rs +++ b/tests/test_cargo_freshness.rs @@ -249,11 +249,11 @@ test!(no_rebuild_transitive_target_deps { execs().with_status(0)); assert_that(p.cargo("test").arg("--no-run"), execs().with_status(0) - .with_stdout(&format!("\ + .with_stdout("\ [COMPILING] c v0.0.1 ([..]) [COMPILING] b v0.0.1 ([..]) [COMPILING] foo v0.0.1 ([..]) -"))); +")); }); test!(rerun_if_changed_in_dep { diff --git a/tests/test_cargo_init.rs b/tests/test_cargo_init.rs index 7a896fe6b07..d2075e3a7e0 100644 --- a/tests/test_cargo_init.rs +++ b/tests/test_cargo_init.rs @@ -125,9 +125,9 @@ test!(confused_by_multiple_lib_files { assert_that(cargo_process("init").arg("--vcs").arg("none") .env("USER", "foo").cwd(&path), - execs().with_status(101).with_stderr(&format!("\ + execs().with_status(101).with_stderr("\ [ERROR] cannot have a project with multiple libraries, found both `src/lib.rs` and `lib.rs` -"))); +")); assert_that(&paths::root().join("foo/Cargo.toml"), is_not(existing_file())); }); @@ -155,12 +155,12 @@ test!(multibin_project_name_clash { assert_that(cargo_process("init").arg("--vcs").arg("none") .env("USER", "foo").cwd(&path), - execs().with_status(101).with_stderr(&format!("\ + execs().with_status(101).with_stderr("\ [ERROR] multiple possible binary sources found: main.rs foo.rs cannot automatically generate Cargo.toml as the main target would be ambiguous -"))); +")); assert_that(&paths::root().join("foo/Cargo.toml"), is_not(existing_file())); }); @@ -228,10 +228,10 @@ test!(invalid_dir_name { fs::create_dir_all(&foo).unwrap(); assert_that(cargo_process("init").cwd(foo.clone()) .env("USER", "foo"), - execs().with_status(101).with_stderr(&format!("\ + execs().with_status(101).with_stderr("\ [ERROR] Invalid character `.` in crate name: `foo.bar` use --name to override crate name -"))); +")); assert_that(&foo.join("Cargo.toml"), is_not(existing_file())); }); @@ -241,10 +241,10 @@ test!(reserved_name { fs::create_dir_all(&test).unwrap(); assert_that(cargo_process("init").cwd(test.clone()) .env("USER", "foo"), - execs().with_status(101).with_stderr(&format!("\ + execs().with_status(101).with_stderr("\ [ERROR] The name `test` cannot be used as a crate name\n\ use --name to override crate name -"))); +")); assert_that(&test.join("Cargo.toml"), is_not(existing_file())); }); @@ -370,13 +370,13 @@ test!(with_argument { test!(unknown_flags { assert_that(cargo_process("init").arg("foo").arg("--flag"), execs().with_status(1) - .with_stderr(&format!("\ + .with_stderr("\ [ERROR] Unknown flag: '--flag' Usage: cargo init [options] [] cargo init -h | --help -"))); +")); }); #[cfg(not(windows))] diff --git a/tests/test_cargo_install.rs b/tests/test_cargo_install.rs index 1a99fcc43b6..85c0515ba44 100644 --- a/tests/test_cargo_install.rs +++ b/tests/test_cargo_install.rs @@ -8,7 +8,6 @@ use cargo::util::ProcessBuilder; use hamcrest::{assert_that, existing_file, is_not, Matcher, MatchResult}; use support::{project, execs}; -use support::{DOWNLOADING, INSTALLING, REPLACING, REMOVING}; use support::paths; use support::registry::Package; use support::git; @@ -85,12 +84,10 @@ test!(pick_max_version { assert_that(cargo_process("install").arg("foo"), execs().with_status(0).with_stdout(&format!("\ [UPDATING] registry `[..]` -{downloading} foo v0.0.2 (registry file://[..]) +[DOWNLOADING] foo v0.0.2 (registry file://[..]) [COMPILING] foo v0.0.2 (registry file://[..]) -{installing} {home}[..]bin[..]foo[..] +[INSTALLING] {home}[..]bin[..]foo[..] ", - downloading = DOWNLOADING, - installing = INSTALLING, home = cargo_home().display()))); assert_that(cargo_home(), has_installed_exe("foo")); }); @@ -98,22 +95,22 @@ test!(pick_max_version { test!(missing { pkg("foo", "0.0.1"); assert_that(cargo_process("install").arg("bar"), - execs().with_status(101).with_stderr(&format!("\ + execs().with_status(101).with_stderr("\ [ERROR] could not find `bar` in `registry file://[..]` -"))); +")); }); test!(bad_version { pkg("foo", "0.0.1"); assert_that(cargo_process("install").arg("foo").arg("--vers=0.2.0"), - execs().with_status(101).with_stderr(&format!("\ + execs().with_status(101).with_stderr("\ [ERROR] could not find `foo` in `registry file://[..]` with version `0.2.0` -"))); +")); }); test!(no_crate { assert_that(cargo_process("install"), - execs().with_status(101).with_stderr(&format!("\ + execs().with_status(101).with_stderr("\ [ERROR] `[..]` is not a crate root; specify a crate to install [..] Caused by: @@ -121,7 +118,7 @@ Caused by: Caused by: [..] (os error [..]) -"))); +")); }); test!(install_location_precedence { @@ -187,10 +184,10 @@ test!(install_path { execs().with_status(0)); assert_that(cargo_home(), has_installed_exe("foo")); assert_that(cargo_process("install").arg("--path").arg(".").cwd(p.root()), - execs().with_status(101).with_stderr(&format!("\ + execs().with_status(101).with_stderr("\ [ERROR] binary `foo[..]` already exists in destination as part of `foo v0.1.0 [..]` Add --force to overwrite -"))); +")); }); test!(multiple_crates_error { @@ -212,9 +209,9 @@ test!(multiple_crates_error { p.build(); assert_that(cargo_process("install").arg("--git").arg(p.url().to_string()), - execs().with_status(101).with_stderr(&format!("\ + execs().with_status(101).with_stderr("\ [ERROR] multiple packages with binaries found: bar, foo -"))); +")); }); test!(multiple_crates_select { @@ -327,9 +324,9 @@ test!(no_binaries_or_examples { p.build(); assert_that(cargo_process("install").arg("--path").arg(p.root()), - execs().with_status(101).with_stderr(&format!("\ + execs().with_status(101).with_stderr("\ [ERROR] no packages found with binaries or examples -"))); +")); }); test!(no_binaries { @@ -345,9 +342,9 @@ test!(no_binaries { p.build(); assert_that(cargo_process("install").arg("--path").arg(p.root()).arg("foo"), - execs().with_status(101).with_stderr(&format!("\ + execs().with_status(101).with_stderr("\ [ERROR] specified package has no binaries -"))); +")); }); test!(examples { @@ -383,11 +380,11 @@ test!(install_twice { assert_that(cargo_process("install").arg("--path").arg(p.root()), execs().with_status(0)); assert_that(cargo_process("install").arg("--path").arg(p.root()), - execs().with_status(101).with_stderr(&format!("\ + execs().with_status(101).with_stderr("\ [ERROR] binary `foo-bin1[..]` already exists in destination as part of `foo v0.1.0 ([..])` binary `foo-bin2[..]` already exists in destination as part of `foo v0.1.0 ([..])` Add --force to overwrite -"))); +")); }); test!(install_force { @@ -417,9 +414,8 @@ test!(install_force { assert_that(cargo_process("install").arg("--force").arg("--path").arg(p.root()), execs().with_status(0).with_stdout(&format!("\ [COMPILING] foo v0.2.0 ([..]) -{replacing} {home}[..]bin[..]foo[..] +[REPLACING] {home}[..]bin[..]foo[..] ", - replacing = REPLACING, home = cargo_home().display()))); assert_that(cargo_process("install").arg("--list"), @@ -458,11 +454,9 @@ test!(install_force_partial_overlap { assert_that(cargo_process("install").arg("--force").arg("--path").arg(p.root()), execs().with_status(0).with_stdout(&format!("\ [COMPILING] foo v0.2.0 ([..]) -{installing} {home}[..]bin[..]foo-bin3[..] -{replacing} {home}[..]bin[..]foo-bin2[..] +[INSTALLING] {home}[..]bin[..]foo-bin3[..] +[REPLACING] {home}[..]bin[..]foo-bin2[..] ", - installing = INSTALLING, - replacing = REPLACING, home = cargo_home().display()))); assert_that(cargo_process("install").arg("--list"), @@ -508,9 +502,8 @@ test!(install_force_bin { .arg(p.root()), execs().with_status(0).with_stdout(&format!("\ [COMPILING] foo v0.2.0 ([..]) -{replacing} {home}[..]bin[..]foo-bin2[..] +[REPLACING] {home}[..]bin[..]foo-bin2[..] ", - replacing = REPLACING, home = cargo_home().display()))); assert_that(cargo_process("install").arg("--list"), @@ -534,7 +527,7 @@ test!(compile_failure { p.build(); assert_that(cargo_process("install").arg("--path").arg(p.root()), - execs().with_status(101).with_stderr(&format!("\ + execs().with_status(101).with_stderr("\ error: main function not found error: aborting due to previous error [ERROR] failed to compile `foo v0.1.0 (file://[..])`, intermediate artifacts can be \ @@ -544,7 +537,7 @@ Caused by: Could not compile `foo`. To learn more, run the command again with --verbose. -"))); +")); }); test!(git_repo { @@ -562,9 +555,8 @@ test!(git_repo { execs().with_status(0).with_stdout(&format!("\ [UPDATING] git repository `[..]` [COMPILING] foo v0.1.0 ([..]) -{installing} {home}[..]bin[..]foo[..] +[INSTALLING] {home}[..]bin[..]foo[..] ", - installing = INSTALLING, home = cargo_home().display()))); assert_that(cargo_home(), has_installed_exe("foo")); assert_that(cargo_home(), has_installed_exe("foo")); @@ -593,9 +585,9 @@ foo v0.0.1 (registry [..]): test!(uninstall_pkg_does_not_exist { assert_that(cargo_process("uninstall").arg("foo"), - execs().with_status(101).with_stderr(&format!("\ + execs().with_status(101).with_stderr("\ [ERROR] package id specification `foo` matched no packages -"))); +")); }); test!(uninstall_bin_does_not_exist { @@ -604,9 +596,9 @@ test!(uninstall_bin_does_not_exist { assert_that(cargo_process("install").arg("foo"), execs().with_status(0)); assert_that(cargo_process("uninstall").arg("foo").arg("--bin=bar"), - execs().with_status(101).with_stderr(&format!("\ + execs().with_status(101).with_stderr("\ [ERROR] binary `bar[..]` not installed as part of `foo v0.0.1 ([..])` -"))); +")); }); test!(uninstall_piecemeal { @@ -627,23 +619,23 @@ test!(uninstall_piecemeal { assert_that(cargo_home(), has_installed_exe("bar")); assert_that(cargo_process("uninstall").arg("foo").arg("--bin=bar"), - execs().with_status(0).with_stdout(&format!("\ -{removing} [..]bar[..] -", removing = REMOVING))); + execs().with_status(0).with_stdout("\ +[REMOVING] [..]bar[..] +")); assert_that(cargo_home(), has_installed_exe("foo")); assert_that(cargo_home(), is_not(has_installed_exe("bar"))); assert_that(cargo_process("uninstall").arg("foo").arg("--bin=foo"), - execs().with_status(0).with_stdout(&format!("\ -{removing} [..]foo[..] -", removing = REMOVING))); + execs().with_status(0).with_stdout("\ +[REMOVING] [..]foo[..] +")); assert_that(cargo_home(), is_not(has_installed_exe("foo"))); assert_that(cargo_process("uninstall").arg("foo"), - execs().with_status(101).with_stderr(&format!("\ + execs().with_status(101).with_stderr("\ [ERROR] package id specification `foo` matched no packages -"))); +")); }); test!(subcommand_works_out_of_the_box { @@ -691,9 +683,9 @@ test!(do_not_rebuilds_on_local_install { assert_that(p.cargo_process("build").arg("--release"), execs().with_status(0)); assert_that(cargo_process("install").arg("--path").arg(p.root()), - execs().with_status(0).with_stdout(&format!("\ -{installing} [..] -", installing = INSTALLING)).with_stderr("\ + execs().with_status(0).with_stdout("\ +[INSTALLING] [..] +").with_stderr("\ warning: be sure to add `[..]` to your PATH to be able to run the installed binaries ")); diff --git a/tests/test_cargo_metadata.rs b/tests/test_cargo_metadata.rs index ec030ced9d8..4a370e598dc 100644 --- a/tests/test_cargo_metadata.rs +++ b/tests/test_cargo_metadata.rs @@ -177,11 +177,11 @@ test!(cargo_metadata_with_invalid_manifest { .file("Cargo.toml", ""); assert_that(p.cargo_process("metadata"), execs().with_status(101) - .with_stderr(&format!("\ + .with_stderr("\ [ERROR] failed to parse manifest at `[..]` Caused by: - no `package` or `project` section found."))) + no `package` or `project` section found.")) }); const MANIFEST_OUTPUT: &'static str= @@ -238,8 +238,8 @@ test!(cargo_metadata_no_deps_path_to_cargo_toml_parent_relative { .arg("--manifest-path").arg("foo") .cwd(p.root().parent().unwrap()), execs().with_status(101) - .with_stderr(&format!("[ERROR] the manifest-path must be \ - a path to a Cargo.toml file"))); + .with_stderr("[ERROR] the manifest-path must be \ + a path to a Cargo.toml file")); }); test!(cargo_metadata_no_deps_path_to_cargo_toml_parent_absolute { @@ -251,8 +251,8 @@ test!(cargo_metadata_no_deps_path_to_cargo_toml_parent_absolute { .arg("--manifest-path").arg(p.root()) .cwd(p.root().parent().unwrap()), execs().with_status(101) - .with_stderr(&format!("[ERROR] the manifest-path must be \ - a path to a Cargo.toml file"))); + .with_stderr("[ERROR] the manifest-path must be \ + a path to a Cargo.toml file")); }); test!(cargo_metadata_no_deps_cwd { diff --git a/tests/test_cargo_new.rs b/tests/test_cargo_new.rs index 3020c5dbd77..4a73925c230 100644 --- a/tests/test_cargo_new.rs +++ b/tests/test_cargo_new.rs @@ -67,13 +67,13 @@ test!(simple_git { test!(no_argument { assert_that(cargo_process("new"), execs().with_status(1) - .with_stderr(&format!("\ + .with_stderr("\ [ERROR] Invalid arguments. Usage: cargo new [options] cargo new -h | --help -"))); +")); }); test!(existing { @@ -88,17 +88,17 @@ test!(existing { test!(invalid_characters { assert_that(cargo_process("new").arg("foo.rs"), execs().with_status(101) - .with_stderr(&format!("\ + .with_stderr("\ [ERROR] Invalid character `.` in crate name: `foo.rs` -use --name to override crate name"))); +use --name to override crate name")); }); test!(reserved_name { assert_that(cargo_process("new").arg("test"), execs().with_status(101) - .with_stderr(&format!("\ + .with_stderr("\ [ERROR] The name `test` cannot be used as a crate name\n\ -use --name to override crate name"))); +use --name to override crate name")); }); test!(rust_prefix_stripped { @@ -281,11 +281,11 @@ test!(subpackage_git_with_vcs_arg { test!(unknown_flags { assert_that(cargo_process("new").arg("foo").arg("--flag"), execs().with_status(1) - .with_stderr(&format!("\ + .with_stderr("\ [ERROR] Unknown flag: '--flag' Usage: cargo new [..] cargo new [..] -"))); +")); }); diff --git a/tests/test_cargo_overrides.rs b/tests/test_cargo_overrides.rs index 3d8eb1097c2..216c3964301 100644 --- a/tests/test_cargo_overrides.rs +++ b/tests/test_cargo_overrides.rs @@ -1,7 +1,7 @@ use hamcrest::assert_that; use support::registry::{registry, Package}; -use support::{execs, project, DOWNLOADING}; +use support::{execs, project}; use support::git; use support::paths; @@ -41,12 +41,12 @@ test!(override_simple { "); assert_that(p.cargo_process("build"), - execs().with_status(0).with_stdout(&format!("\ + execs().with_status(0).with_stdout("\ [UPDATING] registry `file://[..]` [UPDATING] git repository `[..]` [COMPILING] foo v0.1.0 (file://[..]) [COMPILING] local v0.0.1 (file://[..]) -"))); +")); }); test!(missing_version { @@ -135,14 +135,14 @@ test!(transitive { .file("src/lib.rs", ""); assert_that(p.cargo_process("build"), - execs().with_status(0).with_stdout(&format!("\ + execs().with_status(0).with_stdout("\ [UPDATING] registry `file://[..]` [UPDATING] git repository `[..]` -{downloading} bar v0.2.0 (registry [..]) +[DOWNLOADING] bar v0.2.0 (registry [..]) [COMPILING] foo v0.1.0 (file://[..]) [COMPILING] bar v0.2.0 (registry [..]) [COMPILING] local v0.0.1 (file://[..]) -", downloading = DOWNLOADING))); +")); assert_that(p.cargo("build"), execs().with_status(0).with_stdout("")); }); @@ -181,12 +181,12 @@ test!(persists_across_rebuilds { "); assert_that(p.cargo_process("build"), - execs().with_status(0).with_stdout(&format!("\ + execs().with_status(0).with_stdout("\ [UPDATING] registry `file://[..]` [UPDATING] git repository `file://[..]` [COMPILING] foo v0.1.0 (file://[..]) [COMPILING] local v0.0.1 (file://[..]) -"))); +")); assert_that(p.cargo("build"), execs().with_status(0).with_stdout("")); @@ -226,11 +226,11 @@ test!(replace_registry_with_path { "); assert_that(p.cargo_process("build"), - execs().with_status(0).with_stdout(&format!("\ + execs().with_status(0).with_stdout("\ [UPDATING] registry `file://[..]` [COMPILING] foo v0.1.0 (file://[..]) [COMPILING] local v0.0.1 (file://[..]) -"))); +")); }); test!(use_a_spec_to_select { @@ -281,16 +281,16 @@ test!(use_a_spec_to_select { "); assert_that(p.cargo_process("build"), - execs().with_status(0).with_stdout(&format!("\ + execs().with_status(0).with_stdout("\ [UPDATING] registry `file://[..]` [UPDATING] git repository `[..]` -{downloading} [..] -{downloading} [..] +[DOWNLOADING] [..] +[DOWNLOADING] [..] [COMPILING] [..] [COMPILING] [..] [COMPILING] [..] [COMPILING] local v0.0.1 (file://[..]) -", downloading = DOWNLOADING))); +")); }); test!(override_adds_some_deps { @@ -326,26 +326,26 @@ test!(override_adds_some_deps { .file("src/lib.rs", ""); assert_that(p.cargo_process("build"), - execs().with_status(0).with_stdout(&format!("\ + execs().with_status(0).with_stdout("\ [UPDATING] registry `file://[..]` [UPDATING] git repository `[..]` -{downloading} foo v0.1.1 (registry [..]) +[DOWNLOADING] foo v0.1.1 (registry [..]) [COMPILING] foo v0.1.1 (registry [..]) [COMPILING] bar v0.1.0 ([..]) [COMPILING] local v0.0.1 (file://[..]) -", downloading = DOWNLOADING))); +")); assert_that(p.cargo("build"), execs().with_status(0).with_stdout("")); Package::new("foo", "0.1.2").publish(); assert_that(p.cargo("update").arg("-p").arg(&format!("{}#bar", foo.url())), - execs().with_status(0).with_stdout(&format!("\ + execs().with_status(0).with_stdout("\ [UPDATING] git repository `file://[..]` -"))); +")); assert_that(p.cargo("update").arg("-p").arg(&format!("{}#bar", registry())), - execs().with_status(0).with_stdout(&format!("\ + execs().with_status(0).with_stdout("\ [UPDATING] registry `file://[..]` -"))); +")); assert_that(p.cargo("build"), execs().with_status(0).with_stdout("")); }); diff --git a/tests/test_cargo_package.rs b/tests/test_cargo_package.rs index f608fbbcb79..6cd97c1efd5 100644 --- a/tests/test_cargo_package.rs +++ b/tests/test_cargo_package.rs @@ -7,7 +7,6 @@ use git2; use tar::Archive; use support::{project, execs, paths, git, path2url}; -use support::{PACKAGING, VERIFYING, ARCHIVING}; use hamcrest::{assert_that, existing_file}; fn setup() { @@ -31,12 +30,10 @@ test!(simple { assert_that(p.cargo_process("package"), execs().with_status(0).with_stdout(&format!("\ -{packaging} foo v0.0.1 ({dir}) -{verifying} foo v0.0.1 ({dir}) +[PACKAGING] foo v0.0.1 ({dir}) +[VERIFYING] foo v0.0.1 ({dir}) [COMPILING] foo v0.0.1 ({dir}[..]) ", - packaging = PACKAGING, - verifying = VERIFYING, dir = p.url()))); assert_that(&p.root().join("target/package/foo-0.0.1.crate"), existing_file()); assert_that(p.cargo("package").arg("-l"), @@ -75,12 +72,10 @@ test!(metadata_warning { "#); assert_that(p.cargo_process("package"), execs().with_status(0).with_stdout(&format!("\ -{packaging} foo v0.0.1 ({dir}) -{verifying} foo v0.0.1 ({dir}) +[PACKAGING] foo v0.0.1 ({dir}) +[VERIFYING] foo v0.0.1 ({dir}) [COMPILING] foo v0.0.1 ({dir}[..]) ", - packaging = PACKAGING, - verifying = VERIFYING, dir = p.url())) .with_stderr("\ warning: manifest has no description, license, license-file, documentation, \ @@ -100,12 +95,10 @@ http://doc.crates.io/manifest.html#package-metadata for more info.")); "#); assert_that(p.cargo_process("package"), execs().with_status(0).with_stdout(&format!("\ -{packaging} foo v0.0.1 ({dir}) -{verifying} foo v0.0.1 ({dir}) +[PACKAGING] foo v0.0.1 ({dir}) +[VERIFYING] foo v0.0.1 ({dir}) [COMPILING] foo v0.0.1 ({dir}[..]) ", - packaging = PACKAGING, - verifying = VERIFYING, dir = p.url())) .with_stderr("\ warning: manifest has no description, documentation, homepage or repository. See \ @@ -126,12 +119,10 @@ http://doc.crates.io/manifest.html#package-metadata for more info.")); "#); assert_that(p.cargo_process("package"), execs().with_status(0).with_stdout(&format!("\ -{packaging} foo v0.0.1 ({dir}) -{verifying} foo v0.0.1 ({dir}) +[PACKAGING] foo v0.0.1 ({dir}) +[VERIFYING] foo v0.0.1 ({dir}) [COMPILING] foo v0.0.1 ({dir}[..]) ", - packaging = PACKAGING, - verifying = VERIFYING, dir = p.url()))); }); @@ -161,24 +152,20 @@ test!(package_verbose { println!("package main repo"); assert_that(cargo.clone().arg("package").arg("-v").arg("--no-verify"), - execs().with_status(0).with_stdout(&format!("\ -{packaging} foo v0.0.1 ([..]) -{archiving} [..] -{archiving} [..] -", - packaging = PACKAGING, - archiving = ARCHIVING))); + execs().with_status(0).with_stdout("\ +[PACKAGING] foo v0.0.1 ([..]) +[ARCHIVING] [..] +[ARCHIVING] [..] +")); println!("package sub-repo"); assert_that(cargo.arg("package").arg("-v").arg("--no-verify") .cwd(p.root().join("a")), - execs().with_status(0).with_stdout(&format!("\ -{packaging} a v0.0.1 ([..]) -{archiving} [..] -{archiving} [..] -", - packaging = PACKAGING, - archiving = ARCHIVING))); + execs().with_status(0).with_stdout("\ +[PACKAGING] a v0.0.1 ([..]) +[ARCHIVING] [..] +[ARCHIVING] [..] +")); }); test!(package_verification { @@ -196,12 +183,10 @@ test!(package_verification { execs().with_status(0)); assert_that(p.cargo("package"), execs().with_status(0).with_stdout(&format!("\ -{packaging} foo v0.0.1 ({dir}) -{verifying} foo v0.0.1 ({dir}) +[PACKAGING] foo v0.0.1 ({dir}) +[VERIFYING] foo v0.0.1 ({dir}) [COMPILING] foo v0.0.1 ({dir}[..]) ", - packaging = PACKAGING, - verifying = VERIFYING, dir = p.url()))); }); @@ -221,11 +206,11 @@ test!(exclude { .file("src/bar.txt", ""); assert_that(p.cargo_process("package").arg("--no-verify").arg("-v"), - execs().with_status(0).with_stdout(&format!("\ -{packaging} foo v0.0.1 ([..]) -{archiving} [..] -{archiving} [..] -", packaging = PACKAGING, archiving = ARCHIVING))); + execs().with_status(0).with_stdout("\ +[PACKAGING] foo v0.0.1 ([..]) +[ARCHIVING] [..] +[ARCHIVING] [..] +")); }); test!(include { @@ -245,12 +230,12 @@ test!(include { .file("src/bar.txt", ""); // should be ignored when packaging assert_that(p.cargo_process("package").arg("--no-verify").arg("-v"), - execs().with_status(0).with_stdout(&format!("\ -{packaging} foo v0.0.1 ([..]) -{archiving} [..] -{archiving} [..] -{archiving} [..] -", packaging = PACKAGING, archiving = ARCHIVING))); + execs().with_status(0).with_stdout("\ +[PACKAGING] foo v0.0.1 ([..]) +[ARCHIVING] [..] +[ARCHIVING] [..] +[ARCHIVING] [..] +")); }); test!(package_lib_with_bin { @@ -284,16 +269,14 @@ test!(package_new_git_repo { assert_that(::cargo_process().arg("package").cwd(p.root()) .arg("--no-verify").arg("-v"), - execs().with_status(0).with_stdout(&format!("\ -{packaging} foo v0.0.1 ([..]) -{archiving} [..] -{archiving} [..] -", packaging = PACKAGING, archiving = ARCHIVING))); + execs().with_status(0).with_stdout("\ +[PACKAGING] foo v0.0.1 ([..]) +[ARCHIVING] [..] +[ARCHIVING] [..] +")); }); test!(package_git_submodule { - use std::str::from_utf8; - let project = git::new("foo", |project| { project.file("Cargo.toml", r#" [project] @@ -319,9 +302,9 @@ test!(package_git_submodule { repository.reset(&repository.revparse_single("HEAD").unwrap(), git2::ResetType::Hard, None).unwrap(); - let result = project.cargo("package").arg("--no-verify").arg("-v").exec_with_output().unwrap(); - assert!(result.status.success()); - assert!(from_utf8(&result.stdout).unwrap().contains(&format!("{} bar/Makefile", ARCHIVING))); + assert_that(::cargo_process().arg("package").cwd(project.root()) + .arg("--no-verify").arg("-v"), + execs().with_status(0).with_stdout_contains("[ARCHIVING] bar/Makefile")); }); test!(no_duplicates_from_modified_tracked_files { @@ -344,10 +327,10 @@ test!(no_duplicates_from_modified_tracked_files { cargo.cwd(p.root()); assert_that(cargo.clone().arg("build"), execs().with_status(0)); assert_that(cargo.arg("package").arg("--list"), - execs().with_status(0).with_stdout(&format!("\ + execs().with_status(0).with_stdout("\ Cargo.toml src/main.rs -"))); +")); }); test!(ignore_nested { @@ -372,12 +355,10 @@ test!(ignore_nested { assert_that(p.cargo_process("package"), execs().with_status(0).with_stdout(&format!("\ -{packaging} nested v0.0.1 ({dir}) -{verifying} nested v0.0.1 ({dir}) +[PACKAGING] nested v0.0.1 ({dir}) +[VERIFYING] nested v0.0.1 ({dir}) [COMPILING] nested v0.0.1 ({dir}[..]) ", - packaging = PACKAGING, - verifying = VERIFYING, dir = p.url()))); assert_that(&p.root().join("target/package/nested-0.0.1.crate"), existing_file()); assert_that(p.cargo("package").arg("-l"), @@ -418,11 +399,11 @@ test!(package_weird_characters { .file("src/:foo", ""); assert_that(p.cargo_process("package"), - execs().with_status(101).with_stderr(format!("\ + execs().with_status(101).with_stderr("\ warning: [..] [ERROR] failed to prepare local package for uploading Caused by: cannot package a filename with a special character `:`: src/:foo -"))); +")); }); diff --git a/tests/test_cargo_publish.rs b/tests/test_cargo_publish.rs index d6b2fc7e896..3d5e65de00b 100644 --- a/tests/test_cargo_publish.rs +++ b/tests/test_cargo_publish.rs @@ -8,7 +8,6 @@ use tar::Archive; use url::Url; use support::{project, execs}; -use support::{PACKAGING, UPLOADING}; use support::paths; use support::git::repo; @@ -52,11 +51,9 @@ test!(simple { assert_that(p.cargo_process("publish").arg("--no-verify"), execs().with_status(0).with_stdout(&format!("\ [UPDATING] registry `{reg}` -{packaging} foo v0.0.1 ({dir}) -{uploading} foo v0.0.1 ({dir}) +[PACKAGING] foo v0.0.1 ({dir}) +[UPLOADING] foo v0.0.1 ({dir}) ", - uploading = UPLOADING, - packaging = PACKAGING, dir = p.url(), reg = registry()))); @@ -102,10 +99,10 @@ test!(git_deps { .file("src/main.rs", "fn main() {}"); assert_that(p.cargo_process("publish").arg("-v").arg("--no-verify"), - execs().with_status(101).with_stderr(&format!("\ + execs().with_status(101).with_stderr("\ [ERROR] all dependencies must come from the same source. dependency `foo` comes from git://path/to/nowhere instead -"))); +")); }); test!(path_dependency_no_version { @@ -131,10 +128,10 @@ test!(path_dependency_no_version { .file("bar/src/lib.rs", ""); assert_that(p.cargo_process("publish"), - execs().with_status(101).with_stderr(&format!("\ + execs().with_status(101).with_stderr("\ [ERROR] all path dependencies must have a version specified when publishing. dependency `bar` does not specify a version -"))); +")); }); test!(unpublishable_crate { @@ -151,8 +148,8 @@ test!(unpublishable_crate { .file("src/main.rs", "fn main() {}"); assert_that(p.cargo_process("publish"), - execs().with_status(101).with_stderr(&format!("\ + execs().with_status(101).with_stderr("\ [ERROR] some crates cannot be published. `foo` is marked as unpublishable -"))); +")); }); diff --git a/tests/test_cargo_read_manifest.rs b/tests/test_cargo_read_manifest.rs index 476bc581915..f5e72ab3a6e 100644 --- a/tests/test_cargo_read_manifest.rs +++ b/tests/test_cargo_read_manifest.rs @@ -58,8 +58,8 @@ test!(cargo_read_manifest_path_to_cargo_toml_parent_relative { .arg("--manifest-path").arg("foo") .cwd(p.root().parent().unwrap()), execs().with_status(101) - .with_stderr(&format!("[ERROR] the manifest-path must be \ - a path to a Cargo.toml file"))); + .with_stderr("[ERROR] the manifest-path must be \ + a path to a Cargo.toml file")); }); test!(cargo_read_manifest_path_to_cargo_toml_parent_absolute { @@ -71,8 +71,8 @@ test!(cargo_read_manifest_path_to_cargo_toml_parent_absolute { .arg("--manifest-path").arg(p.root()) .cwd(p.root().parent().unwrap()), execs().with_status(101) - .with_stderr(&format!("[ERROR] the manifest-path must be \ - a path to a Cargo.toml file"))); + .with_stderr("[ERROR] the manifest-path must be \ + a path to a Cargo.toml file")); }); test!(cargo_read_manifest_cwd { diff --git a/tests/test_cargo_registry.rs b/tests/test_cargo_registry.rs index 254007c7bf0..e438b5d277a 100644 --- a/tests/test_cargo_registry.rs +++ b/tests/test_cargo_registry.rs @@ -2,7 +2,6 @@ use std::fs::{self, File}; use std::io::prelude::*; use support::{project, execs}; -use support::{DOWNLOADING, PACKAGING, VERIFYING, ADDING, REMOVING}; use support::paths::{self, CargoPathExt}; use support::registry::{self, Package}; use support::git; @@ -30,11 +29,10 @@ test!(simple { assert_that(p.cargo_process("build"), execs().with_status(0).with_stdout(&format!("\ [UPDATING] registry `{reg}` -{downloading} bar v0.0.1 (registry file://[..]) +[DOWNLOADING] bar v0.0.1 (registry file://[..]) [COMPILING] bar v0.0.1 (registry file://[..]) [COMPILING] foo v0.0.1 ({dir}) ", - downloading = DOWNLOADING, dir = p.url(), reg = registry::registry()))); @@ -68,13 +66,12 @@ test!(deps { assert_that(p.cargo_process("build"), execs().with_status(0).with_stdout(&format!("\ [UPDATING] registry `{reg}` -{downloading} [..] v0.0.1 (registry file://[..]) -{downloading} [..] v0.0.1 (registry file://[..]) +[DOWNLOADING] [..] v0.0.1 (registry file://[..]) +[DOWNLOADING] [..] v0.0.1 (registry file://[..]) [COMPILING] baz v0.0.1 (registry file://[..]) [COMPILING] bar v0.0.1 (registry file://[..]) [COMPILING] foo v0.0.1 ({dir}) ", - downloading = DOWNLOADING, dir = p.url(), reg = registry::registry()))); }); @@ -95,11 +92,11 @@ test!(nonexistent { .file("src/main.rs", "fn main() {}"); assert_that(p.cargo_process("build"), - execs().with_status(101).with_stderr(&format!("\ + execs().with_status(101).with_stderr("\ [ERROR] no matching package named `nonexistent` found (required by `foo`) location searched: registry file://[..] version required: >= 0.0.0 -"))); +")); }); test!(wrong_version { @@ -119,23 +116,23 @@ test!(wrong_version { Package::new("foo", "0.0.2").publish(); assert_that(p.cargo_process("build"), - execs().with_status(101).with_stderr(&format!("\ + execs().with_status(101).with_stderr("\ [ERROR] no matching package named `foo` found (required by `foo`) location searched: registry file://[..] version required: >= 1.0.0 versions found: 0.0.2, 0.0.1 -"))); +")); Package::new("foo", "0.0.3").publish(); Package::new("foo", "0.0.4").publish(); assert_that(p.cargo_process("build"), - execs().with_status(101).with_stderr(&format!("\ + execs().with_status(101).with_stderr("\ [ERROR] no matching package named `foo` found (required by `foo`) location searched: registry file://[..] version required: >= 1.0.0 versions found: 0.0.4, 0.0.3, 0.0.2, ... -"))); +")); }); test!(bad_cksum { @@ -156,7 +153,7 @@ test!(bad_cksum { File::create(&pkg.archive_dst()).unwrap(); assert_that(p.cargo_process("build").arg("-v"), - execs().with_status(101).with_stderr(&format!("\ + execs().with_status(101).with_stderr("\ [ERROR] unable to get packages from source Caused by: @@ -164,7 +161,7 @@ Caused by: Caused by: failed to verify the checksum of `bad-cksum v0.0.1 (registry file://[..])` -"))); +")); }); test!(update_registry { @@ -183,22 +180,21 @@ test!(update_registry { .file("src/main.rs", "fn main() {}"); assert_that(p.cargo_process("build"), - execs().with_status(101).with_stderr(&format!("\ + execs().with_status(101).with_stderr("\ [ERROR] no matching package named `notyet` found (required by `foo`) location searched: registry file://[..] version required: >= 0.0.0 -"))); +")); Package::new("notyet", "0.0.1").publish(); assert_that(p.cargo("build"), execs().with_status(0).with_stdout(&format!("\ [UPDATING] registry `{reg}` -{downloading} notyet v0.0.1 (registry file://[..]) +[DOWNLOADING] notyet v0.0.1 (registry file://[..]) [COMPILING] notyet v0.0.1 (registry file://[..]) [COMPILING] foo v0.0.1 ({dir}) ", - downloading = DOWNLOADING, dir = p.url(), reg = registry::registry()))); }); @@ -231,31 +227,26 @@ test!(package_with_path_deps { p.build(); assert_that(p.cargo("package").arg("-v"), - execs().with_status(101).with_stderr(&format!("\ + execs().with_status(101).with_stderr("\ [ERROR] failed to verify package tarball Caused by: no matching package named `notyet` found (required by `foo`) location searched: registry file://[..] version required: ^0.0.1 -"))); +")); Package::new("notyet", "0.0.1").publish(); assert_that(p.cargo("package"), execs().with_status(0).with_stdout(format!("\ -{packaging} foo v0.0.1 ({dir}) -{verifying} foo v0.0.1 ({dir}) +[PACKAGING] foo v0.0.1 ({dir}) +[VERIFYING] foo v0.0.1 ({dir}) [UPDATING] registry `[..]` -{downloading} notyet v0.0.1 (registry file://[..]) +[DOWNLOADING] notyet v0.0.1 (registry file://[..]) [COMPILING] notyet v0.0.1 (registry file://[..]) [COMPILING] foo v0.0.1 ({dir}[..]) -", - packaging = PACKAGING, - verifying = VERIFYING, - downloading = DOWNLOADING, - dir = p.url(), -))); +", dir = p.url()))); }); test!(lockfile_locks { @@ -277,10 +268,10 @@ test!(lockfile_locks { assert_that(p.cargo("build"), execs().with_status(0).with_stdout(&format!("\ [UPDATING] registry `[..]` -{downloading} bar v0.0.1 (registry file://[..]) +[DOWNLOADING] bar v0.0.1 (registry file://[..]) [COMPILING] bar v0.0.1 (registry file://[..]) [COMPILING] foo v0.0.1 ({dir}) -", downloading = DOWNLOADING, +", dir = p.url()))); p.root().move_into_the_past().unwrap(); @@ -310,12 +301,12 @@ test!(lockfile_locks_transitively { assert_that(p.cargo("build"), execs().with_status(0).with_stdout(&format!("\ [UPDATING] registry `[..]` -{downloading} [..] v0.0.1 (registry file://[..]) -{downloading} [..] v0.0.1 (registry file://[..]) +[DOWNLOADING] [..] v0.0.1 (registry file://[..]) +[DOWNLOADING] [..] v0.0.1 (registry file://[..]) [COMPILING] baz v0.0.1 (registry file://[..]) [COMPILING] bar v0.0.1 (registry file://[..]) [COMPILING] foo v0.0.1 ({dir}) -", downloading = DOWNLOADING, +", dir = p.url()))); p.root().move_into_the_past().unwrap(); @@ -348,12 +339,12 @@ test!(yanks_are_not_used { assert_that(p.cargo("build"), execs().with_status(0).with_stdout(&format!("\ [UPDATING] registry `[..]` -{downloading} [..] v0.0.1 (registry file://[..]) -{downloading} [..] v0.0.1 (registry file://[..]) +[DOWNLOADING] [..] v0.0.1 (registry file://[..]) +[DOWNLOADING] [..] v0.0.1 (registry file://[..]) [COMPILING] baz v0.0.1 (registry file://[..]) [COMPILING] bar v0.0.1 (registry file://[..]) [COMPILING] foo v0.0.1 ({dir}) -", downloading = DOWNLOADING, +", dir = p.url()))); }); @@ -376,12 +367,12 @@ test!(relying_on_a_yank_is_bad { Package::new("bar", "0.0.1").dep("baz", "=0.0.2").publish(); assert_that(p.cargo("build"), - execs().with_status(101).with_stderr(&format!("\ + execs().with_status(101).with_stderr("\ [ERROR] no matching package named `baz` found (required by `bar`) location searched: registry file://[..] version required: = 0.0.2 versions found: 0.0.1 -"))); +")); }); test!(yanks_in_lockfiles_are_ok { @@ -411,11 +402,11 @@ test!(yanks_in_lockfiles_are_ok { execs().with_status(0).with_stdout("")); assert_that(p.cargo("update"), - execs().with_status(101).with_stderr(&format!("\ + execs().with_status(101).with_stderr("\ [ERROR] no matching package named `bar` found (required by `foo`) location searched: registry file://[..] version required: * -"))); +")); }); test!(update_with_lockfile_if_packages_missing { @@ -439,10 +430,10 @@ test!(update_with_lockfile_if_packages_missing { paths::home().join(".cargo/registry").rm_rf().unwrap(); assert_that(p.cargo("build"), - execs().with_status(0).with_stdout(&format!("\ + execs().with_status(0).with_stdout("\ [UPDATING] registry `[..]` -{downloading} bar v0.0.1 (registry file://[..]) -", downloading = DOWNLOADING))); +[DOWNLOADING] bar v0.0.1 (registry file://[..]) +")); }); test!(update_lockfile { @@ -470,35 +461,35 @@ test!(update_lockfile { println!("0.0.2 update"); assert_that(p.cargo("update") .arg("-p").arg("bar").arg("--precise").arg("0.0.2"), - execs().with_status(0).with_stdout(&format!("\ + execs().with_status(0).with_stdout("\ [UPDATING] registry `[..]` [UPDATING] bar v0.0.1 (registry file://[..]) -> v0.0.2 -"))); +")); println!("0.0.2 build"); assert_that(p.cargo("build"), execs().with_status(0).with_stdout(&format!("\ -{downloading} [..] v0.0.2 (registry file://[..]) +[DOWNLOADING] [..] v0.0.2 (registry file://[..]) [COMPILING] bar v0.0.2 (registry file://[..]) [COMPILING] foo v0.0.1 ({dir}) -", downloading = DOWNLOADING, +", dir = p.url()))); println!("0.0.3 update"); assert_that(p.cargo("update") .arg("-p").arg("bar"), - execs().with_status(0).with_stdout(&format!("\ + execs().with_status(0).with_stdout("\ [UPDATING] registry `[..]` [UPDATING] bar v0.0.2 (registry file://[..]) -> v0.0.3 -"))); +")); println!("0.0.3 build"); assert_that(p.cargo("build"), execs().with_status(0).with_stdout(&format!("\ -{downloading} [..] v0.0.3 (registry file://[..]) +[DOWNLOADING] [..] v0.0.3 (registry file://[..]) [COMPILING] bar v0.0.3 (registry file://[..]) [COMPILING] foo v0.0.1 ({dir}) -", downloading = DOWNLOADING, +", dir = p.url()))); println!("new dependencies update"); @@ -506,21 +497,21 @@ test!(update_lockfile { Package::new("spam", "0.2.5").publish(); assert_that(p.cargo("update") .arg("-p").arg("bar"), - execs().with_status(0).with_stdout(&format!("\ + execs().with_status(0).with_stdout("\ [UPDATING] registry `[..]` [UPDATING] bar v0.0.3 (registry file://[..]) -> v0.0.4 -{adding} spam v0.2.5 (registry file://[..]) -", adding = ADDING))); +[ADDING] spam v0.2.5 (registry file://[..]) +")); println!("new dependencies update"); Package::new("bar", "0.0.5").publish(); assert_that(p.cargo("update") .arg("-p").arg("bar"), - execs().with_status(0).with_stdout(&format!("\ + execs().with_status(0).with_stdout("\ [UPDATING] registry `[..]` [UPDATING] bar v0.0.4 (registry file://[..]) -> v0.0.5 -{removing} spam v0.2.5 (registry file://[..]) -", removing = REMOVING))); +[REMOVING] spam v0.2.5 (registry file://[..]) +")); }); test!(dev_dependency_not_used { @@ -543,10 +534,10 @@ test!(dev_dependency_not_used { assert_that(p.cargo("build"), execs().with_status(0).with_stdout(&format!("\ [UPDATING] registry `[..]` -{downloading} [..] v0.0.1 (registry file://[..]) +[DOWNLOADING] [..] v0.0.1 (registry file://[..]) [COMPILING] bar v0.0.1 (registry file://[..]) [COMPILING] foo v0.0.1 ({dir}) -", downloading = DOWNLOADING, +", dir = p.url()))); }); @@ -574,8 +565,8 @@ test!(bad_license_file { "#); assert_that(p.cargo_process("publish").arg("-v"), execs().with_status(101) - .with_stderr(&format!("\ -[ERROR] the license file `foo` does not exist"))); + .with_stderr("\ +[ERROR] the license file `foo` does not exist")); }); test!(updating_a_dep { @@ -607,11 +598,11 @@ test!(updating_a_dep { assert_that(p.cargo("build"), execs().with_status(0).with_stdout(&format!("\ [UPDATING] registry `[..]` -{downloading} bar v0.0.1 (registry file://[..]) +[DOWNLOADING] bar v0.0.1 (registry file://[..]) [COMPILING] bar v0.0.1 (registry file://[..]) [COMPILING] a v0.0.1 ({dir}/a) [COMPILING] foo v0.0.1 ({dir}) -", downloading = DOWNLOADING, +", dir = p.url()))); File::create(&p.root().join("a/Cargo.toml")).unwrap().write_all(br#" @@ -629,11 +620,11 @@ test!(updating_a_dep { assert_that(p.cargo("build"), execs().with_status(0).with_stdout(&format!("\ [UPDATING] registry `[..]` -{downloading} bar v0.1.0 (registry file://[..]) +[DOWNLOADING] bar v0.1.0 (registry file://[..]) [COMPILING] bar v0.1.0 (registry file://[..]) [COMPILING] a v0.0.1 ({dir}/a) [COMPILING] foo v0.0.1 ({dir}) -", downloading = DOWNLOADING, +", dir = p.url()))); }); @@ -673,11 +664,11 @@ test!(git_and_registry_dep { execs().with_status(0).with_stdout(&format!("\ [UPDATING] [..] [UPDATING] [..] -{downloading} a v0.0.1 (registry file://[..]) +[DOWNLOADING] a v0.0.1 (registry file://[..]) [COMPILING] a v0.0.1 (registry [..]) [COMPILING] b v0.0.1 ([..]) [COMPILING] foo v0.0.1 ({dir}) -", downloading = DOWNLOADING, +", dir = p.url()))); p.root().move_into_the_past().unwrap(); @@ -718,10 +709,10 @@ test!(update_publish_then_update { assert_that(p.cargo("build"), execs().with_status(0).with_stdout(&format!("\ [UPDATING] [..] -{downloading} a v0.1.1 (registry file://[..]) +[DOWNLOADING] a v0.1.1 (registry file://[..]) [COMPILING] a v0.1.1 (registry [..]) [COMPILING] foo v0.5.0 ({dir}) -", downloading = DOWNLOADING, +", dir = p.url()))); }); @@ -744,10 +735,10 @@ test!(fetch_downloads { assert_that(p.cargo("fetch"), execs().with_status(0) - .with_stdout(format!("\ + .with_stdout("\ [UPDATING] registry `[..]` -{downloading} a v0.1.0 (registry [..]) -", downloading = DOWNLOADING))); +[DOWNLOADING] a v0.1.0 (registry [..]) +")); }); test!(update_transitive_dependency { @@ -774,19 +765,19 @@ test!(update_transitive_dependency { assert_that(p.cargo("update").arg("-pb"), execs().with_status(0) - .with_stdout(format!("\ + .with_stdout("\ [UPDATING] registry `[..]` [UPDATING] b v0.1.0 (registry [..]) -> v0.1.1 -"))); +")); assert_that(p.cargo("build"), execs().with_status(0) - .with_stdout(format!("\ -{downloading} b v0.1.1 (registry file://[..]) + .with_stdout("\ +[DOWNLOADING] b v0.1.1 (registry file://[..]) [COMPILING] b v0.1.1 (registry [..]) [COMPILING] a v0.1.0 (registry [..]) [COMPILING] foo v0.5.0 ([..]) -", downloading = DOWNLOADING))); +")); }); test!(update_backtracking_ok { @@ -820,9 +811,9 @@ test!(update_backtracking_ok { assert_that(p.cargo("update").arg("-p").arg("hyper"), execs().with_status(0) - .with_stdout(&format!("\ + .with_stdout("\ [UPDATING] registry `[..]` -"))); +")); }); test!(update_multiple_packages { @@ -854,35 +845,35 @@ test!(update_multiple_packages { assert_that(p.cargo("update").arg("-pa").arg("-pb"), execs().with_status(0) - .with_stdout(format!("\ + .with_stdout("\ [UPDATING] registry `[..]` [UPDATING] a v0.1.0 (registry [..]) -> v0.1.1 [UPDATING] b v0.1.0 (registry [..]) -> v0.1.1 -"))); +")); assert_that(p.cargo("update").arg("-pb").arg("-pc"), execs().with_status(0) - .with_stdout(format!("\ + .with_stdout("\ [UPDATING] registry `[..]` [UPDATING] c v0.1.0 (registry [..]) -> v0.1.1 -"))); +")); assert_that(p.cargo("build"), execs().with_status(0) - .with_stdout_contains(format!("\ -{downloading} a v0.1.1 (registry file://[..])", downloading = DOWNLOADING)) - .with_stdout_contains(format!("\ -{downloading} b v0.1.1 (registry file://[..])", downloading = DOWNLOADING)) - .with_stdout_contains(format!("\ -{downloading} c v0.1.1 (registry file://[..])", downloading = DOWNLOADING)) - .with_stdout_contains(format!("\ -[COMPILING] a v0.1.1 (registry [..])")) - .with_stdout_contains(format!("\ -[COMPILING] b v0.1.1 (registry [..])")) - .with_stdout_contains(format!("\ -[COMPILING] c v0.1.1 (registry [..])")) - .with_stdout_contains(format!("\ -[COMPILING] foo v0.5.0 ([..])"))); + .with_stdout_contains("\ +[DOWNLOADING] a v0.1.1 (registry file://[..])") + .with_stdout_contains("\ +[DOWNLOADING] b v0.1.1 (registry file://[..])") + .with_stdout_contains("\ +[DOWNLOADING] c v0.1.1 (registry file://[..])") + .with_stdout_contains("\ +[COMPILING] a v0.1.1 (registry [..])") + .with_stdout_contains("\ +[COMPILING] b v0.1.1 (registry [..])") + .with_stdout_contains("\ +[COMPILING] c v0.1.1 (registry [..])") + .with_stdout_contains("\ +[COMPILING] foo v0.5.0 ([..])")); }); test!(bundled_crate_in_registry { @@ -991,12 +982,12 @@ test!(only_download_relevant { Package::new("baz", "0.1.0").publish(); assert_that(p.cargo("build"), - execs().with_status(0).with_stdout(&format!("\ + execs().with_status(0).with_stdout("\ [UPDATING] registry `[..]` -{downloading} baz v0.1.0 ([..]) +[DOWNLOADING] baz v0.1.0 ([..]) [COMPILING] baz v0.1.0 ([..]) [COMPILING] bar v0.5.0 ([..]) -", downloading = DOWNLOADING))); +")); }); test!(resolve_and_backtracking { diff --git a/tests/test_cargo_run.rs b/tests/test_cargo_run.rs index 1376b0ab2ed..7a602513d44 100644 --- a/tests/test_cargo_run.rs +++ b/tests/test_cargo_run.rs @@ -61,9 +61,9 @@ test!(simple_quiet_and_verbose { "#); assert_that(p.cargo_process("run").arg("-q").arg("-v"), - execs().with_status(101).with_stderr(&format!("\ + execs().with_status(101).with_stderr("\ [ERROR] cannot set both --verbose and --quiet -"))); +")); }); test!(quiet_and_verbose_config { @@ -119,9 +119,9 @@ test!(exit_code { assert_that(p.cargo_process("run"), execs().with_status(2) - .with_stderr(&format!("\ + .with_stderr("\ [ERROR] Process didn't exit successfully: `target[..]foo[..]` (exit code: 2) -"))); +")); }); test!(exit_code_verbose { @@ -138,9 +138,9 @@ test!(exit_code_verbose { assert_that(p.cargo_process("run").arg("-v"), execs().with_status(2) - .with_stderr(&format!("\ + .with_stderr("\ [ERROR] Process didn't exit successfully: `target[..]foo[..]` (exit code: 2) -"))); +")); }); test!(no_main_file { @@ -155,8 +155,8 @@ test!(no_main_file { assert_that(p.cargo_process("run"), execs().with_status(101) - .with_stderr(&format!("[ERROR] a bin target must be available \ - for `cargo run`\n"))); + .with_stderr("[ERROR] a bin target must be available \ + for `cargo run`\n")); }); test!(too_many_bins { @@ -173,9 +173,9 @@ test!(too_many_bins { assert_that(p.cargo_process("run"), execs().with_status(101) - .with_stderr(&format!("[ERROR] `cargo run` requires that a project only \ + .with_stderr("[ERROR] `cargo run` requires that a project only \ have one executable; use the `--bin` option \ - to specify which one to run\n"))); + to specify which one to run\n")); }); test!(specify_name { @@ -261,24 +261,24 @@ test!(run_with_filename { "#); assert_that(p.cargo_process("run").arg("--bin").arg("bin.rs"), - execs().with_status(101).with_stderr(&format!("\ -[ERROR] no bin target named `bin.rs`"))); + execs().with_status(101).with_stderr("\ +[ERROR] no bin target named `bin.rs`")); assert_that(p.cargo_process("run").arg("--bin").arg("a.rs"), - execs().with_status(101).with_stderr(&format!("\ + execs().with_status(101).with_stderr("\ [ERROR] no bin target named `a.rs` -Did you mean `a`?"))); +Did you mean `a`?")); assert_that(p.cargo_process("run").arg("--example").arg("example.rs"), - execs().with_status(101).with_stderr(&format!("\ -[ERROR] no example target named `example.rs`"))); + execs().with_status(101).with_stderr("\ +[ERROR] no example target named `example.rs`")); assert_that(p.cargo_process("run").arg("--example").arg("a.rs"), - execs().with_status(101).with_stderr(&format!("\ + execs().with_status(101).with_stderr("\ [ERROR] no example target named `a.rs` -Did you mean `a`?"))); +Did you mean `a`?")); }); test!(either_name_or_example { @@ -298,9 +298,9 @@ test!(either_name_or_example { assert_that(p.cargo_process("run").arg("--bin").arg("a").arg("--example").arg("b"), execs().with_status(101) - .with_stderr(&format!("[ERROR] `cargo run` can run at most one \ + .with_stderr("[ERROR] `cargo run` can run at most one \ executable, but multiple were \ - specified"))); + specified")); }); test!(one_bin_multiple_examples { diff --git a/tests/test_cargo_rustc.rs b/tests/test_cargo_rustc.rs index 2e26b111553..942c99aa3a0 100644 --- a/tests/test_cargo_rustc.rs +++ b/tests/test_cargo_rustc.rs @@ -7,11 +7,9 @@ use hamcrest::assert_that; fn setup() { } -fn cargo_rustc_error() -> String { - format!("[ERROR] extra arguments to `rustc` can only be passed to one target, \ - consider filtering\nthe package by passing e.g. `--lib` or `--bin NAME` to \ - specify a single target") -} +const CARGO_RUSTC_ERROR: &'static str = +"[ERROR] extra arguments to `rustc` can only be passed to one target, consider filtering +the package by passing e.g. `--lib` or `--bin NAME` to specify a single target"; test!(build_lib_for_foo { let p = project("foo") @@ -122,7 +120,7 @@ test!(fails_when_trying_to_build_main_and_lib_with_args { .arg("--").arg("-Z").arg("unstable-options"), execs() .with_status(101) - .with_stderr(&cargo_rustc_error())); + .with_stderr(CARGO_RUSTC_ERROR)); }); test!(build_with_args_to_one_of_multiple_binaries { @@ -181,7 +179,7 @@ test!(fails_with_args_to_all_binaries { .arg("--").arg("-Z").arg("unstable-options"), execs() .with_status(101) - .with_stderr(&cargo_rustc_error())); + .with_stderr(CARGO_RUSTC_ERROR)); }); test!(build_with_args_to_one_of_multiple_tests { @@ -285,10 +283,10 @@ test!(build_only_bar_dependency { .arg("--").arg("-Z").arg("unstable-options"), execs() .with_status(0) - .with_stdout(format!("\ + .with_stdout("\ [COMPILING] bar v0.1.0 ([..]) [RUNNING] `[..]--crate-name bar --crate-type lib [..] -Z unstable-options [..]` -"))); +")); }); test!(fail_with_multiple_packages { @@ -340,11 +338,11 @@ test!(fail_with_multiple_packages { assert_that(foo.cargo("rustc").arg("-v").arg("-p").arg("bar") .arg("-p").arg("baz"), - execs().with_status(1).with_stderr(format!("\ + execs().with_status(1).with_stderr("\ [ERROR] Invalid arguments. Usage: - cargo rustc [options] [--] [...]"))); + cargo rustc [options] [--] [...]")); }); test!(rustc_with_other_profile { diff --git a/tests/test_cargo_rustdoc.rs b/tests/test_cargo_rustdoc.rs index 60659e35239..b8a965aa79b 100644 --- a/tests/test_cargo_rustdoc.rs +++ b/tests/test_cargo_rustdoc.rs @@ -161,7 +161,7 @@ test!(rustdoc_same_name_err { .arg("--").arg("--no-defaults"), execs() .with_status(101) - .with_stderr(&format!("[ERROR] cannot document a package where a library and a \ + .with_stderr("[ERROR] cannot document a package where a library and a \ binary have the same name. Consider renaming one \ - or marking the target as `doc = false`"))); + or marking the target as `doc = false`")); }); diff --git a/tests/test_cargo_search.rs b/tests/test_cargo_search.rs index c40c37958a6..d557e28285a 100644 --- a/tests/test_cargo_search.rs +++ b/tests/test_cargo_search.rs @@ -80,9 +80,9 @@ test!(simple { } assert_that(cargo_process("search").arg("postgres"), - execs().with_status(0).with_stdout(format!("\ + execs().with_status(0).with_stdout("\ [UPDATING] registry `[..]` -hoare (0.1.1) Design by contract style assertions for Rust"))); +hoare (0.1.1) Design by contract style assertions for Rust")); }); test!(multiple_query_params { @@ -126,9 +126,9 @@ test!(multiple_query_params { } assert_that(cargo_process("search").arg("postgres").arg("sql"), - execs().with_status(0).with_stdout(format!("\ + execs().with_status(0).with_stdout("\ [UPDATING] registry `[..]` -hoare (0.1.1) Design by contract style assertions for Rust"))); +hoare (0.1.1) Design by contract style assertions for Rust")); }); test!(help { diff --git a/tests/test_cargo_test.rs b/tests/test_cargo_test.rs index e402de82f98..22b8241494f 100644 --- a/tests/test_cargo_test.rs +++ b/tests/test_cargo_test.rs @@ -3,7 +3,6 @@ use std::io::prelude::*; use std::str; use support::{project, execs, basic_bin_manifest, basic_lib_manifest}; -use support::{DOCTEST}; use support::paths::CargoPathExt; use hamcrest::{assert_that, existing_file, is_not}; use cargo::util::process; @@ -100,14 +99,14 @@ test test ... ok test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured -{doctest} foo +[DOCTEST] foo [RUNNING] `rustdoc --test [..]lib.rs[..]` running 0 tests test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured -", dir = p.url(), doctest = DOCTEST))); +", dir = p.url()))); }); test!(cargo_test_verbose { @@ -258,7 +257,7 @@ test lib_test ... ok test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured -{doctest} foo +[DOCTEST] foo running 1 test test foo_0 ... ok @@ -266,7 +265,7 @@ test foo_0 ... ok test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured ", - p.url(), doctest = DOCTEST))) + p.url()))) }); test!(test_with_deep_lib_dep { @@ -319,7 +318,7 @@ test bar_test ... ok test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured -{doctest} bar +[DOCTEST] bar running 1 test test bar_0 ... ok @@ -327,7 +326,6 @@ test bar_0 ... ok test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured ", - doctest = DOCTEST, dir = p.url()))); }); @@ -373,14 +371,14 @@ test external_test ... ok test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured -{doctest} foo +[DOCTEST] foo running 0 tests test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured ", - p.url(), doctest = DOCTEST))) + p.url()))) }); test!(external_test_implicit { @@ -421,13 +419,13 @@ test internal_test ... ok test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured -{doctest} foo +[DOCTEST] foo running 0 tests test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured -", p.url(), doctest = DOCTEST))) +", p.url()))) }); test!(dont_run_examples { @@ -471,19 +469,18 @@ test bar ... ok test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured -{doctest} foo +[DOCTEST] foo running 0 tests test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured ", - doctest = DOCTEST, dir = p.url()))); assert_that(p.cargo("test").arg("foo"), execs().with_status(0) - .with_stdout(&format!("\ + .with_stdout("\ [RUNNING] target[..]foo-[..] running 1 test @@ -491,14 +488,13 @@ test foo ... ok test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured -{doctest} foo +[DOCTEST] foo running 0 tests test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured -", - doctest = DOCTEST))); +")); }); // Regression test for running cargo-test twice with @@ -561,14 +557,14 @@ test [..] ... ok test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured -{doctest} foo +[DOCTEST] foo running 0 tests test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured ", - p.url(), doctest = DOCTEST))) + p.url()))) }); test!(lib_with_standard_name { @@ -613,15 +609,14 @@ test test ... ok test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured -{doctest} syntax +[DOCTEST] syntax running 1 test test foo_0 ... ok test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured -", - doctest = DOCTEST, dir = p.url()))); +", dir = p.url()))); }); test!(lib_with_standard_name2 { @@ -731,11 +726,11 @@ test!(bin_without_name { assert_that(p.cargo_process("test"), execs().with_status(101) - .with_stderr(&format!("\ + .with_stderr("\ [ERROR] failed to parse manifest at `[..]` Caused by: - binary target bin.name is required"))); + binary target bin.name is required")); }); test!(bench_without_name { @@ -775,11 +770,11 @@ test!(bench_without_name { assert_that(p.cargo_process("test"), execs().with_status(101) - .with_stderr(&format!("\ + .with_stderr("\ [ERROR] failed to parse manifest at `[..]` Caused by: - bench target bench.name is required"))); + bench target bench.name is required")); }); test!(test_without_name { @@ -818,11 +813,11 @@ test!(test_without_name { assert_that(p.cargo_process("test"), execs().with_status(101) - .with_stderr(&format!("\ + .with_stderr("\ [ERROR] failed to parse manifest at `[..]` Caused by: - test target test.name is required"))); + test target test.name is required")); }); test!(example_without_name { @@ -861,11 +856,11 @@ test!(example_without_name { assert_that(p.cargo_process("test"), execs().with_status(101) - .with_stderr(&format!("\ + .with_stderr("\ [ERROR] failed to parse manifest at `[..]` Caused by: - example target example.name is required"))); + example target example.name is required")); }); test!(bin_there_for_integration { @@ -962,7 +957,7 @@ test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured p.root().move_into_the_past().unwrap(); assert_that(p.cargo("test"), execs().with_status(0) - .with_stdout(format!("\ + .with_stdout("\ [RUNNING] target[..]foo-[..] running 1 test @@ -977,7 +972,7 @@ test foo ... ok test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured -"))); +")); }); @@ -1007,19 +1002,18 @@ test foo ... ok test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured -{doctest} foo +[DOCTEST] foo running 0 tests test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured ", - doctest = DOCTEST, dir = p.url()))); assert_that(p.cargo("test"), execs().with_status(0) - .with_stdout(format!("\ + .with_stdout("\ [RUNNING] target[..]foo-[..] running 1 test @@ -1027,14 +1021,13 @@ test foo ... ok test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured -{doctest} foo +[DOCTEST] foo running 0 tests test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured -", - doctest = DOCTEST))); +")); }); test!(test_then_build { @@ -1061,14 +1054,13 @@ test foo ... ok test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured -{doctest} foo +[DOCTEST] foo running 0 tests test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured ", - doctest = DOCTEST, dir = p.url()))); assert_that(p.cargo("build"), @@ -1443,14 +1435,13 @@ running 0 tests test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured -{doctest} d1 +[DOCTEST] d1 running 0 tests test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured -", dir = p.url(), - doctest = DOCTEST))); +", dir = p.url()))); }); test!(example_bin_same_name { @@ -1480,11 +1471,11 @@ test!(example_bin_same_name { assert_that(p.cargo("run"), execs().with_status(0) - .with_stdout(&format!("\ + .with_stdout("\ [COMPILING] foo v0.0.1 ([..]) [RUNNING] [..] bin -"))); +")); assert_that(&p.bin("foo"), existing_file()); }); @@ -1537,13 +1528,13 @@ test!(example_with_dev_dep { assert_that(p.cargo_process("test").arg("-v"), execs().with_status(0) - .with_stdout(&format!("\ + .with_stdout("\ [..] [..] [..] [..] [RUNNING] `rustc [..] --crate-name ex [..] --extern a=[..]` -"))); +")); }); test!(bin_is_preserved { @@ -1578,13 +1569,13 @@ test!(bad_example { .file("src/lib.rs", ""); assert_that(p.cargo_process("run").arg("--example").arg("foo"), - execs().with_status(101).with_stderr(&format!("\ + execs().with_status(101).with_stderr("\ [ERROR] no example target named `foo` -"))); +")); assert_that(p.cargo_process("run").arg("--bin").arg("foo"), - execs().with_status(101).with_stderr(&format!("\ + execs().with_status(101).with_stderr("\ [ERROR] no bin target named `foo` -"))); +")); }); test!(doctest_feature { @@ -1606,7 +1597,7 @@ test!(doctest_feature { "#); assert_that(p.cargo_process("test").arg("--features").arg("bar"), - execs().with_status(0).with_stdout(format!("\ + execs().with_status(0).with_stdout("\ [COMPILING] foo [..] [RUNNING] target[..]foo[..] @@ -1614,14 +1605,14 @@ running 0 tests test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured -{doctest} foo +[DOCTEST] foo running 1 test test foo_0 ... ok test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured -", doctest = DOCTEST))) +")) }); test!(dashes_to_underscores { @@ -1689,7 +1680,7 @@ test!(filter_no_doc_tests { .file("tests/foo.rs", ""); assert_that(p.cargo_process("test").arg("--test=foo"), - execs().with_stdout(format!("\ + execs().with_stdout("\ [COMPILING] foo v0.0.1 ([..]) [RUNNING] target[..]debug[..]foo[..] @@ -1697,7 +1688,7 @@ running 0 tests test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured -"))); +")); }); test!(dylib_doctest { @@ -1721,16 +1712,16 @@ test!(dylib_doctest { "#); assert_that(p.cargo_process("test"), - execs().with_stdout(format!("\ + execs().with_stdout("\ [COMPILING] foo v0.0.1 ([..]) -{doctest} foo +[DOCTEST] foo running 1 test test foo_0 ... ok test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured -", doctest = DOCTEST))); +")); }); test!(dylib_doctest2 { @@ -1787,7 +1778,7 @@ test!(cyclic_dev_dep_doc_test { extern crate foo; "#); assert_that(p.cargo_process("test"), - execs().with_stdout(format!("\ + execs().with_stdout("\ [COMPILING] foo v0.0.1 ([..]) [COMPILING] bar v0.0.1 ([..]) [RUNNING] target[..]foo[..] @@ -1796,14 +1787,14 @@ running 0 tests test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured -{doctest} foo +[DOCTEST] foo running 1 test test _0 ... ok test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured -", doctest = DOCTEST))) +")) }); test!(dev_dep_with_build_script { @@ -1878,7 +1869,7 @@ test!(no_fail_fast { "#); assert_that(p.cargo_process("test").arg("--no-fail-fast"), execs().with_status(101) - .with_stdout_contains(format!("\ + .with_stdout_contains("\ [COMPILING] foo v0.0.1 ([..]) [RUNNING] target[..]foo[..] @@ -1887,8 +1878,8 @@ running 0 tests test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured [RUNNING] target[..]test_add_one[..] -")) - .with_stdout_contains(format!("\ +") + .with_stdout_contains("\ test result: FAILED. 1 passed; 1 failed; 0 ignored; 0 measured [RUNNING] target[..]test_sub_one[..] @@ -1898,14 +1889,14 @@ test sub_one_test ... ok test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured -{doctest} foo +[DOCTEST] foo running 1 test test sub_one_0 ... ok test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured -", doctest = DOCTEST))) +")) }); test!(test_multiple_packages { @@ -1952,20 +1943,20 @@ test!(test_multiple_packages { assert_that(p.cargo("test").arg("-p").arg("d1").arg("-p").arg("d2"), execs().with_status(0) - .with_stdout_contains(&format!("\ + .with_stdout_contains("\ [RUNNING] target[..]debug[..]d1-[..] running 0 tests test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured -")) - .with_stdout_contains(&format!("\ +") + .with_stdout_contains("\ [RUNNING] target[..]debug[..]d2-[..] running 0 tests test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured -"))); +")); }); test!(bin_does_not_rebuild_tests { @@ -1990,11 +1981,11 @@ test!(bin_does_not_rebuild_tests { assert_that(p.cargo("test").arg("-v").arg("--no-run"), execs().with_status(0) - .with_stdout(&format!("\ + .with_stdout("\ [COMPILING] foo v0.0.1 ([..]) [RUNNING] `rustc src[..]main.rs [..]` [RUNNING] `rustc src[..]main.rs [..]` -"))); +")); }); test!(selective_test_wonky_profile { @@ -2049,11 +2040,11 @@ test!(selective_test_optional_dep { assert_that(p.cargo("test").arg("-v").arg("--no-run") .arg("--features").arg("a").arg("-p").arg("a"), - execs().with_status(0).with_stdout(&format!("\ + execs().with_status(0).with_stdout("\ [COMPILING] a v0.0.1 ([..]) [RUNNING] `rustc a[..]src[..]lib.rs [..]` [RUNNING] `rustc a[..]src[..]lib.rs [..]` -"))); +")); }); test!(only_test_docs {