Pass tests_path and src_path separately

This commit is contained in:
许杰友 Jieyou Xu (Joe) 2024-03-22 19:07:25 +00:00
parent ec25a425aa
commit 7cf69a8230
No known key found for this signature in database
GPG Key ID: 95DDEBD74A1DC2C0
2 changed files with 3 additions and 5 deletions

View File

@ -103,7 +103,7 @@ fn main() {
check!(tests_revision_unpaired_stdout_stderr, &tests_path); check!(tests_revision_unpaired_stdout_stderr, &tests_path);
check!(debug_artifacts, &tests_path); check!(debug_artifacts, &tests_path);
check!(ui_tests, &root_path, bless); check!(ui_tests, &root_path, bless);
check!(run_make_tests, &root_path, bless); check!(run_make_tests, &tests_path, &src_path, bless);
check!(mir_opt_tests, &tests_path, bless); check!(mir_opt_tests, &tests_path, bless);
check!(rustdoc_gui_tests, &tests_path); check!(rustdoc_gui_tests, &tests_path);
check!(rustdoc_css_themes, &librustdoc_path); check!(rustdoc_css_themes, &librustdoc_path);

View File

@ -5,9 +5,7 @@ use std::fs::File;
use std::io::Write; use std::io::Write;
use std::path::{Path, PathBuf}; use std::path::{Path, PathBuf};
pub fn check(root_path: &Path, bless: bool, bad: &mut bool) { pub fn check(tests_path: &Path, src_path: &Path, bless: bool, bad: &mut bool) {
let tests_path = &root_path.join("tests");
let allowed_makefiles = { let allowed_makefiles = {
// We use `include!` here which includes the file as Rust syntax because we want to have // We use `include!` here which includes the file as Rust syntax because we want to have
// a comment that discourages people from adding entries to // a comment that discourages people from adding entries to
@ -76,7 +74,7 @@ pub fn check(root_path: &Path, bless: bool, bad: &mut bool) {
*/ */
[ [
"#; "#;
let tidy_src = root_path.join("src").join("tools").join("tidy").join("src"); let tidy_src = src_path.join("tools").join("tidy").join("src");
let org_file_path = tidy_src.join("expected_run_make_makefiles.txt"); let org_file_path = tidy_src.join("expected_run_make_makefiles.txt");
let temp_file_path = tidy_src.join("blessed_expected_run_make_makefiles.txt"); let temp_file_path = tidy_src.join("blessed_expected_run_make_makefiles.txt");
let mut temp_file = t!(File::create_new(&temp_file_path)); let mut temp_file = t!(File::create_new(&temp_file_path));