[lit] Add back LitTestCase
commit24b3237135b08fe80adfb4d7d2c1a7221f9dbae9
authorJulian Lettner <jlettner@apple.com>
Tue, 15 Oct 2019 20:57:20 +0000 (15 20:57 +0000)
committerJulian Lettner <jlettner@apple.com>
Tue, 15 Oct 2019 20:57:20 +0000 (15 20:57 +0000)
tree02eda86263725a36894de15c5d5a9f5c0f263959
parent5ab2259bcf8f3722acbe56e31647e37ec0400f91
[lit] Add back LitTestCase

This essentially reverts a commit [1] that removed the adaptor for
Python unittests.  The code has been slightly refactored to make it more
additive: all code is contained in LitTestCase.py.

Usage sites will require a small adaption:
```
[old]
  import lit.discovery
  ...
  test_suite = lit.discovery.load_test_suite(...)

[new]
  import lit.LitTestCase
  ...
  test_suite = lit.LitTestCase.load_test_suite(...)
```

This was put back on request by Daniel Dunbar, since I wrongly assumed
that the functionality is unused.  At least llbuild still uses this [2].

[1] 70ca752ccf6a8f362aea25ccd3ee2bbceca93b20
[2] https://github.com/apple/swift-llbuild/blob/master/utils/Xcode/LitXCTestAdaptor/LitTests.py#L16

Reviewed By: ddunbar

Differential Revision: https://reviews.llvm.org/D69002

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374947 91177308-0d34-0410-b5e6-96231b3b80d8
utils/lit/lit/LitTestCase.py [new file with mode: 0644]
utils/lit/tests/Inputs/unittest-adaptor/lit.cfg [new file with mode: 0644]
utils/lit/tests/Inputs/unittest-adaptor/test-one.txt [new file with mode: 0644]
utils/lit/tests/Inputs/unittest-adaptor/test-two.txt [new file with mode: 0644]
utils/lit/tests/unittest-adaptor.py [new file with mode: 0644]