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

@@ -114,8 +114,6 @@ class PathProperties:
self,
env,
link=False,
is_baremetal=False,
is_userland=False,
):
if len(self.path_components) > 1 and \
self.path_components[1] == 'libs' and \
@@ -129,23 +127,21 @@ class PathProperties:
env['arch'] in self['allowed_archs']
) and \
(
(is_userland and self['userland'] ) or
(is_baremetal and self['baremetal'])
(env['mode'] == 'userland' and self['userland'] ) or
(env['mode'] == 'baremetal' and self['baremetal'])
) and \
not (
link and
self['no_executable']
)
def should_be_tested(self, env, is_baremetal=False, is_userland=False):
def should_be_tested(self, env):
return (
self.should_be_built(
env,
is_baremetal=is_baremetal,
is_userland=is_userland
) and
not (
is_baremetal and (
env['mode'] == 'baremetal' and (
self['arm_aarch32'] or
self['signal_generated_by_os']
)