Merge commit 'feb42827f11a7ae241ceecc81e9ae556fb6ba214' into subtree-update_cg_gcc_2025-08-26

This commit is contained in:
Guillaume Gomez
2025-08-26 17:18:15 +02:00
16 changed files with 75 additions and 59 deletions

View File

@@ -1,7 +1,7 @@
use std::ffi::OsStr;
use std::path::Path;
use crate::utils::run_command_with_output;
use crate::utils::{run_command_with_output, walk_dir};
fn show_usage() {
println!(
@@ -32,5 +32,31 @@ pub fn run() -> Result<(), String> {
if check { &[&"cargo", &"fmt", &"--check"] } else { &[&"cargo", &"fmt"] };
run_command_with_output(cmd, Some(Path::new(".")))?;
run_command_with_output(cmd, Some(Path::new("build_system")))
run_command_with_output(cmd, Some(Path::new("build_system")))?;
run_rustfmt_recursively("tests/run", check)
}
fn run_rustfmt_recursively<P>(dir: P, check: bool) -> Result<(), String>
where
P: AsRef<Path>,
{
walk_dir(
dir,
&mut |dir| run_rustfmt_recursively(dir, check),
&mut |file_path| {
if file_path.extension().filter(|ext| ext == &OsStr::new("rs")).is_some() {
let rustfmt_cmd: &[&dyn AsRef<OsStr>] = if check {
&[&"rustfmt", &"--check", &file_path]
} else {
&[&"rustfmt", &file_path]
};
run_command_with_output(rustfmt_cmd, Some(Path::new(".")))
} else {
Ok(())
}
},
true,
)
}

View File

@@ -531,7 +531,7 @@ fn setup_rustc(env: &mut Env, args: &TestArg) -> Result<PathBuf, String> {
r#"change-id = 115898
[rust]
codegen-backends = []
codegen-backends = ["gcc"]
deny-warnings = false
verbose-tests = true