aboutsummaryrefslogtreecommitdiff
path: root/utils/lit/tests/unittest-adaptor.py
blob: 243dd4191d0dff18e5e6314688302587301e50b6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# Check the lit adaption to run under unittest.
#
# RUN: python %s %{inputs}/unittest-adaptor 2> %t.err
# RUN: FileCheck < %t.err %s
#
# CHECK: unittest-adaptor :: test-one.txt ... ok
# CHECK: unittest-adaptor :: test-two.txt ... FAIL

import unittest
import sys

import lit
import lit.discovery

input_path = sys.argv[1]
unittest_suite = lit.discovery.load_test_suite([input_path])
runner = unittest.TextTestRunner(verbosity=2)
runner.run(unittest_suite)