mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-05 13:26:55 +00:00
[lit] Move unittest adaptor code into discovery module.
- Also, add a test for it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174019 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
5
utils/lit/tests/Inputs/unittest-adaptor/lit.cfg
Normal file
5
utils/lit/tests/Inputs/unittest-adaptor/lit.cfg
Normal file
@@ -0,0 +1,5 @@
|
||||
config.name = 'unittest-adaptor'
|
||||
config.suffixes = ['.txt']
|
||||
config.test_format = lit.formats.ShTest()
|
||||
config.test_source_root = None
|
||||
config.test_exec_root = None
|
1
utils/lit/tests/Inputs/unittest-adaptor/test-one.txt
Normal file
1
utils/lit/tests/Inputs/unittest-adaptor/test-one.txt
Normal file
@@ -0,0 +1 @@
|
||||
# RUN: true
|
1
utils/lit/tests/Inputs/unittest-adaptor/test-two.txt
Normal file
1
utils/lit/tests/Inputs/unittest-adaptor/test-two.txt
Normal file
@@ -0,0 +1 @@
|
||||
# RUN: false
|
18
utils/lit/tests/unittest-adaptor.py
Normal file
18
utils/lit/tests/unittest-adaptor.py
Normal file
@@ -0,0 +1,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)
|
Reference in New Issue
Block a user