rt test: rule 2's scan labels each source with / on every host

The scan labelled each product source by Path::display, which joins its
components with `\` on Windows. The labels the tests name and the allowances
key on are written with `/`, so on the UHD 630 under Windows (job
m3-max-82853, at aed8b7eba3) the_scan_reads_the_translators_product_sources_alone
found no "metal2vulkan/src/device/description.rs". And
the_product_sources_take_one_path_for_every_device reported allowed lines,
such as "metal2vulkan/src/ash_interop\convert.rs:36 DriverId", as findings.
The label now joins the path's components with `/`. Test-only:
runtime-sources.sha256 is unchanged (recomputed: 3ec63863).
This commit is contained in:
Anees Iqbal committed 2026-12-03 01:47:02 -08:00
1 parent cd356da852
commit 22861fde72
1 file changed
+6 -2
@@ -330,11 +330,15 @@ fn translator_sources(name: &str) -> Vec<(String, String)> {
.into_iter()
.filter(|(path, _)| !test_modules.iter().any(|module| path.starts_with(module)))
.map(|(path, text)| {
// Joined with `/` on every host: `Path::display` joins with `\` on Windows, and the
// labels the tests name and the allowances key on are written with `/`.
let label = path
.strip_prefix(&root)
.unwrap_or(&path)
.display()
.to_string();
.components()
.map(|part| part.as_os_str().to_string_lossy())
.collect::<Vec<_>>()
.join("/");
(format!("{name}/src/{label}"), without_inline_tests(&text))
})
.collect()