mirror of
https://github.com/rust-lang/cargo
synced 2024-08-24 18:15:45 +00:00
Fix all tests with recent changes
The package id for path dependencies now has another path component pointing precisely to the package being compiled, so lots of tests need their output matches to get updated.
This commit is contained in:
parent
9185445ae1
commit
09847df8d3
|
@ -73,8 +73,8 @@ pub fn read(path: &Path) -> CargoResult<String> {
|
|||
let mut f = try!(File::open(path));
|
||||
try!(f.read_to_string(&mut ret));
|
||||
Ok(ret)
|
||||
}).chain_error(|| {
|
||||
internal(format!("failed to read `{}`", path.display()))
|
||||
})().map_err(human).chain_error(|| {
|
||||
human(format!("failed to read `{}`", path.display()))
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -83,8 +83,8 @@ pub fn write(path: &Path, contents: &[u8]) -> CargoResult<()> {
|
|||
let mut f = try!(File::create(path));
|
||||
try!(f.write_all(contents));
|
||||
Ok(())
|
||||
}).chain_error(|| {
|
||||
internal(format!("failed to write `{}`", path.display()))
|
||||
})().map_err(human).chain_error(|| {
|
||||
human(format!("failed to write `{}`", path.display()))
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
@ -315,7 +315,7 @@ test!(cargo_compile_with_warnings_in_a_dep_package {
|
|||
|
||||
assert_that(p.cargo_process("build"),
|
||||
execs()
|
||||
.with_stdout(&format!("{} bar v0.5.0 ({})\n\
|
||||
.with_stdout(&format!("{} bar v0.5.0 ({}/bar)\n\
|
||||
{} foo v0.5.0 ({})\n",
|
||||
COMPILING, p.url(),
|
||||
COMPILING, p.url()))
|
||||
|
@ -607,7 +607,7 @@ test!(cargo_compile_with_dep_name_mismatch {
|
|||
assert_that(p.cargo_process("build"),
|
||||
execs().with_status(101).with_stderr(&format!(
|
||||
r#"no matching package named `notquitebar` found (required by `foo`)
|
||||
location searched: {proj_dir}
|
||||
location searched: {proj_dir}/bar
|
||||
version required: *
|
||||
"#, proj_dir = p.url())));
|
||||
});
|
||||
|
@ -1004,7 +1004,7 @@ test!(verbose_release_build_deps {
|
|||
.file("foo/src/lib.rs", "");
|
||||
assert_that(p.cargo_process("build").arg("-v").arg("--release"),
|
||||
execs().with_status(0).with_stdout(&format!("\
|
||||
{compiling} foo v0.0.0 ({url})
|
||||
{compiling} foo v0.0.0 ({url}/foo)
|
||||
{running} `rustc foo[..]src[..]lib.rs --crate-name foo \
|
||||
--crate-type dylib --crate-type rlib -C prefer-dynamic \
|
||||
-C opt-level=3 \
|
||||
|
|
|
@ -970,7 +970,7 @@ test!(shared_dep_with_a_build_script {
|
|||
authors = []
|
||||
|
||||
[dependencies.a]
|
||||
path = "../b"
|
||||
path = "../a"
|
||||
"#)
|
||||
.file("b/src/lib.rs", "");
|
||||
assert_that(p.cargo_process("build").arg("-v"),
|
||||
|
|
|
@ -622,8 +622,8 @@ test!(update_with_shared_deps {
|
|||
execs().with_stdout(&format!("\
|
||||
{updating} git repository `{git}`
|
||||
{compiling} bar v0.5.0 ({git}#[..])
|
||||
{compiling} [..] v0.5.0 ({dir})
|
||||
{compiling} [..] v0.5.0 ({dir})
|
||||
{compiling} [..] v0.5.0 ([..])
|
||||
{compiling} [..] v0.5.0 ([..])
|
||||
{compiling} foo v0.5.0 ({dir})\n",
|
||||
updating = UPDATING, git = git_project.url(),
|
||||
compiling = COMPILING, dir = p.url())));
|
||||
|
@ -681,8 +681,8 @@ To learn more, run the command again with --verbose.
|
|||
assert_that(p.cargo("build"),
|
||||
execs().with_stdout(&format!("\
|
||||
{compiling} bar v0.5.0 ({git}#[..])
|
||||
{compiling} [..] v0.5.0 ({dir})
|
||||
{compiling} [..] v0.5.0 ({dir})
|
||||
{compiling} [..] v0.5.0 ({dir}[..]dep[..])
|
||||
{compiling} [..] v0.5.0 ({dir}[..]dep[..])
|
||||
{compiling} foo v0.5.0 ({dir})\n",
|
||||
git = git_project.url(),
|
||||
compiling = COMPILING, dir = p.url())));
|
||||
|
|
|
@ -72,8 +72,8 @@ test!(cargo_compile_with_nested_deps_shorthand {
|
|||
|
||||
assert_that(p.cargo_process("build"),
|
||||
execs().with_status(0)
|
||||
.with_stdout(&format!("{} baz v0.5.0 ({})\n\
|
||||
{} bar v0.5.0 ({})\n\
|
||||
.with_stdout(&format!("{} baz v0.5.0 ({}/bar/baz)\n\
|
||||
{} bar v0.5.0 ({}/bar)\n\
|
||||
{} foo v0.5.0 ({})\n",
|
||||
COMPILING, p.url(),
|
||||
COMPILING, p.url(),
|
||||
|
@ -90,13 +90,13 @@ test!(cargo_compile_with_nested_deps_shorthand {
|
|||
println!("building baz");
|
||||
assert_that(p.cargo("build").arg("-p").arg("baz"),
|
||||
execs().with_status(0)
|
||||
.with_stdout(&format!("{} baz v0.5.0 ({})\n",
|
||||
.with_stdout(&format!("{} baz v0.5.0 ({}/bar/baz)\n",
|
||||
COMPILING, p.url())));
|
||||
println!("building foo");
|
||||
assert_that(p.cargo("build")
|
||||
.arg("-p").arg("foo"),
|
||||
execs().with_status(0)
|
||||
.with_stdout(&format!("{} bar v0.5.0 ({})\n\
|
||||
.with_stdout(&format!("{} bar v0.5.0 ({}/bar)\n\
|
||||
{} foo v0.5.0 ({})\n",
|
||||
COMPILING, p.url(),
|
||||
COMPILING, p.url())));
|
||||
|
@ -176,15 +176,15 @@ test!(cargo_compile_with_root_dev_deps_with_testing {
|
|||
p2.build();
|
||||
assert_that(p.cargo_process("test"),
|
||||
execs().with_stdout(&format!("\
|
||||
{compiling} [..] v0.5.0 ({url})
|
||||
{compiling} [..] v0.5.0 ({url})
|
||||
{compiling} [..] v0.5.0 ([..])
|
||||
{compiling} [..] v0.5.0 ([..])
|
||||
{running} target[..]foo-[..]
|
||||
|
||||
running 0 tests
|
||||
|
||||
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured
|
||||
|
||||
", compiling = COMPILING, url = p.url(), running = RUNNING)));
|
||||
", compiling = COMPILING, running = RUNNING)));
|
||||
});
|
||||
|
||||
test!(cargo_compile_with_transitive_dev_deps {
|
||||
|
@ -229,7 +229,7 @@ test!(cargo_compile_with_transitive_dev_deps {
|
|||
"#);
|
||||
|
||||
assert_that(p.cargo_process("build"),
|
||||
execs().with_stdout(&format!("{} bar v0.5.0 ({})\n\
|
||||
execs().with_stdout(&format!("{} bar v0.5.0 ({}/bar)\n\
|
||||
{} foo v0.5.0 ({})\n",
|
||||
COMPILING, p.url(),
|
||||
COMPILING, p.url())));
|
||||
|
@ -271,7 +271,7 @@ test!(no_rebuild_dependency {
|
|||
"#);
|
||||
// First time around we should compile both foo and bar
|
||||
assert_that(p.cargo_process("build"),
|
||||
execs().with_stdout(&format!("{} bar v0.5.0 ({})\n\
|
||||
execs().with_stdout(&format!("{} bar v0.5.0 ({}/bar)\n\
|
||||
{} foo v0.5.0 ({})\n",
|
||||
COMPILING, p.url(),
|
||||
COMPILING, p.url())));
|
||||
|
@ -282,7 +282,7 @@ test!(no_rebuild_dependency {
|
|||
|
||||
p.build(); // rebuild the files (rewriting them in the process)
|
||||
assert_that(p.cargo("build"),
|
||||
execs().with_stdout(&format!("{} bar v0.5.0 ({})\n\
|
||||
execs().with_stdout(&format!("{} bar v0.5.0 ({}/bar)\n\
|
||||
{} foo v0.5.0 ({})\n",
|
||||
COMPILING, p.url(),
|
||||
COMPILING, p.url())));
|
||||
|
@ -337,8 +337,8 @@ test!(deep_dependencies_trigger_rebuild {
|
|||
pub fn baz() {}
|
||||
"#);
|
||||
assert_that(p.cargo_process("build"),
|
||||
execs().with_stdout(&format!("{} baz v0.5.0 ({})\n\
|
||||
{} bar v0.5.0 ({})\n\
|
||||
execs().with_stdout(&format!("{} baz v0.5.0 ({}/baz)\n\
|
||||
{} bar v0.5.0 ({}/bar)\n\
|
||||
{} foo v0.5.0 ({})\n",
|
||||
COMPILING, p.url(),
|
||||
COMPILING, p.url(),
|
||||
|
@ -355,8 +355,8 @@ test!(deep_dependencies_trigger_rebuild {
|
|||
pub fn baz() { println!("hello!"); }
|
||||
"#).unwrap();
|
||||
assert_that(p.cargo("build"),
|
||||
execs().with_stdout(&format!("{} baz v0.5.0 ({})\n\
|
||||
{} bar v0.5.0 ({})\n\
|
||||
execs().with_stdout(&format!("{} baz v0.5.0 ({}/baz)\n\
|
||||
{} bar v0.5.0 ({}/bar)\n\
|
||||
{} foo v0.5.0 ({})\n",
|
||||
COMPILING, p.url(),
|
||||
COMPILING, p.url(),
|
||||
|
@ -369,7 +369,7 @@ test!(deep_dependencies_trigger_rebuild {
|
|||
pub fn bar() { println!("hello!"); baz::baz(); }
|
||||
"#).unwrap();
|
||||
assert_that(p.cargo("build"),
|
||||
execs().with_stdout(&format!("{} bar v0.5.0 ({})\n\
|
||||
execs().with_stdout(&format!("{} bar v0.5.0 ({}/bar)\n\
|
||||
{} foo v0.5.0 ({})\n",
|
||||
COMPILING, p.url(),
|
||||
COMPILING, p.url())));
|
||||
|
@ -426,8 +426,8 @@ test!(no_rebuild_two_deps {
|
|||
pub fn baz() {}
|
||||
"#);
|
||||
assert_that(p.cargo_process("build"),
|
||||
execs().with_stdout(&format!("{} baz v0.5.0 ({})\n\
|
||||
{} bar v0.5.0 ({})\n\
|
||||
execs().with_stdout(&format!("{} baz v0.5.0 ({}/baz)\n\
|
||||
{} bar v0.5.0 ({}/bar)\n\
|
||||
{} foo v0.5.0 ({})\n",
|
||||
COMPILING, p.url(),
|
||||
COMPILING, p.url(),
|
||||
|
@ -473,7 +473,7 @@ test!(nested_deps_recompile {
|
|||
let bar = p.url();
|
||||
|
||||
assert_that(p.cargo_process("build"),
|
||||
execs().with_stdout(&format!("{} bar v0.5.0 ({})\n\
|
||||
execs().with_stdout(&format!("{} bar v0.5.0 ({}/src/bar)\n\
|
||||
{} foo v0.5.0 ({})\n",
|
||||
COMPILING, bar,
|
||||
COMPILING, p.url())));
|
||||
|
@ -509,14 +509,16 @@ test!(error_message_for_missing_manifest {
|
|||
.file("src/bar/not-a-manifest", "");
|
||||
|
||||
assert_that(p.cargo_process("build"),
|
||||
execs()
|
||||
.with_status(101)
|
||||
.with_stderr(&format!("\
|
||||
execs().with_status(101)
|
||||
.with_stderr("\
|
||||
Unable to update file://[..]
|
||||
|
||||
Caused by:
|
||||
Could not find `Cargo.toml` in `{}`
|
||||
", p.root().join("src").join("bar").display())));
|
||||
failed to read `[..]bar[..]Cargo.toml`
|
||||
|
||||
Caused by:
|
||||
No such file or directory ([..])
|
||||
"));
|
||||
|
||||
});
|
||||
|
||||
|
@ -678,7 +680,7 @@ test!(path_dep_build_cmd {
|
|||
p.root().join("bar").move_into_the_past().unwrap();
|
||||
|
||||
assert_that(p.cargo("build"),
|
||||
execs().with_stdout(&format!("{} bar v0.5.0 ({})\n\
|
||||
execs().with_stdout(&format!("{} bar v0.5.0 ({}/bar)\n\
|
||||
{} foo v0.5.0 ({})\n",
|
||||
COMPILING, p.url(),
|
||||
COMPILING, p.url())));
|
||||
|
@ -695,7 +697,7 @@ test!(path_dep_build_cmd {
|
|||
}
|
||||
|
||||
assert_that(p.cargo("build"),
|
||||
execs().with_stdout(&format!("{} bar v0.5.0 ({})\n\
|
||||
execs().with_stdout(&format!("{} bar v0.5.0 ({}/bar)\n\
|
||||
{} foo v0.5.0 ({})\n",
|
||||
COMPILING, p.url(),
|
||||
COMPILING, p.url())));
|
||||
|
@ -741,8 +743,8 @@ test!(dev_deps_no_rebuild_lib {
|
|||
assert_that(p.cargo("test"),
|
||||
execs().with_status(0)
|
||||
.with_stdout(&format!("\
|
||||
{compiling} [..] v0.5.0 ({url})
|
||||
{compiling} [..] v0.5.0 ({url})
|
||||
{compiling} [..] v0.5.0 ({url}[..])
|
||||
{compiling} [..] v0.5.0 ({url}[..])
|
||||
{running} target[..]foo-[..]
|
||||
|
||||
running 0 tests
|
||||
|
|
|
@ -264,7 +264,7 @@ test!(native_plugin_dependency_with_custom_ar_linker {
|
|||
foo.build();
|
||||
assert_that(bar.cargo_process("build").arg("--verbose"),
|
||||
execs().with_stdout(&format!("\
|
||||
{compiling} foo v0.0.1 ({url})
|
||||
{compiling} foo v0.0.1 ([..])
|
||||
{running} `rustc [..] -C ar=nonexistent-ar -C linker=nonexistent-linker [..]`
|
||||
", compiling = COMPILING, running = RUNNING, url = bar.url())))
|
||||
", compiling = COMPILING, running = RUNNING)));
|
||||
});
|
||||
|
|
|
@ -602,7 +602,7 @@ test!(build_script_needed_for_host_and_target {
|
|||
assert_that(p.cargo_process("build").arg("--target").arg(&target).arg("-v"),
|
||||
execs().with_status(0)
|
||||
.with_stdout_contains(&format!("\
|
||||
{compiling} d1 v0.0.0 ({url})", compiling = COMPILING, url = p.url()))
|
||||
{compiling} d1 v0.0.0 ({url}/d1)", compiling = COMPILING, url = p.url()))
|
||||
.with_stdout_contains(&format!("\
|
||||
{running} `rustc d1[..]build.rs [..] --out-dir {dir}[..]target[..]build[..]d1-[..]`",
|
||||
running = RUNNING, dir = p.root().display()))
|
||||
|
@ -612,7 +612,7 @@ test!(build_script_needed_for_host_and_target {
|
|||
.with_stdout_contains(&format!("\
|
||||
{running} `rustc d1[..]src[..]lib.rs [..]`", running = RUNNING))
|
||||
.with_stdout_contains(&format!("\
|
||||
{compiling} d2 v0.0.0 ({url})", compiling = COMPILING, url = p.url()))
|
||||
{compiling} d2 v0.0.0 ({url}/d2)", compiling = COMPILING, url = p.url()))
|
||||
.with_stdout_contains(&format!("\
|
||||
{running} `rustc d2[..]src[..]lib.rs [..] \
|
||||
-L /path/to/{host}`", running = RUNNING, host = host))
|
||||
|
|
|
@ -101,8 +101,8 @@ test!(doc_deps {
|
|||
|
||||
assert_that(p.cargo_process("doc"),
|
||||
execs().with_status(0).with_stdout(&format!("\
|
||||
[..] bar v0.0.1 ({dir})
|
||||
[..] bar v0.0.1 ({dir})
|
||||
[..] bar v0.0.1 ({dir}/bar)
|
||||
[..] bar v0.0.1 ({dir}/bar)
|
||||
{documenting} foo v0.0.1 ({dir})
|
||||
",
|
||||
documenting = DOCUMENTING,
|
||||
|
@ -148,7 +148,7 @@ test!(doc_no_deps {
|
|||
|
||||
assert_that(p.cargo_process("doc").arg("--no-deps"),
|
||||
execs().with_status(0).with_stdout(&format!("\
|
||||
{compiling} bar v0.0.1 ({dir})
|
||||
{compiling} bar v0.0.1 ({dir}/bar)
|
||||
{documenting} foo v0.0.1 ({dir})
|
||||
",
|
||||
documenting = DOCUMENTING, compiling = COMPILING,
|
||||
|
|
|
@ -253,7 +253,7 @@ test!(no_feature_doesnt_build {
|
|||
|
||||
assert_that(p.cargo("build").arg("--features").arg("bar"),
|
||||
execs().with_status(0).with_stdout(format!("\
|
||||
{compiling} bar v0.0.1 ({dir})
|
||||
{compiling} bar v0.0.1 ({dir}/bar)
|
||||
{compiling} foo v0.0.1 ({dir})
|
||||
", compiling = COMPILING, dir = p.url())));
|
||||
assert_that(p.process(&p.bin("foo")),
|
||||
|
@ -293,7 +293,7 @@ test!(default_feature_pulled_in {
|
|||
|
||||
assert_that(p.cargo_process("build"),
|
||||
execs().with_status(0).with_stdout(format!("\
|
||||
{compiling} bar v0.0.1 ({dir})
|
||||
{compiling} bar v0.0.1 ({dir}/bar)
|
||||
{compiling} foo v0.0.1 ({dir})
|
||||
", compiling = COMPILING, dir = p.url())));
|
||||
assert_that(p.process(&p.bin("foo")),
|
||||
|
@ -394,8 +394,8 @@ test!(groups_on_groups_on_groups {
|
|||
|
||||
assert_that(p.cargo_process("build"),
|
||||
execs().with_status(0).with_stdout(format!("\
|
||||
{compiling} ba[..] v0.0.1 ({dir})
|
||||
{compiling} ba[..] v0.0.1 ({dir})
|
||||
{compiling} ba[..] v0.0.1 ({dir}/ba[..])
|
||||
{compiling} ba[..] v0.0.1 ({dir}/ba[..])
|
||||
{compiling} foo v0.0.1 ({dir})
|
||||
", compiling = COMPILING, dir = p.url())));
|
||||
});
|
||||
|
@ -438,8 +438,8 @@ test!(many_cli_features {
|
|||
|
||||
assert_that(p.cargo_process("build").arg("--features").arg("bar baz"),
|
||||
execs().with_status(0).with_stdout(format!("\
|
||||
{compiling} ba[..] v0.0.1 ({dir})
|
||||
{compiling} ba[..] v0.0.1 ({dir})
|
||||
{compiling} ba[..] v0.0.1 ({dir}/ba[..])
|
||||
{compiling} ba[..] v0.0.1 ({dir}/ba[..])
|
||||
{compiling} foo v0.0.1 ({dir})
|
||||
", compiling = COMPILING, dir = p.url())));
|
||||
});
|
||||
|
@ -499,8 +499,8 @@ test!(union_features {
|
|||
|
||||
assert_that(p.cargo_process("build"),
|
||||
execs().with_status(0).with_stdout(format!("\
|
||||
{compiling} d2 v0.0.1 ({dir})
|
||||
{compiling} d1 v0.0.1 ({dir})
|
||||
{compiling} d2 v0.0.1 ({dir}/d2)
|
||||
{compiling} d1 v0.0.1 ({dir}/d1)
|
||||
{compiling} foo v0.0.1 ({dir})
|
||||
", compiling = COMPILING, dir = p.url())));
|
||||
});
|
||||
|
@ -533,14 +533,14 @@ test!(many_features_no_rebuilds {
|
|||
|
||||
assert_that(p.cargo_process("build"),
|
||||
execs().with_status(0).with_stdout(format!("\
|
||||
{compiling} a v0.1.0 ({dir})
|
||||
{compiling} a v0.1.0 ({dir}/a)
|
||||
{compiling} b v0.1.0 ({dir})
|
||||
", compiling = COMPILING, dir = p.url())));
|
||||
p.root().move_into_the_past().unwrap();
|
||||
|
||||
assert_that(p.cargo("build").arg("-v"),
|
||||
execs().with_status(0).with_stdout(format!("\
|
||||
{fresh} a v0.1.0 ([..])
|
||||
{fresh} a v0.1.0 ([..]/a)
|
||||
{fresh} b v0.1.0 ([..])
|
||||
", fresh = FRESH)));
|
||||
});
|
||||
|
|
|
@ -124,7 +124,10 @@ test!(no_crate {
|
|||
`[..]` is not a crate root; specify a crate to install [..]
|
||||
|
||||
Caused by:
|
||||
Could not find Cargo.toml in `[..]`
|
||||
failed to read `[..]Cargo.toml`
|
||||
|
||||
Caused by:
|
||||
No such file or directory ([..])
|
||||
"));
|
||||
});
|
||||
|
||||
|
@ -197,7 +200,7 @@ binary `foo[..]` already exists in destination as part of `foo v0.1.0 [..]`
|
|||
});
|
||||
|
||||
test!(multiple_crates_error {
|
||||
let p = project("foo")
|
||||
let p = git::repo(&paths::root().join("foo"))
|
||||
.file("Cargo.toml", r#"
|
||||
[package]
|
||||
name = "foo"
|
||||
|
@ -214,14 +217,14 @@ test!(multiple_crates_error {
|
|||
.file("a/src/main.rs", "fn main() {}");
|
||||
p.build();
|
||||
|
||||
assert_that(cargo_process("install").arg("--path").arg(p.root()),
|
||||
assert_that(cargo_process("install").arg("--git").arg(p.url().to_string()),
|
||||
execs().with_status(101).with_stderr("\
|
||||
multiple packages with binaries found: bar, foo
|
||||
"));
|
||||
});
|
||||
|
||||
test!(multiple_crates_select {
|
||||
let p = project("foo")
|
||||
let p = git::repo(&paths::root().join("foo"))
|
||||
.file("Cargo.toml", r#"
|
||||
[package]
|
||||
name = "foo"
|
||||
|
@ -238,12 +241,14 @@ test!(multiple_crates_select {
|
|||
.file("a/src/main.rs", "fn main() {}");
|
||||
p.build();
|
||||
|
||||
assert_that(cargo_process("install").arg("--path").arg(p.root()).arg("foo"),
|
||||
assert_that(cargo_process("install").arg("--git").arg(p.url().to_string())
|
||||
.arg("foo"),
|
||||
execs().with_status(0));
|
||||
assert_that(cargo_home(), has_installed_exe("foo"));
|
||||
assert_that(cargo_home(), is_not(has_installed_exe("bar")));
|
||||
|
||||
assert_that(cargo_process("install").arg("--path").arg(p.root()).arg("bar"),
|
||||
assert_that(cargo_process("install").arg("--git").arg(p.url().to_string())
|
||||
.arg("bar"),
|
||||
execs().with_status(0));
|
||||
assert_that(cargo_home(), has_installed_exe("bar"));
|
||||
});
|
||||
|
@ -541,7 +546,8 @@ test!(installs_from_cwd_by_default {
|
|||
.file("src/main.rs", "fn main() {}");
|
||||
p.build();
|
||||
|
||||
assert_that(cargo_process("install"), execs().with_status(0));
|
||||
assert_that(cargo_process("install").cwd(p.root()),
|
||||
execs().with_status(0));
|
||||
assert_that(cargo_home(), has_installed_exe("foo"));
|
||||
});
|
||||
|
||||
|
|
|
@ -162,11 +162,24 @@ test!(package_verbose {
|
|||
let mut cargo = ::cargo_process();
|
||||
cargo.cwd(p.root());
|
||||
assert_that(cargo.clone().arg("build"), execs().with_status(0));
|
||||
assert_that(cargo.arg("package").arg("-v").arg("--no-verify"),
|
||||
|
||||
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)));
|
||||
|
||||
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)));
|
||||
|
|
|
@ -78,7 +78,7 @@ test!(top_level_overrides_deps {
|
|||
.file("foo/src/lib.rs", "");
|
||||
assert_that(p.cargo_process("build").arg("-v").arg("--release"),
|
||||
execs().with_status(0).with_stdout(&format!("\
|
||||
{compiling} foo v0.0.0 ({url})
|
||||
{compiling} foo v0.0.0 ({url}/foo)
|
||||
{running} `rustc foo{sep}src{sep}lib.rs --crate-name foo \
|
||||
--crate-type dylib --crate-type rlib -C prefer-dynamic \
|
||||
-C opt-level=1 \
|
||||
|
|
|
@ -618,7 +618,7 @@ test!(updating_a_dep {
|
|||
{updating} registry `[..]`
|
||||
{downloading} bar v0.0.1 (registry file://[..])
|
||||
{compiling} bar v0.0.1 (registry file://[..])
|
||||
{compiling} a v0.0.1 ({dir})
|
||||
{compiling} a v0.0.1 ({dir}/a)
|
||||
{compiling} foo v0.0.1 ({dir})
|
||||
", updating = UPDATING, downloading = DOWNLOADING, compiling = COMPILING,
|
||||
dir = p.url())));
|
||||
|
@ -640,7 +640,7 @@ test!(updating_a_dep {
|
|||
{updating} registry `[..]`
|
||||
{downloading} bar v0.1.0 (registry file://[..])
|
||||
{compiling} bar v0.1.0 (registry file://[..])
|
||||
{compiling} a v0.0.1 ({dir})
|
||||
{compiling} a v0.0.1 ({dir}/a)
|
||||
{compiling} foo v0.0.1 ({dir})
|
||||
", updating = UPDATING, downloading = DOWNLOADING, compiling = COMPILING,
|
||||
dir = p.url())));
|
||||
|
|
|
@ -332,7 +332,7 @@ test!(example_with_release_flag {
|
|||
|
||||
assert_that(p.cargo_process("run").arg("-v").arg("--release").arg("--example").arg("a"),
|
||||
execs().with_status(0).with_stdout(&format!("\
|
||||
{compiling} bar v0.0.1 ({url})
|
||||
{compiling} bar v0.0.1 ({url}/bar)
|
||||
{running} `rustc bar{sep}src{sep}bar.rs --crate-name bar --crate-type lib \
|
||||
-C opt-level=3 \
|
||||
-C metadata=[..] \
|
||||
|
@ -361,7 +361,7 @@ fast2
|
|||
|
||||
assert_that(p.cargo("run").arg("-v").arg("--example").arg("a"),
|
||||
execs().with_status(0).with_stdout(&format!("\
|
||||
{compiling} bar v0.0.1 ({url})
|
||||
{compiling} bar v0.0.1 ({url}/bar)
|
||||
{running} `rustc bar{sep}src{sep}bar.rs --crate-name bar --crate-type lib \
|
||||
-g \
|
||||
-C metadata=[..] \
|
||||
|
|
|
@ -249,7 +249,7 @@ test!(build_foo_with_bar_dependency {
|
|||
execs()
|
||||
.with_status(0)
|
||||
.with_stdout(format!("\
|
||||
{compiling} bar v0.1.0 ({url})
|
||||
{compiling} bar v0.1.0 ([..])
|
||||
{running} `[..] -g -C [..]`
|
||||
{compiling} foo v0.0.1 ({url})
|
||||
{running} `[..] -g -Z unstable-options [..]`
|
||||
|
@ -292,11 +292,10 @@ test!(build_only_bar_dependency {
|
|||
execs()
|
||||
.with_status(0)
|
||||
.with_stdout(format!("\
|
||||
{compiling} bar v0.1.0 ({url})
|
||||
{compiling} bar v0.1.0 ([..])
|
||||
{running} `[..]--crate-name bar --crate-type lib [..] -Z unstable-options [..]`
|
||||
",
|
||||
compiling = COMPILING, running = RUNNING,
|
||||
url = foo.url())));
|
||||
compiling = COMPILING, running = RUNNING)));
|
||||
});
|
||||
|
||||
test!(fail_with_multiple_packages {
|
||||
|
|
|
@ -89,8 +89,8 @@ test!(rustdoc_foo_with_bar_dependency {
|
|||
execs()
|
||||
.with_status(0)
|
||||
.with_stdout(format!("\
|
||||
{compiling} bar v0.0.1 ({url})
|
||||
{running} `rustc {bar_dir}{sep}src{sep}lib.rs [..]`
|
||||
{compiling} bar v0.0.1 ([..])
|
||||
{running} `rustc [..]bar{sep}src{sep}lib.rs [..]`
|
||||
{documenting} foo v0.0.1 ({url})
|
||||
{running} `rustdoc src{sep}lib.rs --crate-name foo \
|
||||
-o {dir}{sep}target{sep}doc \
|
||||
|
@ -101,8 +101,7 @@ test!(rustdoc_foo_with_bar_dependency {
|
|||
",
|
||||
running = RUNNING, compiling = COMPILING, sep = SEP,
|
||||
documenting = DOCUMENTING,
|
||||
dir = foo.root().display(), url = foo.url(),
|
||||
bar_dir = bar.root().display())));
|
||||
dir = foo.root().display(), url = foo.url())));
|
||||
});
|
||||
|
||||
test!(rustdoc_only_bar_dependency {
|
||||
|
@ -139,16 +138,15 @@ test!(rustdoc_only_bar_dependency {
|
|||
execs()
|
||||
.with_status(0)
|
||||
.with_stdout(format!("\
|
||||
{documenting} bar v0.0.1 ({url})
|
||||
{running} `rustdoc {bar_dir}{sep}src{sep}lib.rs --crate-name bar \
|
||||
{documenting} bar v0.0.1 ([..])
|
||||
{running} `rustdoc [..]bar{sep}src{sep}lib.rs --crate-name bar \
|
||||
-o {dir}{sep}target{sep}doc \
|
||||
--no-defaults \
|
||||
-L dependency={dir}{sep}target{sep}debug{sep}deps \
|
||||
-L dependency={dir}{sep}target{sep}debug{sep}deps`
|
||||
",
|
||||
running = RUNNING, documenting = DOCUMENTING, sep = SEP,
|
||||
dir = foo.root().display(), url = foo.url(),
|
||||
bar_dir = bar.root().display())));
|
||||
dir = foo.root().display())));
|
||||
});
|
||||
|
||||
|
||||
|
|
|
@ -82,7 +82,7 @@ test!(cargo_test_release {
|
|||
|
||||
assert_that(p.cargo_process("test").arg("-v").arg("--release"),
|
||||
execs().with_stdout(format!("\
|
||||
{compiling} bar v0.0.1 ({dir})
|
||||
{compiling} bar v0.0.1 ({dir}/bar)
|
||||
{running} [..] -C opt-level=3 [..]
|
||||
{compiling} foo v0.1.0 ({dir})
|
||||
{running} [..] -C opt-level=3 [..]
|
||||
|
@ -314,7 +314,7 @@ test!(test_with_deep_lib_dep {
|
|||
assert_that(p.cargo_process("test"),
|
||||
execs().with_status(0)
|
||||
.with_stdout(&format!("\
|
||||
{compiling} foo v0.0.1 ({dir})
|
||||
{compiling} foo v0.0.1 ([..])
|
||||
{compiling} bar v0.0.1 ({dir})
|
||||
{running} target[..]
|
||||
|
||||
|
@ -951,7 +951,7 @@ test!(test_dylib {
|
|||
assert_that(p.cargo_process("test"),
|
||||
execs().with_status(0)
|
||||
.with_stdout(&format!("\
|
||||
{compiling} bar v0.0.1 ({dir})
|
||||
{compiling} bar v0.0.1 ({dir}/bar)
|
||||
{compiling} foo v0.0.1 ({dir})
|
||||
{running} target[..]foo-[..]
|
||||
|
||||
|
@ -1259,7 +1259,7 @@ test!(selective_testing {
|
|||
assert_that(p.cargo("test").arg("-p").arg("d1"),
|
||||
execs().with_status(0)
|
||||
.with_stdout(&format!("\
|
||||
{compiling} d1 v0.0.1 ({dir})
|
||||
{compiling} d1 v0.0.1 ({dir}/d1)
|
||||
{running} target[..]d1-[..]
|
||||
|
||||
running 0 tests
|
||||
|
@ -1279,7 +1279,7 @@ test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured
|
|||
assert_that(p.cargo("test").arg("-p").arg("d2"),
|
||||
execs().with_status(0)
|
||||
.with_stdout(&format!("\
|
||||
{compiling} d2 v0.0.1 ({dir})
|
||||
{compiling} d2 v0.0.1 ({dir}/d2)
|
||||
{running} target[..]d2-[..]
|
||||
|
||||
running 0 tests
|
||||
|
@ -1457,7 +1457,7 @@ test!(selective_testing_with_docs {
|
|||
assert_that(p.cargo("test").arg("-p").arg("d1"),
|
||||
execs().with_status(0)
|
||||
.with_stdout(&format!("\
|
||||
{compiling} d1 v0.0.1 ({dir})
|
||||
{compiling} d1 v0.0.1 ({dir}/d1)
|
||||
{running} target[..]deps[..]d1[..]
|
||||
|
||||
running 0 tests
|
||||
|
|
Loading…
Reference in a new issue