new CmdGroupMgr:get_cmd_groups() method

This commit is contained in:
The MMGen Project 2025-10-03 10:34:04 +00:00
commit f62f89ce31
Signed by: mmgen
GPG key ID: 3F8B1861E32B7DA2
2 changed files with 9 additions and 8 deletions

View file

@ -44,6 +44,14 @@ class CmdGroupMgr:
self.network_id = cfg._proto.coin.lower() + ('_tn' if cfg._proto.testnet else '')
self.name = type(self).__name__
@classmethod
def get_cmd_groups(cls, cfg):
exclude = cfg.exclude_groups.split(',') if cfg.exclude_groups else []
for e in exclude:
if e not in cmd_groups_dfl:
die(1, f'{e!r}: group not recognized')
return [s for s in cmd_groups_dfl if s not in exclude]
def create_cmd_group(self, cls, sg_name=None):
cmd_group_in = dict(cls.cmd_group_in)

View file

@ -360,14 +360,7 @@ class CmdTestRunner:
else:
die(1, f'{arg!r}: command not recognized')
else:
if self.cfg.exclude_groups:
exclude = self.cfg.exclude_groups.split(',')
for e in exclude:
if e not in cmd_groups_dfl:
die(1, f'{e!r}: group not recognized')
for gname in cmd_groups_dfl:
if self.cfg.exclude_groups and gname in exclude:
continue
for gname in CmdGroupMgr.get_cmd_groups(self.cfg):
if self.init_group(gname):
for cmd in self.gm.cmd_list:
self.check_needs_rerun(cmd, build=True)