diff options
Diffstat (limited to 'llvm/utils/lit/tests/unittest-adaptor.py')
-rw-r--r-- | llvm/utils/lit/tests/unittest-adaptor.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/llvm/utils/lit/tests/unittest-adaptor.py b/llvm/utils/lit/tests/unittest-adaptor.py new file mode 100644 index 00000000000..ee2eee4572e --- /dev/null +++ b/llvm/utils/lit/tests/unittest-adaptor.py @@ -0,0 +1,17 @@ +# Check the lit adaption to run under unittest. +# +# RUN: %{python} %s %{inputs}/unittest-adaptor 2> %t.err +# RUN: FileCheck < %t.err %s +# +# CHECK-DAG: unittest-adaptor :: test-two.txt ... FAIL +# CHECK-DAG: unittest-adaptor :: test-one.txt ... ok + +import sys +import unittest + +import lit.LitTestCase + +input_path = sys.argv[1] +unittest_suite = lit.LitTestCase.load_test_suite([input_path]) +runner = unittest.TextTestRunner(verbosity=2) +runner.run(unittest_suite) |