[PATCH] D81782: [lit] Allow for tests to have non-parsed requirements

Louis Dionne via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 15 08:41:04 PDT 2020


ldionne requested changes to this revision.
ldionne added a comment.
This revision now requires changes to proceed.

How do you set `test.requires` externally? Do you have a custom test format?

This LGTM generally speaking, with some details. Also, can we add some tests? The tests are in `llvm/utils/lit/tests`.



================
Comment at: llvm/utils/lit/lit/TestRunner.py:1466
     script = parsed['RUN:'] or []
     test.xfails = parsed['XFAIL:'] or []
+    test.requires = (test.requires or []) + (parsed['REQUIRES:'] or [])
----------------
I think we should have consistent behaviour for `test.xfails` and test.unsupported`.


================
Comment at: llvm/utils/lit/lit/TestRunner.py:1467
     test.xfails = parsed['XFAIL:'] or []
-    test.requires = parsed['REQUIRES:'] or []
+    test.requires = (test.requires or []) + (parsed['REQUIRES:'] or [])
     test.unsupported = parsed['UNSUPPORTED:'] or []
----------------
I think this can always be just `test.requires` because `test.requires` is set to `[]` on construction. Thus you'd end up adding both the requires set programatically on the test and the parsed ones.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D81782





More information about the llvm-commits mailing list