Skip to content

Commit 3c6bae7

Browse files
Use the correct folder when deleting rust UI tests
1 parent 4bed89f commit 3c6bae7

File tree

1 file changed

+15
-11
lines changed

1 file changed

+15
-11
lines changed

build_system/src/test.rs

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -942,13 +942,15 @@ where
942942
Ok(())
943943
}
944944

945-
walk_dir("rust/tests/ui", dir_handling, file_handling)?;
946-
let file = "rust/tests/ui/consts/const_cmp_type_id.rs";
947-
std::fs::remove_file(file)
948-
.map_err(|error| format!("Failed to remove `{}`: {:?}", file, error))?;
949-
let file = "rust/tests/ui/consts/issue-73976-monomorphic.rs";
950-
std::fs::remove_file(file)
951-
.map_err(|error| format!("Failed to remove `{}`: {:?}", file, error))?;
945+
let rust_path = Path::new("rust");
946+
947+
walk_dir(rust_path.join("tests/ui"), dir_handling, file_handling)?;
948+
let file = rust_path.join("tests/ui/consts/const_cmp_type_id.rs");
949+
std::fs::remove_file(&file)
950+
.map_err(|error| format!("Failed to remove `{}`: {:?}", file.display(), error))?;
951+
let file = rust_path.join("tests/ui/consts/issue-73976-monomorphic.rs");
952+
std::fs::remove_file(&file)
953+
.map_err(|error| format!("Failed to remove `{}`: {:?}", file.display(), error))?;
952954

953955
if !callback()? {
954956
// FIXME: create a function "display_if_not_quiet" or something along the line.
@@ -976,7 +978,7 @@ where
976978
&"-path",
977979
&"*/auxiliary/*",
978980
],
979-
Some(Path::new("rust")),
981+
Some(rust_path),
980982
)?
981983
.stdout,
982984
)
@@ -997,8 +999,10 @@ where
997999
if pos >= start && pos <= end {
9981000
continue;
9991001
}
1000-
std::fs::remove_file(path)
1001-
.map_err(|error| format!("Failed to remove `{}`: {:?}", path, error))?;
1002+
let test_path = rust_path.join(path);
1003+
std::fs::remove_file(&test_path).map_err(|error| {
1004+
format!("Failed to remove `{}`: {:?}", test_path.display(), error)
1005+
})?;
10021006
}
10031007
}
10041008

@@ -1020,7 +1024,7 @@ where
10201024
&"--rustc-args",
10211025
&rustc_args,
10221026
],
1023-
Some(Path::new("rust")),
1027+
Some(rust_path),
10241028
Some(&env),
10251029
)?;
10261030
Ok(())

0 commit comments

Comments
 (0)