mirror of
https://github.com/rust-lang/cargo.git
synced 2025-10-01 11:30:39 +00:00
Fix cargo errors counter
This commit is contained in:
parent
d5d9c35e5f
commit
b7b5a093a1
@ -422,7 +422,7 @@ fn rustc(cx: &mut Context<'_, '_>, unit: &Unit, exec: &Arc<dyn Executor>) -> Car
|
|||||||
};
|
};
|
||||||
let errors = match output_options.errors_seen {
|
let errors = match output_options.errors_seen {
|
||||||
0 => String::new(),
|
0 => String::new(),
|
||||||
1 => " due to previous error".to_string(),
|
1 => " due to 1 previous error".to_string(),
|
||||||
count => format!(" due to {} previous errors", count),
|
count => format!(" due to {} previous errors", count),
|
||||||
};
|
};
|
||||||
let name = descriptive_pkg_name(&name, &target, &mode);
|
let name = descriptive_pkg_name(&name, &target, &mode);
|
||||||
|
@ -760,7 +760,7 @@ fn cargo_compile_with_invalid_code() {
|
|||||||
p.cargo("build")
|
p.cargo("build")
|
||||||
.with_status(101)
|
.with_status(101)
|
||||||
.with_stderr_contains(
|
.with_stderr_contains(
|
||||||
"[ERROR] could not compile `foo` (bin \"foo\") due to previous error\n",
|
"[ERROR] could not compile `foo` (bin \"foo\") due to 1 previous error\n",
|
||||||
)
|
)
|
||||||
.run();
|
.run();
|
||||||
assert!(p.root().join("Cargo.lock").is_file());
|
assert!(p.root().join("Cargo.lock").is_file());
|
||||||
|
@ -1716,7 +1716,7 @@ fn build_deps_not_for_normal() {
|
|||||||
.with_stderr_contains("[..]can't find crate for `aaaaa`[..]")
|
.with_stderr_contains("[..]can't find crate for `aaaaa`[..]")
|
||||||
.with_stderr_contains(
|
.with_stderr_contains(
|
||||||
"\
|
"\
|
||||||
[ERROR] could not compile `foo` (lib) due to previous error
|
[ERROR] could not compile `foo` (lib) due to 1 previous error
|
||||||
|
|
||||||
Caused by:
|
Caused by:
|
||||||
process didn't exit successfully: [..]
|
process didn't exit successfully: [..]
|
||||||
|
@ -804,7 +804,7 @@ fn short_message_format() {
|
|||||||
.with_stderr_contains(
|
.with_stderr_contains(
|
||||||
"\
|
"\
|
||||||
src/lib.rs:1:27: error[E0308]: mismatched types
|
src/lib.rs:1:27: error[E0308]: mismatched types
|
||||||
error: could not compile `foo` (lib) due to previous error
|
error: could not compile `foo` (lib) due to 1 previous error
|
||||||
",
|
",
|
||||||
)
|
)
|
||||||
.run();
|
.run();
|
||||||
@ -1250,7 +1250,7 @@ fn check_fixable_error_no_fix() {
|
|||||||
[CHECKING] foo v0.0.1 ([..])
|
[CHECKING] foo v0.0.1 ([..])
|
||||||
{}\
|
{}\
|
||||||
[WARNING] `foo` (lib) generated 1 warning
|
[WARNING] `foo` (lib) generated 1 warning
|
||||||
[ERROR] could not compile `foo` (lib) due to previous error; 1 warning emitted
|
[ERROR] could not compile `foo` (lib) due to 1 previous error; 1 warning emitted
|
||||||
",
|
",
|
||||||
rustc_message
|
rustc_message
|
||||||
);
|
);
|
||||||
|
@ -29,7 +29,7 @@ fn do_not_fix_broken_builds() {
|
|||||||
p.cargo("fix --allow-no-vcs")
|
p.cargo("fix --allow-no-vcs")
|
||||||
.env("__CARGO_FIX_YOLO", "1")
|
.env("__CARGO_FIX_YOLO", "1")
|
||||||
.with_status(101)
|
.with_status(101)
|
||||||
.with_stderr_contains("[ERROR] could not compile `foo` (lib) due to previous error")
|
.with_stderr_contains("[ERROR] could not compile `foo` (lib) due to 1 previous error")
|
||||||
.run();
|
.run();
|
||||||
assert!(p.read_file("src/lib.rs").contains("let mut x = 3;"));
|
assert!(p.read_file("src/lib.rs").contains("let mut x = 3;"));
|
||||||
}
|
}
|
||||||
|
@ -1010,7 +1010,7 @@ fn compile_failure() {
|
|||||||
.with_status(101)
|
.with_status(101)
|
||||||
.with_stderr_contains(
|
.with_stderr_contains(
|
||||||
"\
|
"\
|
||||||
[ERROR] could not compile `foo` (bin \"foo\") due to previous error
|
[ERROR] could not compile `foo` (bin \"foo\") due to 1 previous error
|
||||||
[ERROR] failed to compile `foo v0.0.1 ([..])`, intermediate artifacts can be \
|
[ERROR] failed to compile `foo v0.0.1 ([..])`, intermediate artifacts can be \
|
||||||
found at `[..]target`.\nTo reuse those artifacts with a future compilation, \
|
found at `[..]target`.\nTo reuse those artifacts with a future compilation, \
|
||||||
set the environment variable `CARGO_TARGET_DIR` to that path.
|
set the environment variable `CARGO_TARGET_DIR` to that path.
|
||||||
|
@ -136,7 +136,7 @@ fn deduplicate_errors() {
|
|||||||
.with_stderr(&format!(
|
.with_stderr(&format!(
|
||||||
"\
|
"\
|
||||||
[COMPILING] foo v0.0.1 [..]
|
[COMPILING] foo v0.0.1 [..]
|
||||||
{}error: could not compile `foo` (lib) due to previous error
|
{}error: could not compile `foo` (lib) due to 1 previous error
|
||||||
",
|
",
|
||||||
rustc_message
|
rustc_message
|
||||||
))
|
))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user