[llvm] [lit] [test] Fix the shtest-readfile test on Python 3.13 on Windows (PR #160503)
via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 24 04:14:21 PDT 2025
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-testing-tools
Author: Martin Storsjö (mstorsjo)
<details>
<summary>Changes</summary>
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.
---
Full diff: https://github.com/llvm/llvm-project/pull/160503.diff
1 Files Affected:
- (modified) llvm/utils/lit/tests/shtest-readfile.py (+1-1)
``````````diff
diff --git a/llvm/utils/lit/tests/shtest-readfile.py b/llvm/utils/lit/tests/shtest-readfile.py
index a122dd7664272..f2e4fb0a9e169 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
``````````
</details>
https://github.com/llvm/llvm-project/pull/160503
More information about the llvm-commits
mailing list