assert_that(p.cargo_process("build").arg("-v").arg("--target").arg(&target),
execs().with_status(101)
.with_stderr_contains("\
-[..]lib.rs[..] error: can't find crate for `aaaaa`[..]
-[..]lib.rs[..] extern crate aaaaa;
-[..] ^~~~~~~~~~~~~~~~~~~
-error: aborting due to previous error
+[..]can't find crate for `aaaaa`[..]
+")
+ .with_stderr_contains("\
[ERROR] Could not compile `foo`.
Caused by:
execs()
.with_status(101)
.with_stderr_contains("\
-src[..]foo.rs:1:1: 1:8 error: expected item[..]found `invalid`
-src[..]foo.rs:1 invalid rust code!
- ^~~~~~~
-")
- .with_stderr_contains("\
[ERROR] Could not compile `foo`.
To learn more, run the command again with --verbose.\n"));
.file("src/foo.rs", "fn main() {} fn dead() {}");
assert_that(p.cargo_process("build"),
- execs()
- .with_stderr("\
-[COMPILING] foo [..]
-src[..]foo.rs:1:14: 1:26 warning: function is never used: `dead`, \
- #[warn(dead_code)] on by default
-src[..]foo.rs:1 fn main() {} fn dead() {}
-[..] ^~~~~~~~~~~~
+ execs().with_stderr_contains("\
+[..]function is never used: `dead`[..]
"));
}
"#);
assert_that(p.cargo_process("build"),
- execs().with_stderr(&format!("\
-[COMPILING] bar v0.5.0 ({url}/bar)
-[..]warning: function is never used: `dead`[..]
-[..]fn dead() {{}}
-[..]^~~~~~~~~~~~
-[COMPILING] foo v0.5.0 ({url})
-", url = p.url())));
+ execs().with_stderr_contains("\
+[..]function is never used: `dead`[..]
+"));
assert_that(&p.bin("foo"), existing_file());
p.build();
assert_that(cargo_process("install").arg("--path").arg(p.root()),
- execs().with_status(101).with_stderr("\
-[COMPILING] foo v0.1.0 [..]
-error: main function not found
-error: aborting due to previous error
+ execs().with_status(101).with_stderr_contains("\
[ERROR] failed to compile `foo v0.1.0 (file://[..])`, intermediate artifacts can be \
found at `[..]target`