]> git.proxmox.com Git - cargo.git/commitdiff
Fix tests for RUST_NEW_ERROR_FORMAT
authorAlex Crichton <alex@alexcrichton.com>
Wed, 25 May 2016 17:04:39 +0000 (10:04 -0700)
committerAlex Crichton <alex@alexcrichton.com>
Thu, 26 May 2016 07:40:40 +0000 (00:40 -0700)
A few tests were a bit too strict in the output they were looking for, this
instead relaxes some assertions to just what we're interested in.

tests/build-script.rs
tests/build.rs
tests/cross-compile.rs
tests/install.rs

index 9b14cbc370f5bfac6fe01f7446fe55af94909c42..964a315f4aa82dde12ce0a19a764345bb515d7df 100644 (file)
@@ -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:
index 4f632113b10d94444429f9f86517dbc3ea1b71bf..a5ac1a63cf010aad95eaef8b790e8929a1221a47 100644 (file)
@@ -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"));
@@ -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`[..]
 "));
 }
 
@@ -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());
 
index 7578454d7116d2c09e9dfb6822398d92b635d0c6..d4246fa8234a6a2e28cf3b97176d4ef72608c6cd 100644 (file)
@@ -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]
index 71b61b5e97f7c333945f7a407bef90c36e6a5c7a..0547c44199942210441561240ab49248b064a566 100644 (file)
@@ -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`