test-gdb: can now run in either userland or baremetal modes

Selection with --mode userland (default because has x86_64) or --mode baremetal.

This is the first userland tool where this choice is done on the command line,
which led to a refactor of supported_archs and is_baremetal and is_userland
into a single self.env['mode'].
This commit is contained in:
Ciro Santilli 六四事件 法轮功
2019-05-29 00:00:00 +00:00
parent b6126a5268
commit 6994dc21af
21 changed files with 106 additions and 55 deletions

View File

@@ -11,8 +11,9 @@ import thread_pool
class Main(common.TestCliFunction):
def __init__(self):
super().__init__(
is_baremetal=True,
supported_archs=common.consts['crosstool_ng_supported_archs'],
defaults={
'mode': 'baremetal'
},
)
self.add_argument(
'tests',
@@ -49,7 +50,7 @@ If given, run only the given tests. Otherwise, run all tests.
if os.path.splitext(in_filename)[1] in self.env['baremetal_build_in_exts']:
path_relative_root = os.path.join(dirpath_relative_root, in_filename)
my_path_properties = path_properties.get(path_relative_root)
if my_path_properties.should_be_tested(self.env, is_baremetal=True):
if my_path_properties.should_be_tested(self.env):
cur_run_args = run_args.copy()
cur_run_args.update({
'baremetal': os.path.relpath(os.path.join(path_abs, in_filename), os.getcwd()),