[llvm] [lit] [test] Fix the shtest-readfile test on Python 3.13 on Windows (PR #160503)
Martin Storsjö via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 24 04:13:44 PDT 2025
https://github.com/mstorsjo created https://github.com/llvm/llvm-project/pull/160503
Python 3.13 considers "/file/does/not/exist" to not be an absolute path on Windows, so the test runner does os.path.join(cwd, filePath), which can end up with an output path such as "D:/file/does/not/exist".
Accept a potential prefix before the missing path here.
This fixes running the lit tests on Windows with Python 3.13.
>From 8aebb71e5f29d96f7fd2ddf67c2985f526d9933f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Martin=20Storsj=C3=B6?= <martin at martin.st>
Date: Wed, 24 Sep 2025 13:29:20 +0300
Subject: [PATCH] [lit] [test] Fix the shtest-readfile test on Python 3.13 on
Windows
Python 3.13 considers "/file/does/not/exist" to not be an absolute
path on Windows, so the test runner does os.path.join(cwd, filePath),
which can end up with an output path such as "D:/file/does/not/exist".
Accept a potential prefix before the missing path here.
This fixes running the lit tests on Windows with Python 3.13.
---
llvm/utils/lit/tests/shtest-readfile.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/llvm/utils/lit/tests/shtest-readfile.py b/llvm/utils/lit/tests/shtest-readfile.py
index a122dd76642723..f2e4fb0a9e169f 100644
--- a/llvm/utils/lit/tests/shtest-readfile.py
+++ b/llvm/utils/lit/tests/shtest-readfile.py
@@ -10,7 +10,7 @@
# CHECK-LABEL: FAIL: shtest-readfile :: file-does-not-exist.txt ({{[^)]*}})
# CHECK: # executed command: @echo 'echo %{readfile:/file/does/not/exist}'
-# CHECK: # | File specified in readfile substitution does not exist: /file/does/not/exist
+# CHECK: # | File specified in readfile substitution does not exist: {{.*}}/file/does/not/exist
# CHECK-LABEL: FAIL: shtest-readfile :: relative-paths.txt ({{[^)]*}})
# CHECK: echo hello
More information about the llvm-commits
mailing list