llvm-for-llvmta/utils/lit/tests/unittest-adaptor.py

18 lines
460 B
Python
Raw Normal View History

2022-04-25 10:02:23 +02:00
# 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)