[llvm] [LIT] replace `lit.util.mkdir` with `pathlib.Path.mkdir` (PR #163948)
Tomohiro Kashiwada via llvm-commits
llvm-commits at lists.llvm.org
Fri Oct 31 18:25:42 PDT 2025
================
@@ -1,2 +1,10 @@
## Tests glob pattern handling in the mkdir command.
+
+## This mkdir should fail because the `example_file*.input`s are regular files.
# RUN: not mkdir %S/example_file*.input
+
+# RUN: mkdir %S/example_dir1.new
+# RUN: mkdir %S/example_dir2.new
+
+## This mkdir should succeed (so RUN should fail) because the `example_dir*.news` that already exist are directories.
+# RUN: not mkdir %S/example_dir*.new
----------------
kikairoya wrote:
Thank you for the suggestion.
In these particular cases, `Inputs` are copied to the build directory and run within there, so they won't try to write to the source tree.
https://github.com/llvm/llvm-project/blob/523706f2cd6a06bd9557bf0dca9986d867eddd79/llvm/utils/lit/CMakeLists.txt#L15-L20
That said, I agree that it's not good that they look like writing to the source directory.
I'd like to avoid use of another command in this test, so I've updated to include `example_dir`s in the source tree.
https://github.com/llvm/llvm-project/pull/163948
More information about the llvm-commits
mailing list