mirror of
https://github.com/rust-lang/cargo
synced 2024-10-06 15:59:39 +00:00
more auto refactoring fixes
This commit is contained in:
parent
ca29668a5d
commit
e78956d1a6
|
@ -471,19 +471,19 @@ test!(testing_and_such {
|
|||
println!("test");
|
||||
assert_that(p.cargo("test").arg("-vj1"),
|
||||
execs().with_status(0)
|
||||
.with_stdout("\
|
||||
.with_stderr("\
|
||||
[COMPILING] foo v0.5.0 (file://[..])
|
||||
[RUNNING] `[..]build-script-build[..]`
|
||||
[RUNNING] `rustc [..] --crate-name foo [..]`
|
||||
[RUNNING] `rustc [..] --crate-name foo [..]`
|
||||
[RUNNING] `[..]foo-[..][..]`
|
||||
|
||||
[DOCTEST] foo
|
||||
[RUNNING] `rustdoc --test [..]`")
|
||||
.with_stdout("
|
||||
running 0 tests
|
||||
|
||||
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured
|
||||
|
||||
[DOCTEST] foo
|
||||
[RUNNING] `rustdoc --test [..]`
|
||||
|
||||
running 0 tests
|
||||
|
||||
|
@ -730,7 +730,7 @@ test!(build_cmd_with_a_build_cmd {
|
|||
|
||||
assert_that(p.cargo_process("build").arg("-v"),
|
||||
execs().with_status(0)
|
||||
.with_stdout("\
|
||||
.with_stderr("\
|
||||
[COMPILING] b v0.5.0 (file://[..])
|
||||
[RUNNING] `rustc [..] --crate-name b [..]`
|
||||
[COMPILING] a v0.5.0 (file://[..])
|
||||
|
@ -888,9 +888,10 @@ test!(code_generation {
|
|||
"#);
|
||||
assert_that(p.cargo_process("run"),
|
||||
execs().with_status(0)
|
||||
.with_stdout("\
|
||||
.with_stderr("\
|
||||
[COMPILING] foo v0.5.0 (file://[..])
|
||||
[RUNNING] `target[..]foo`
|
||||
[RUNNING] `target[..]foo`")
|
||||
.with_stdout("\
|
||||
Hello, World!
|
||||
"));
|
||||
|
||||
|
@ -1310,7 +1311,7 @@ test!(cfg_test {
|
|||
fn test_bar() {}
|
||||
"#);
|
||||
assert_that(p.cargo_process("test").arg("-v"),
|
||||
execs().with_stdout(format!("\
|
||||
execs().with_stderr(format!("\
|
||||
[COMPILING] foo v0.0.1 ({dir})
|
||||
[RUNNING] [..] build.rs [..]
|
||||
[RUNNING] [..]build-script-build[..]
|
||||
|
@ -1318,28 +1319,28 @@ test!(cfg_test {
|
|||
[RUNNING] [..] --cfg foo[..]
|
||||
[RUNNING] [..] --cfg foo[..]
|
||||
[RUNNING] [..]foo-[..]
|
||||
|
||||
[RUNNING] [..]test-[..]
|
||||
[DOCTEST] foo
|
||||
[RUNNING] [..] --cfg foo[..]", dir = p.url()))
|
||||
.with_stdout("
|
||||
running 1 test
|
||||
test test_foo ... ok
|
||||
|
||||
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured
|
||||
|
||||
[RUNNING] [..]test-[..]
|
||||
|
||||
running 1 test
|
||||
test test_bar ... ok
|
||||
|
||||
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured
|
||||
|
||||
[DOCTEST] foo
|
||||
[RUNNING] [..] --cfg foo[..]
|
||||
|
||||
running 1 test
|
||||
test foo_0 ... ok
|
||||
|
||||
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured
|
||||
|
||||
", dir = p.url())));
|
||||
"));
|
||||
});
|
||||
|
||||
test!(cfg_doc {
|
||||
|
@ -1426,34 +1427,34 @@ test!(cfg_override_test {
|
|||
fn test_bar() {}
|
||||
"#);
|
||||
assert_that(p.cargo_process("test").arg("-v"),
|
||||
execs().with_stdout(format!("\
|
||||
execs().with_stderr(format!("\
|
||||
[COMPILING] foo v0.0.1 ({dir})
|
||||
[RUNNING] `[..]`
|
||||
[RUNNING] `[..]`
|
||||
[RUNNING] `[..]`
|
||||
[RUNNING] [..]foo-[..]
|
||||
|
||||
[RUNNING] [..]test-[..]
|
||||
[DOCTEST] foo
|
||||
[RUNNING] [..] --cfg foo[..]", dir = p.url()))
|
||||
.with_stdout("
|
||||
running 1 test
|
||||
test test_foo ... ok
|
||||
|
||||
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured
|
||||
|
||||
[RUNNING] [..]test-[..]
|
||||
|
||||
running 1 test
|
||||
test test_bar ... ok
|
||||
|
||||
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured
|
||||
|
||||
[DOCTEST] foo
|
||||
[RUNNING] [..] --cfg foo[..]
|
||||
|
||||
running 1 test
|
||||
test foo_0 ... ok
|
||||
|
||||
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured
|
||||
|
||||
", dir = p.url())));
|
||||
"));
|
||||
});
|
||||
|
||||
test!(cfg_override_doc {
|
||||
|
@ -1537,7 +1538,8 @@ test!(flags_go_into_tests {
|
|||
"#);
|
||||
|
||||
assert_that(p.cargo_process("test").arg("-v").arg("--test=foo"),
|
||||
execs().with_status(0).with_stdout("\
|
||||
execs().with_status(0)
|
||||
.with_stderr("\
|
||||
[COMPILING] a v0.5.0 ([..]
|
||||
[RUNNING] `rustc a[..]build.rs [..]`
|
||||
[RUNNING] `[..]build-script-build[..]`
|
||||
|
@ -1547,8 +1549,8 @@ test!(flags_go_into_tests {
|
|||
[COMPILING] foo v0.5.0 ([..]
|
||||
[RUNNING] `rustc src[..]lib.rs [..] -L test[..]`
|
||||
[RUNNING] `rustc tests[..]foo.rs [..] -L test[..]`
|
||||
[RUNNING] `[..]foo-[..]`
|
||||
|
||||
[RUNNING] `[..]foo-[..]`")
|
||||
.with_stdout("
|
||||
running 0 tests
|
||||
|
||||
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured
|
||||
|
@ -1556,12 +1558,13 @@ 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("\
|
||||
execs().with_status(0)
|
||||
.with_stderr("\
|
||||
[FRESH] a v0.5.0 ([..]
|
||||
[COMPILING] b v0.5.0 ([..]
|
||||
[RUNNING] `rustc b[..]src[..]lib.rs [..] -L test[..]`
|
||||
[RUNNING] `[..]b-[..]`
|
||||
|
||||
[RUNNING] `[..]b-[..]`")
|
||||
.with_stdout("
|
||||
running 0 tests
|
||||
|
||||
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured
|
||||
|
|
|
@ -615,7 +615,7 @@ test!(update_with_shared_deps {
|
|||
|
||||
// First time around we should compile both foo and bar
|
||||
assert_that(p.cargo_process("build"),
|
||||
execs().with_stdout(&format!("\
|
||||
execs().with_stderr(&format!("\
|
||||
[UPDATING] git repository `{git}`
|
||||
[COMPILING] bar v0.5.0 ({git}#[..])
|
||||
[COMPILING] [..] v0.5.0 ([..])
|
||||
|
@ -670,7 +670,7 @@ To learn more, run the command again with --verbose.
|
|||
// Make sure we still only compile one version of the git repo
|
||||
println!("build");
|
||||
assert_that(p.cargo("build"),
|
||||
execs().with_stdout(&format!("\
|
||||
execs().with_stderr(&format!("\
|
||||
[COMPILING] bar v0.5.0 ({git}#[..])
|
||||
[COMPILING] [..] v0.5.0 ({dir}[..]dep[..])
|
||||
[COMPILING] [..] v0.5.0 ({dir}[..]dep[..])
|
||||
|
@ -998,11 +998,11 @@ 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("\
|
||||
execs().with_stderr("\
|
||||
[COMPILING] [..] v0.5.0 ([..])
|
||||
[COMPILING] [..] v0.5.0 ([..]
|
||||
[RUNNING] target[..]foo-[..]
|
||||
|
||||
[RUNNING] target[..]foo-[..]")
|
||||
.with_stdout("
|
||||
running 1 test
|
||||
test tests::foo ... ok
|
||||
|
||||
|
|
|
@ -741,16 +741,16 @@ test!(dev_deps_no_rebuild_lib {
|
|||
|
||||
assert_that(p.cargo("test"),
|
||||
execs().with_status(0)
|
||||
.with_stdout(&format!("\
|
||||
.with_stderr(&format!("\
|
||||
[COMPILING] [..] v0.5.0 ({url}[..])
|
||||
[COMPILING] [..] v0.5.0 ({url}[..])
|
||||
[RUNNING] target[..]foo-[..]
|
||||
|
||||
[RUNNING] target[..]foo-[..]", url = p.url()))
|
||||
.with_stdout("
|
||||
running 0 tests
|
||||
|
||||
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured
|
||||
|
||||
", url = p.url())));
|
||||
"));
|
||||
});
|
||||
|
||||
test!(custom_target_no_rebuild {
|
||||
|
|
|
@ -460,23 +460,23 @@ test!(cross_tests {
|
|||
let target = alternate();
|
||||
assert_that(p.cargo_process("test").arg("--target").arg(&target),
|
||||
execs().with_status(0)
|
||||
.with_stdout(&format!("\
|
||||
.with_stderr(&format!("\
|
||||
[COMPILING] foo v0.0.0 ({foo})
|
||||
[RUNNING] target[..]{triple}[..]bar-[..]
|
||||
|
||||
[RUNNING] target[..]{triple}[..]foo-[..]", foo = p.url(), triple = target))
|
||||
.with_stdout("
|
||||
running 1 test
|
||||
test test ... ok
|
||||
|
||||
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured
|
||||
|
||||
[RUNNING] target[..]{triple}[..]foo-[..]
|
||||
|
||||
running 1 test
|
||||
test test_foo ... ok
|
||||
|
||||
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured
|
||||
|
||||
", foo = p.url(), triple = target)));
|
||||
"));
|
||||
});
|
||||
|
||||
test!(no_cross_doctests {
|
||||
|
@ -525,15 +525,15 @@ test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured
|
|||
let target = alternate();
|
||||
assert_that(p.cargo_process("test").arg("--target").arg(&target),
|
||||
execs().with_status(0)
|
||||
.with_stdout(&format!("\
|
||||
.with_stderr(&format!("\
|
||||
[COMPILING] foo v0.0.0 ({foo})
|
||||
[RUNNING] target[..]{triple}[..]foo-[..]
|
||||
|
||||
[RUNNING] target[..]{triple}[..]foo-[..]", foo = p.url(), triple = target))
|
||||
.with_stdout("
|
||||
running 0 tests
|
||||
|
||||
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured
|
||||
|
||||
", foo = p.url(), triple = target)));
|
||||
"));
|
||||
});
|
||||
|
||||
test!(simple_cargo_run {
|
||||
|
|
|
@ -186,7 +186,8 @@ test!(cargo_test_failing_test {
|
|||
assert_that(p.cargo("test"),
|
||||
execs().with_stderr(format!("\
|
||||
[COMPILING] foo v0.5.0 ({url})
|
||||
[RUNNING] target[..]foo-[..]", url = p.url()))
|
||||
[RUNNING] target[..]foo-[..]
|
||||
[ERROR] test failed", url = p.url()))
|
||||
.with_stdout_contains("
|
||||
running 1 test
|
||||
test test_hello ... FAILED
|
||||
|
@ -2058,15 +2059,16 @@ test!(only_test_docs {
|
|||
p.build();
|
||||
|
||||
assert_that(p.cargo("test").arg("--doc"),
|
||||
execs().with_status(0).with_stdout(&format!("\
|
||||
execs().with_status(0)
|
||||
.with_stderr(&format!("\
|
||||
[COMPILING] foo v0.0.1 ([..])
|
||||
[DOCTEST] foo
|
||||
|
||||
[DOCTEST] foo"))
|
||||
.with_stdout("
|
||||
running 1 test
|
||||
test bar_0 ... ok
|
||||
|
||||
test result: ok.[..]
|
||||
|
||||
")));
|
||||
"));
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in a new issue