about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEtomicBomb <ethan@ethan.ws>2024-07-31 00:20:56 +0000
committerEtomicBomb <ethan@ethan.ws>2024-07-31 00:20:56 +0000
commitbd23e0eb2694752f573eafd0d894a2b16d10fd7b (patch)
treee11b8974071e7a56fcbf9fd6bc8a6b5b41beff4b
parentf91da72cb75f03739985926c5e5561611f783b80 (diff)
downloadrust-bd23e0eb2694752f573eafd0d894a2b16d10fd7b.tar.gz
rust-bd23e0eb2694752f573eafd0d894a2b16d10fd7b.zip
canonicalize path in another place to fix #128411
-rw-r--r--src/tools/compiletest/src/runtest.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs
index 55f676e7086..2b7601a7c73 100644
--- a/src/tools/compiletest/src/runtest.rs
+++ b/src/tools/compiletest/src/runtest.rs
@@ -2968,7 +2968,9 @@ impl<'test> TestCx<'test> {
         for _ in res.stdout.split('\n').filter(|s| s.starts_with("test ")).inspect(|s| {
             if let Some((left, right)) = s.split_once(" - ") {
                 let path = left.rsplit("test ").next().unwrap();
-                if let Some(ref mut v) = files.get_mut(&path.replace('\\', "/")) {
+                let path = fs::canonicalize(&path).expect("failed to canonicalize");
+                let path = path.to_str().unwrap().replace('\\', "/");
+                if let Some(ref mut v) = files.get_mut(&path) {
                     tested += 1;
                     let mut iter = right.split("(line ");
                     iter.next();