[PATCH] D150856: [lit] Add %{for-each-file} substitution

Louis Dionne via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 19 15:41:05 PDT 2023


ldionne added a comment.

In D150856#4474115 <https://reviews.llvm.org/D150856#4474115>, @jdenny wrote:

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

I guess there's no real reason, it's just that all libc++ tests are basically ShTests and it seemed simpler for me to keep them that way. So we write a ShTest that generates a ShTest and it just works.

> (Aside: Instead of the `BLOCKLIT` that appears in many of these tests, why not use lit's `END.` directive?)

I wasn't aware of `END.`!


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