[llvm] [LIT] replace `lit.util.mkdir` with `pathlib.Path.mkdir` (PR #163948)
Alexander Richardson via llvm-commits
llvm-commits at lists.llvm.org
Fri Oct 31 09:54:17 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
----------------
arichardson wrote:
```suggestion
# RUN: rm -rf %t && mkdir %t
# RUN: cp %S/example_file*.input %t
# RUN: not mkdir %t/example_file*.input
# RUN: mkdir %t/example_dir1.new
# RUN: mkdir %t/example_dir2.new
## This mkdir should succeed (so RUN should fail) because the `example_dir*.news` that already exist are directories.
# RUN: not mkdir %t/example_dir*.new
```
I think we need to do something like the following since we shouldn't be writing to the source directory when running tests. Might be good to have a builder that bind mounts the source dir as read-only.
https://github.com/llvm/llvm-project/pull/163948
More information about the llvm-commits
mailing list