• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Check the lit adaption to run under unittest.
2#
3# RUN: python %s %{inputs}/unittest-adaptor 2> %t.err
4# RUN: FileCheck < %t.err %s
5#
6# CHECK: unittest-adaptor :: test-one.txt ... ok
7# CHECK: unittest-adaptor :: test-two.txt ... FAIL
8
9import unittest
10import sys
11
12import lit
13import lit.discovery
14
15input_path = sys.argv[1]
16unittest_suite = lit.discovery.load_test_suite([input_path])
17runner = unittest.TextTestRunner(verbosity=2)
18runner.run(unittest_suite)
19