Imported Upstream version 5.18.0.161

Former-commit-id: 4db48158d3a35497b8f118ab21b5f08ac3d86d98
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2018-10-19 08:34:24 +00:00
parent 37fbf886a3
commit e19d552987
28702 changed files with 3868076 additions and 803 deletions

View File

@@ -0,0 +1,11 @@
# .coveragerc to control coverage.py
[run]
branch = False
parallel = True
source = lit
[html]
directory = coverage_html_report
[report]
omit = Inputs

View File

@@ -0,0 +1,16 @@
import lit.util
import os
import sys
main_config = sys.argv[1]
main_config = os.path.realpath(main_config)
main_config = os.path.normcase(main_config)
config_map = {main_config : sys.argv[2]}
builtin_parameters = {'config_map' : config_map}
if __name__=='__main__':
from lit.main import main
main_config_dir = os.path.dirname(main_config)
sys.argv = [sys.argv[0]] + sys.argv[3:] + [main_config_dir]
main(builtin_parameters)

View File

@@ -0,0 +1,9 @@
import lit.formats
import lit.util
config.name = 'config-map'
config.suffixes = ['.txt']
config.test_format = lit.formats.ShTest()
import os
config.test_exec_root = os.path.realpath(os.path.dirname(__file__))
config.test_source_root = os.path.join(config.test_exec_root, "tests")

View File

@@ -0,0 +1 @@
print("ERROR: lit.cfg invoked!")

View File

@@ -0,0 +1,14 @@
import lit.formats
config.name = 'top-level-suite'
config.suffixes = ['.txt']
config.test_format = lit.formats.ShTest()
# We intentionally don't set the source root or exec root directories here,
# because this suite gets reused for testing the exec root behavior (in
# ../exec-discovery).
#
#config.test_source_root = None
#config.test_exec_root = None
# Check that arbitrary config values are copied (tested by subdir/lit.local.cfg).
config.an_extra_variable = False

View File

@@ -0,0 +1,4 @@
config.suffixes = ['.py']
# Check that the arbitrary config values in our parent was inherited.
assert hasattr(config, 'an_extra_variable')

View File

@@ -0,0 +1 @@
# RUN: true

View File

@@ -0,0 +1,6 @@
import lit.formats
config.name = 'sub-suite'
config.suffixes = ['.txt']
config.test_format = lit.formats.ShTest()
config.test_source_root = None
config.test_exec_root = None

View File

@@ -0,0 +1 @@
# RUN: true

View File

@@ -0,0 +1 @@
# RUN: true

View File

@@ -0,0 +1 @@
# RUN: true

View File

@@ -0,0 +1 @@
# RUN: true

View File

@@ -0,0 +1,9 @@
import lit.formats
# Verify that the site configuration was loaded.
if config.test_source_root is None or config.test_exec_root is None:
lit_config.fatal("No site specific configuration")
config.name = 'exec-discovery-in-tree-suite'
config.suffixes = ['.txt']
config.test_format = lit.formats.ShTest()

View File

@@ -0,0 +1,4 @@
import os
config.test_exec_root = os.path.dirname(__file__)
config.test_source_root = os.path.dirname(config.test_exec_root)
lit_config.load_config(config, os.path.join(config.test_source_root, "lit.cfg"))

View File

@@ -0,0 +1 @@
# RUN: true

View File

@@ -0,0 +1,5 @@
# Load the discovery suite, but with a separate exec root.
import os
config.test_exec_root = os.path.dirname(__file__)
config.test_source_root = os.path.join(os.path.dirname(config.test_exec_root), "discovery")
lit_config.load_config(config, os.path.join(config.test_source_root, "lit.cfg"))

View File

@@ -0,0 +1,36 @@
#!/usr/bin/env python
import sys
if len(sys.argv) != 2:
raise ValueError("unexpected number of args")
if sys.argv[1] == "--gtest_list_tests":
print("""\
FirstTest.
subTestA
subTestB
ParameterizedTest/0.
subTest
ParameterizedTest/1.
subTest""")
sys.exit(0)
elif not sys.argv[1].startswith("--gtest_filter="):
raise ValueError("unexpected argument: %r" % (sys.argv[1]))
test_name = sys.argv[1].split('=',1)[1]
if test_name == 'FirstTest.subTestA':
print('I am subTest A, I PASS')
print('[ PASSED ] 1 test.')
sys.exit(0)
elif test_name == 'FirstTest.subTestB':
print('I am subTest B, I FAIL')
print('And I have two lines of output')
sys.exit(1)
elif test_name in ('ParameterizedTest/0.subTest',
'ParameterizedTest/1.subTest'):
print('I am a parameterized test, I also PASS')
print('[ PASSED ] 1 test.')
sys.exit(0)
else:
raise SystemExit("error: invalid test name: %r" % (test_name,))

Some files were not shown because too many files have changed in this diff Show More