about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorTim Neumann <timnn@google.com>2023-01-06 11:49:07 +0000
committerTim Neumann <timnn@google.com>2023-01-16 18:33:25 +0000
commitcd1d0bc20cd2c18ec844f6447396dadf90b762e9 (patch)
tree618cb98dc47357fe25b07a9dda39d6590c650558 /src
parent10fe7bfc7394b32471f1bad199fd9f8300cd80c2 (diff)
downloadrust-cd1d0bc20cd2c18ec844f6447396dadf90b762e9.tar.gz
rust-cd1d0bc20cd2c18ec844f6447396dadf90b762e9.zip
ui tests: Remap test base directory by default.
Diffstat (limited to 'src')
-rw-r--r--src/tools/compiletest/src/header.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/tools/compiletest/src/header.rs b/src/tools/compiletest/src/header.rs
index fd4b51d637c..899f068bd3d 100644
--- a/src/tools/compiletest/src/header.rs
+++ b/src/tools/compiletest/src/header.rs
@@ -278,6 +278,9 @@ impl TestProps {
     /// `//[foo]`), then the property is ignored unless `cfg` is
     /// `Some("foo")`.
     fn load_from(&mut self, testfile: &Path, cfg: Option<&str>, config: &Config) {
+        // Mode-dependent defaults.
+        self.remap_src_base = config.mode == Mode::Ui && !config.suite.contains("rustdoc");
+
         let mut has_edition = false;
         if !testfile.is_dir() {
             let file = File::open(testfile).unwrap();