[PATCH] D76290: [lit] Allow passing extra commands to executeShTest

Louis Dionne via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 18 21:09:16 PDT 2020


ldionne added a comment.

In D76290#1930134 <https://reviews.llvm.org/D76290#1930134>, @yln wrote:

> I don't understand yet what this enables.


It enables injecting commands at the beginning of an arbitrary file, even if there are no commands in that file. That makes the ShTest format a lot more powerful, cause new formats can be built on top of it. For example, this is the new test format I'm working on for libc++, which is both more powerful and *a lot* simpler than the current test format: https://github.com/ldionne/llvm-project/blob/a60ed4470/libcxx/utils/libcxx/test/newformat.py#L79-L138.

Without this change, I have to create a temporary file for each test, copy it, prepend `// RUN: XXX` commands to it, and then re-create an artificial Lit test that uses that file. It's not great and it's a lot slower.

> Please extend your commit message to elaborate a bit more for people (like me) who aren't familiar with libcxx testing.

I've tried to better describe what the change enables.

In D76290#1930209 <https://reviews.llvm.org/D76290#1930209>, @dexonsmith wrote:

> I'm a little uncomfortable with declaring bankruptcy on the tests.  Doesn't the lit test suite itself use executeShTest?  Can we add a test there?


I agree, and you're very good at making me write tests :-). I'm now more familiar with how lit tests work and I've managed to add some.

@dexonsmith @yln 
Please let me know if the new revision seems OK to you!


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D76290/new/

https://reviews.llvm.org/D76290





More information about the llvm-commits mailing list