about summary refs log tree commit diff
diff options
context:
space:
mode:
author许杰友 Jieyou Xu (Joe) <jieyouxu@outlook.com>2024-03-22 19:07:25 +0000
committer许杰友 Jieyou Xu (Joe) <jieyouxu@outlook.com>2024-03-27 20:00:34 +0000
commit7cf69a82304e1d01ea54b029a9e76af7f00e459b (patch)
tree2d56bbe7c611f015e327730709b4268cce40771b
parentec25a425aa5f1e49213aafa7af9394fa96ef9207 (diff)
downloadrust-7cf69a82304e1d01ea54b029a9e76af7f00e459b.tar.gz
rust-7cf69a82304e1d01ea54b029a9e76af7f00e459b.zip
Pass tests_path and src_path separately
-rw-r--r--src/tools/tidy/src/main.rs2
-rw-r--r--src/tools/tidy/src/run_make_tests.rs6
2 files changed, 3 insertions, 5 deletions
diff --git a/src/tools/tidy/src/main.rs b/src/tools/tidy/src/main.rs
index c823d46b2bd..bf5c0afdbb0 100644
--- a/src/tools/tidy/src/main.rs
+++ b/src/tools/tidy/src/main.rs
@@ -103,7 +103,7 @@ fn main() {
         check!(tests_revision_unpaired_stdout_stderr, &tests_path);
         check!(debug_artifacts, &tests_path);
         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!(rustdoc_gui_tests, &tests_path);
         check!(rustdoc_css_themes, &librustdoc_path);
diff --git a/src/tools/tidy/src/run_make_tests.rs b/src/tools/tidy/src/run_make_tests.rs
index 0231ac0939e..2d34bfc28f4 100644
--- a/src/tools/tidy/src/run_make_tests.rs
+++ b/src/tools/tidy/src/run_make_tests.rs
@@ -5,9 +5,7 @@ use std::fs::File;
 use std::io::Write;
 use std::path::{Path, PathBuf};
 
-pub fn check(root_path: &Path, bless: bool, bad: &mut bool) {
-    let tests_path = &root_path.join("tests");
-
+pub fn check(tests_path: &Path, src_path: &Path, bless: bool, bad: &mut bool) {
     let allowed_makefiles = {
         // 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
@@ -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 temp_file_path = tidy_src.join("blessed_expected_run_make_makefiles.txt");
         let mut temp_file = t!(File::create_new(&temp_file_path));