about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAndy Wang <cbeuw.andy@gmail.com>2021-05-03 17:12:10 +0100
committerAndy Wang <cbeuw.andy@gmail.com>2021-05-04 17:35:42 +0100
commitd66506d3532848d5f52301d0c328d79673d7f551 (patch)
tree72d3f07096b3bb9777ca3eeaee05915cded62b29
parent65520ec802f77ab191423f3a1507d6c0be7cfb9c (diff)
downloadrust-d66506d3532848d5f52301d0c328d79673d7f551.tar.gz
rust-d66506d3532848d5f52301d0c328d79673d7f551.zip
Normalise remapped sysroot path as $SRC_DIR
-rw-r--r--src/tools/compiletest/src/runtest.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs
index ecbaccf744d..675d43de839 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();