[llvm] [llvm-lit] Add precommit test to verify current behavior of glob expansion in lit's internal shell (PR #106325)

via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 27 20:22:18 PDT 2024


================
@@ -0,0 +1,2 @@
+## Tests glob pattern expansion by listing matching files.
+# RUN: echo %{inputs}/shtest-glob/example_file*.txt
----------------
Harini0924 wrote:

Thank you for the suggestions! I have a couple of follow-up questions to ensure I'm on the right track.

For testing glob expansion with a non-built-in command, would it be appropriate to use the `find` command? I was considering using `find` to list files that match a glob pattern. Do you think this would effectively demonstrate the glob expansion, or is there another command you would recommend?

Regarding the mkdir suggestion, I'm a bit confused about where this test should be placed. Should it go in the same file as the glob-echo test (`llvm/utils/lit/tests/Inputs/shtest-glob/glob-echo.txt`), or would it be better to create a new file specifically for mkdir, such as `llvm/utils/lit/tests/Inputs/shtest-glob/glob-mkdir.txt`? And then, in `llvm/utils/lit/tests/shtest-glob.py`, should this test be expected to fail, indicating the current behavior before implementing the fix?

https://github.com/llvm/llvm-project/pull/106325


More information about the llvm-commits mailing list