[PATCH] D94766: Add lit config for dir with standalone tests
Thomas Preud'homme via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Feb 11 14:41:05 PST 2021
thopre added a comment.
In D94766#2513926 <https://reviews.llvm.org/D94766#2513926>, @jdenny wrote:
> In D94766#2513640 <https://reviews.llvm.org/D94766#2513640>, @thopre wrote:
>
>>> What makes it specific to your setup? Feature tests when building/testing a project are common.
>>
>> Oops indeed, nothing specific to our setup in what I said. I left out that each test invoked with lit is managed by CTest which AFAIK does not allow to set a dependency on a piece of code to run first. And I don't see a way to call a script before ctest is called. This is specific to our setup though and I could do the detection on each invocation of lit. It's not very satisfying but it sure can be done.
>
> If you're using CTest, then you're likely using CMake, which is a typical place to add feature tests for the tools your project's build/tests will use. Does that not work?
>
>>>> Perhaps a more palatable approach would be to make all options have a corresponding lit config rather than something specific to the `--no-indirect-run-check`. How does that sound?
>>>
>>> By "lit config", do you mean a flag you can set in a lit config file, like `lit.cfg.py`? How do you imagine that old lit versions should handle lit configs they don't recognize?
>>
>> Yes I was thinking of lit.cfg.py. Does it not only react to configuration option it knows about?
>
> Ah, so you mean something like `config.new_feature = 1`. For some reason, I was thinking of calling a function.
>
> Is it actually useful to implement that for any other command-line option?
>
> Actually, it seems to me that `--no-indirect-run-check` probably should have been a lit config option in the first place. It declares a property of the test suite: it has legitimate tests that are only run individually. lit invocations shouldn't have to declare that again and again. Or have I misunderstood the use case?
How's this new approach? Feel free to suggest a better config name.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D94766/new/
https://reviews.llvm.org/D94766
More information about the llvm-commits
mailing list