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

@@ -17,7 +17,9 @@ TODO: expose all userland relevant ./run args here as well somehow.
'''
if not 'defaults' in kwargs:
kwargs['defaults'] = {}
super().__init__(*args, is_userland=True, **kwargs)
if not 'mode' in kwargs['defaults']:
kwargs['defaults']['mode'] = 'userland'
super().__init__(*args, **kwargs)
self.add_argument(
'tests',
nargs='*',
@@ -53,7 +55,7 @@ If given, run only the given tests. Otherwise, run all tests.
if os.path.splitext(in_filename)[1] in self.env['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_userland=True):
if my_path_properties.should_be_tested(self.env):
cur_run_args = run_args.copy()
cur_run_args.update({
'userland': os.path.relpath(os.path.join(path_abs, in_filename), os.getcwd()),