2 Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
3 See https://llvm.org/LICENSE.txt for license information.
4 SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 Provides the configuration class, which holds all information related to
7 how this invocation of the test suite should be run.
10 from __future__ import absolute_import
11 from __future__ import print_function
25 suite = unittest2.TestSuite()
27 # The list of categories we said we care about
28 categories_list = None
29 # set to true if we are going to use categories for cherry-picking test cases
30 use_categories = False
31 # Categories we want to skip
32 skip_categories = ["darwin-log"]
33 # Categories we expect to fail
35 # use this to track per-category failures
36 failures_per_category = {}
38 # The path to LLDB.framework is optional.
39 lldb_framework_path = None
41 # Test suite repeat count. Can be overwritten with '-# count'.
44 # The 'arch' and 'compiler' can be specified via command line.
50 # The overriden dwarf verison.
53 # Any overridden settings.
54 # Always disable default dynamic types for testing purposes.
55 settings = [('target.prefer-dynamic-value', 'no-dynamic-values')]
57 # Path to the FileCheck testing tool. Not optional.
60 # Path to the yaml2obj tool. Not optional.
63 # The arch might dictate some specific CFLAGS to be passed to the toolchain to build
64 # the inferior programs. The global variable cflags_extras provides a hook to do
68 # The filters (testclass.testmethod) used to admit tests into our test suite.
71 # The regular expression pattern to match against eligible filenames as
75 # Sets of tests which are excluded at runtime
79 # By default, recorded session info for errored/failed test are dumped into its
80 # own file under a session directory named after the timestamp of the test suite
81 # run. Use '-s session-dir-name' to specify a specific dir name.
85 # f - test file name (without extension)
87 # m - test method name
90 # The default is to write all fields.
91 session_file_format = 'fnmac'
93 # Set this flag if there is any session info dumped during the test run.
94 sdir_has_content = False
95 # svn_info stores the output from 'svn info lldb.base.dir'.
98 # Default verbosity is 0.
101 # By default, search from the script directory.
102 # We can't use sys.path[0] to determine the script directory
103 # because it doesn't work under a debugger
104 testdirs = [lldbsuite.lldb_test_root]
111 # LLDB Remote platform setting
112 lldb_platform_name = None
113 lldb_platform_url = None
114 lldb_platform_working_dir = None
116 # The base directory in which the tests are being built.
117 test_build_dir = None
119 # The clang module cache directory used by lldb.
120 lldb_module_cache_dir = None
121 # The clang module cache directory used by clang.
122 clang_module_cache_dir = None
124 # Test results handling globals
125 results_filename = None
126 results_formatter_name = None
127 results_formatter_object = None
128 results_formatter_options = None
135 # Test rerun configuration vars
136 rerun_all_issues = False
138 # The names of all tests. Used to assert we don't have two tests with the
142 # LLDB library directory.
145 # A plugin whose tests will be enabled, like intel-pt.
149 def shouldSkipBecauseOfCategories(test_categories):
151 if len(test_categories) == 0 or len(
152 categories_list & set(test_categories)) == 0:
155 for category in skip_categories:
156 if category in test_categories:
162 def get_filecheck_path():
164 Get the path to the FileCheck testing tool.
166 if filecheck and os.path.lexists(filecheck):
169 def get_yaml2obj_path():
171 Get the path to the yaml2obj tool.
173 if yaml2obj and os.path.lexists(yaml2obj):
176 def is_reproducer_replay():
178 Returns true when dotest is being replayed from a reproducer. Never use
179 this method to guard SB API calls as it will cause a divergence between
182 return replay_path is not None
186 Returns true when dotest is capturing a reproducer or is being replayed
187 from a reproducer. Use this method to guard SB API calls.
189 return capture_path or replay_path