[PATCH] D150856: [lit] Add %{for-each-file} substitution
Joel E. Denny via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 5 09:16:30 PDT 2023
jdenny added a comment.
In D150856#4472330 <https://reviews.llvm.org/D150856#4472330>, @ldionne wrote:
>
Thanks for commenting. It's good to hear more perspectives and experiences.
> We have several tests that are pretty repetitive and we started generating them automatically using python scripts. To do this, we added a new kind of test called `.gen.py` to libc++'s own custom test format. This kind of test is basically a Python script that generates other tests based on arbitrary Python code.
Interesting approach. I'd like to understand the motivation a bit better, in part to understand how a `PYTHON:` directive might help. Why do you generate tests using lit `RUN:` lines in the `.gen.py` custom test format files? That is, my first guess at how to do this would have been to encode calls to python scripts in cmake as part of the test suite build process. That seems simpler, but maybe I missed something.
(Aside: Instead of the `BLOCKLIT` that appears in many of these tests, why not use lit's `END.` directive?)
> The downside is that (in this case at least) there's a bit more upfront complexity required for writing the test, since you have to write it in Python. I think this would probably be easy to improve with something like the `PYTHON` directive (which I wasn't aware of until recently)
In case it isn't clear, the `PYTHON:` directive doesn't exist yet, but @endill and I are discussing a prototype.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D150856/new/
https://reviews.llvm.org/D150856
More information about the llvm-commits
mailing list