[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 14:54:29 PDT 2020


ldionne added inline comments.


================
Comment at: llvm/utils/lit/tests/unparsed-requirements.py:1
+# RUN: %{python} %s %{inputs}/unparsed-requirements 2> %t.err
+
----------------
Is `2> %t.err` necessary?


================
Comment at: llvm/utils/lit/tests/unparsed-requirements.py:8
+
+class CustomTest(Test):
+    def __init__(self, suite, path_in_suite, config, file_path = None):
----------------
I think this LGTM, but you should also test `xfails` and `unsupported`.


================
Comment at: llvm/utils/lit/tests/unparsed-requirements.py:15
+suite = TestSuite("suite", sys.argv[1], sys.argv[1], config)
+test = CustomTest(suite, ["test.py"], config)
+parseIntegratedTestScript(test)
----------------
You could also avoid creating a new class `CustomTest` and instead use:

```
test = Test(<args...>)
test.requires = ["meow"]
```

This might be less brittle in case we decide to change the signature of `lit.Test`'s `__init__` method.


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

https://reviews.llvm.org/D81782





More information about the llvm-commits mailing list