The dev tools find the fixtures beside the crate the test runner names

devtools::fixtures_dir() returned the validation crate's fixtures/public beside the dev-tools
crate as it was built (env! of CARGO_MANIFEST_DIR at compile time). A nextest archive built on one
machine and run on another, as the GPU nodes now run every device leg (built on msi, carried to
um790), therefore read the build machine's paths and found no fixtures. It now looks first beside
the manifest directory the test runner names at run time (cargo test and cargo nextest set
CARGO_MANIFEST_DIR for the test's crate; a run with --workspace-remap names it in that machine's
checkout), and falls back to the build-time path where that directory has no fixtures.

Test infrastructure only (metal2vulkan-devtools, unpublished); no product path reads it.

Verified (devcopy, 5c30935a78): validation-lane archives built on msi ran their fixture tests on
um790 (the XTX device_copy run 27511 and the 2080 run 27575 read their fixtures through it).
This commit is contained in:
Anees Iqbal committed 2026-11-13 18:43:40 -08:00
1 parent 9f897f2544
commit ea5d2b5dbb
1 file changed
+14 -6
+14 -6
View File
@@ -35,13 +35,21 @@ pub mod stitched;
pub mod tools;
pub mod xr_bicubic;
/// The validation crate's `fixtures/public` beside this crate
/// (`crates/metal2vulkan-validation/fixtures/public`, read-only).
/// The validation crate's `fixtures/public` (`crates/metal2vulkan-validation/fixtures/public`,
/// read-only): beside the manifest directory the test runner names as a test runs (`cargo test`
/// and `cargo nextest` name the test's crate; a run of a nextest archive on another machine names
/// it in that machine's checkout, `--workspace-remap`), else beside this crate as it was built.
pub fn fixtures_dir() -> PathBuf {
Path::new(env!("CARGO_MANIFEST_DIR"))
.parent()
.expect("the dev-tools crate lies in the workspace's crates/")
.join("metal2vulkan-validation/fixtures/public")
let beside = |manifest: &Path| {
(manifest.parent()).map(|crates| crates.join("metal2vulkan-validation/fixtures/public"))
};
let running = std::env::var_os("CARGO_MANIFEST_DIR")
.and_then(|manifest| beside(Path::new(&manifest)))
.filter(|fixtures| fixtures.is_dir());
running.unwrap_or_else(|| {
beside(Path::new(env!("CARGO_MANIFEST_DIR")))
.expect("the dev-tools crate lies in the workspace's crates/")
})
}
/// [`fixtures_dir`]'s `engine` (read-only; the engine's own fixtures).