Skip to content

Commit

Permalink
Added new CLI option --plugins used to print available plugins from c…
Browse files Browse the repository at this point in the history
…ommand line

Added more strict 'stable' flags to some plugins
  • Loading branch information
PrzemekWirkus committed Jul 31, 2015
1 parent ef53c54 commit 679508b
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 6 deletions.
25 changes: 21 additions & 4 deletions mbed_host_tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ class DefaultTestSelector(DefaultTestSelectorBase):
test_supervisor = get_host_test("default")

def __init__(self, options=None):
""" ctor
"""! ctor
"""
self.options = options

Expand All @@ -110,19 +110,30 @@ def __init__(self, options=None):
self.print_ht_list()
sys.exit(0)

if options.list_plugins: # --plugins option
host_tests_plugins.print_plugin_info()
sys.exit(0)

DefaultTestSelectorBase.__init__(self, options)

def print_ht_list(self):
""" Prints list of registered host test classes (by name)
"""! Prints list of registered host test classes (by name)
@Detail For devel & debug purposes
"""
str_len = 0
for ht in HOSTREGISTRY.HOST_TESTS:
if len(ht) > str_len: str_len = len(ht)
for ht in sorted(HOSTREGISTRY.HOST_TESTS.keys()):
print "'%s'%s : %s()" % (ht, ' '*(str_len - len(ht)), HOSTREGISTRY.HOST_TESTS[ht].__class__)

def print_plugin_list(self):
"""! Prints current plugin status
@Detail For devel & debug purposes
"""


def setup(self):
""" Additional setup before work-flow execution
"""! Additional setup before work-flow execution
"""
pass

Expand Down Expand Up @@ -312,11 +323,17 @@ def init_host_test_cli_params():
action="store_true",
help='Prints registered host test and exits')

parser.add_option('', '--plugins',
dest='list_plugins',
default=False,
action="store_true",
help='Prints registered plugins and exits')

parser.add_option('', '--run',
dest='run_binary',
default=False,
action="store_true",
help='Runs binary image on target (workflow: flash, reset, print console')
help='Runs binary image on target (workflow: flash, reset, output console)')

parser.add_option('', '--skip-flashing',
dest='skip_flashing',
Expand Down
1 change: 1 addition & 0 deletions mbed_host_tests/host_tests_plugins/module_copy_silabs.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ class HostTestPluginCopyMethod_Silabs(HostTestPluginBase):
type = 'CopyMethod'
capabilities = ['eACommander', 'eACommander-usb']
required_parameters = ['image_path', 'destination_disk']
stable = True

def setup(self, *args, **kwargs):
""" Configure plugin, this function should be called before plugin execute() method is used.
Expand Down
2 changes: 1 addition & 1 deletion mbed_host_tests/host_tests_plugins/module_reset_silabs.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ class HostTestPluginResetMethod_SiLabs(HostTestPluginBase):
# Plugin interface
name = 'HostTestPluginResetMethod_SiLabs'
type = 'ResetMethod'
stable = True
capabilities = ['eACommander', 'eACommander-usb']
required_parameters = ['disk']
stable = True

def setup(self, *args, **kwargs):
""" Configure plugin, this function should be called before plugin execute() method is used.
Expand Down
2 changes: 1 addition & 1 deletion mbed_host_tests/host_tests_plugins/module_reset_stlink.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ class HostTestPluginResetMethod_Stlink(HostTestPluginBase):
# Plugin interface
name = 'HostTestPluginResetMethod_Stlink'
type = 'ResetMethod'
stable = True
capabilities = ['stlink']
required_parameters = []
stable = False

def setup(self, *args, **kwargs):
""" Configure plugin, this function should be called before plugin execute() method is used.
Expand Down

0 comments on commit 679508b

Please sign in to comment.