From d66506d3532848d5f52301d0c328d79673d7f551 Mon Sep 17 00:00:00 2001 From: Andy Wang Date: Mon, 3 May 2021 17:12:10 +0100 Subject: [PATCH] Normalise remapped sysroot path as $SRC_DIR --- src/tools/compiletest/src/runtest.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs index ecbaccf744dc..675d43de8395 100644 --- a/src/tools/compiletest/src/runtest.rs +++ b/src/tools/compiletest/src/runtest.rs @@ -3616,6 +3616,12 @@ impl<'test> TestCx<'test> { .join("library"); normalize_path(&src_dir, "$SRC_DIR"); + if let Some(virtual_rust_source_base_dir) = + option_env!("CFG_VIRTUAL_RUST_SOURCE_BASE_DIR").map(PathBuf::from) + { + normalize_path(&virtual_rust_source_base_dir.join("library"), "$SRC_DIR"); + } + // Paths into the build directory let test_build_dir = &self.config.build_base; let parent_build_dir = test_build_dir.parent().unwrap().parent().unwrap().parent().unwrap();