Fix build tests failing in CI.
--deny=warnings changes the error message for the tests too.
This commit is contained in:
parent
f154cf7f8b
commit
91a5177ea2
|
@ -8,7 +8,7 @@ on:
|
|||
env:
|
||||
CARGO_TERM_COLOR: always
|
||||
RUST_BACKTRACE: 1
|
||||
RUSTFLAGS: '--codegen=debuginfo=0 --deny=warnings'
|
||||
RUSTFLAGS: '--codegen=debuginfo=0'
|
||||
|
||||
jobs:
|
||||
test:
|
||||
|
|
|
@ -277,18 +277,20 @@ fn test(mut args: Vec<&str>) {
|
|||
)],
|
||||
);
|
||||
|
||||
let mut changes = 0;
|
||||
let mut changes = vec![];
|
||||
for m in util::git_modified() {
|
||||
if let Some(ext) = m.extension() {
|
||||
if ext == "stderr" && m.starts_with("tests/build/cases") {
|
||||
changes += 1;
|
||||
error(format!("build test `{}` modified", m.display()));
|
||||
util::print_git_diff(&m);
|
||||
changes.push(m);
|
||||
}
|
||||
}
|
||||
}
|
||||
if changes > 0 {
|
||||
fatal(format!("{changes} build tests modified, review and commit"));
|
||||
if !changes.is_empty() {
|
||||
for m in &changes {
|
||||
util::print_git_diff(&m);
|
||||
}
|
||||
fatal(format!("{} build tests modified, review and commit", changes.len()));
|
||||
}
|
||||
}
|
||||
} else if take_flag(&mut args, &["--examples"]) {
|
||||
|
|
|
@ -444,4 +444,4 @@ pub fn git_modified() -> Vec<PathBuf> {
|
|||
|
||||
pub fn print_git_diff(file: &std::path::Path) {
|
||||
Command::new("git").arg("diff").arg(file).status().unwrap();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue