[llvm] 6e904e8 - [lit] [test] Fix the shtest-readfile test on Python 3.13 on Windows (#160503)

via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 24 12:00:56 PDT 2025


Author: Martin Storsjö
Date: 2025-09-24T22:00:52+03:00
New Revision: 6e904e89cb97fa113c95f746942e04226a7d2207

URL: https://github.com/llvm/llvm-project/commit/6e904e89cb97fa113c95f746942e04226a7d2207
DIFF: https://github.com/llvm/llvm-project/commit/6e904e89cb97fa113c95f746942e04226a7d2207.diff

LOG: [lit] [test] Fix the shtest-readfile test on Python 3.13 on Windows (#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.

Added: 
    

Modified: 
    llvm/utils/lit/tests/shtest-readfile.py

Removed: 
    


################################################################################
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


        


More information about the llvm-commits mailing list