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

Casey Carter via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 12 19:22:30 PDT 2020


CaseyCarter created this revision.
CaseyCarter added reviewers: ldionne, yln.
Herald added subscribers: llvm-commits, dexonsmith, delcypher.
Herald added a project: LLVM.

MSVC uses lit for STL testing, running both the libcxx tests and our "native" suite of tests which has feature requirements that are not parsed from the test content, but supplied externally. dac21fd2 <https://github.com/llvm/llvm-project/commit/dac21fd29cd2ae2b979a276747ad5ad82fca09bf> broke us by ignoring the initial value of the `requires` property of tests and using only the result of the `REQUIRES:` parser.

(This is my first LIT change, apologies if I'm missing some protocol.)


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D81782

Files:
  llvm/utils/lit/lit/TestRunner.py


Index: llvm/utils/lit/lit/TestRunner.py
===================================================================
--- llvm/utils/lit/lit/TestRunner.py
+++ llvm/utils/lit/lit/TestRunner.py
@@ -1464,7 +1464,7 @@
         return lit.Test.Result(Test.UNRESOLVED, str(e))
     script = parsed['RUN:'] or []
     test.xfails = parsed['XFAIL:'] or []
-    test.requires = parsed['REQUIRES:'] or []
+    test.requires = (test.requires or []) + (parsed['REQUIRES:'] or [])
     test.unsupported = parsed['UNSUPPORTED:'] or []
     if parsed['ALLOW_RETRIES:']:
         test.allowed_retries = parsed['ALLOW_RETRIES:'][0]


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D81782.270561.patch
Type: text/x-patch
Size: 605 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200613/8245cb13/attachment.bin>


More information about the llvm-commits mailing list