Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix tests for RUST_NEW_ERROR_FORMAT #2742

Merged
merged 1 commit into from
May 27, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions tests/build-script.rs
Original file line number Diff line number Diff line change
Expand Up @@ -698,10 +698,9 @@ fn build_deps_not_for_normal() {
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:
Expand Down
24 changes: 5 additions & 19 deletions tests/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -238,11 +238,6 @@ fn cargo_compile_with_invalid_code() {
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"));
Expand Down Expand Up @@ -282,13 +277,8 @@ fn cargo_compile_with_warnings_in_the_root_package() {
.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`[..]
"));
}

Expand Down Expand Up @@ -333,13 +323,9 @@ fn cargo_compile_with_warnings_in_a_dep_package() {
"#);

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());

Expand Down
2 changes: 1 addition & 1 deletion tests/cross-compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -895,7 +895,7 @@ fn platform_specific_dependencies_do_not_leak() {
assert_that(p.cargo_process("build").arg("-v").arg("--target").arg(&target),
execs().with_status(101)
.with_stderr_contains("\
[..] error: can't find crate for `d2`[..]"));
[..] can't find crate for `d2`[..]"));
}

#[test]
Expand Down
5 changes: 1 addition & 4 deletions tests/install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -527,10 +527,7 @@ fn compile_failure() {
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`

Expand Down