• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

ARMmbed / mbed-os-tools / #457

24 Aug 2024 09:15PM UTC coverage: 0.0% (-59.9%) from 59.947%
#457

push

coveralls-python

web-flow
Merge 7c6dbce13 into c467d6f14

0 of 4902 relevant lines covered (0.0%)

0.0 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/mbed_os_tools/test/host_tests_plugins/__init__.py
1
# Copyright (c) 2018, Arm Limited and affiliates.
2
# SPDX-License-Identifier: Apache-2.0
3
#
4
# Licensed under the Apache License, Version 2.0 (the "License");
5
# you may not use this file except in compliance with the License.
6
# You may obtain a copy of the License at
7
#
8
#     http://www.apache.org/licenses/LICENSE-2.0
9
#
10
# Unless required by applicable law or agreed to in writing, software
11
# distributed under the License is distributed on an "AS IS" BASIS,
12
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
# See the License for the specific language governing permissions and
14
# limitations under the License.
15

16
"""! @package mbed-host-test-plugins
×
17

18
This package contains plugins used by host test to reset, flash devices etc.
19
This package can be extended with new packages to add more generic functionality
20

21
"""
22

23
from . import host_test_registry
×
24

25
# This plugins provide 'flashing' and 'reset' methods to host test scripts
26
from . import module_copy_shell
×
27
from . import module_copy_mbed
×
28
from . import module_reset_mbed
×
29
from . import module_power_cycle_mbed
×
30
from . import module_copy_pyocd
×
31
from . import module_reset_pyocd
×
32

33
# Additional, non standard platforms
34
from . import module_copy_silabs
×
35
from . import module_reset_silabs
×
36
from . import module_copy_stlink
×
37
from . import module_reset_stlink
×
38
from . import module_copy_ublox
×
39
from . import module_reset_ublox
×
40
from . import module_reset_mps2
×
41
from . import module_copy_mps2
×
42
#import module_copy_jn51xx
43
#import module_reset_jn51xx
44

45

46
# Plugin registry instance
47
HOST_TEST_PLUGIN_REGISTRY = host_test_registry.HostTestRegistry()
×
48

49
# Static plugin registration
50
# Some plugins are commented out if they are not stable or not commonly used
51
HOST_TEST_PLUGIN_REGISTRY.register_plugin(module_copy_mbed.load_plugin())
×
52
HOST_TEST_PLUGIN_REGISTRY.register_plugin(module_copy_shell.load_plugin())
×
53
HOST_TEST_PLUGIN_REGISTRY.register_plugin(module_reset_mbed.load_plugin())
×
54
HOST_TEST_PLUGIN_REGISTRY.register_plugin(module_copy_pyocd.load_plugin())
×
55

56
# Extra platforms support
57
HOST_TEST_PLUGIN_REGISTRY.register_plugin(module_copy_mps2.load_plugin())
×
58
HOST_TEST_PLUGIN_REGISTRY.register_plugin(module_reset_mps2.load_plugin())
×
59
HOST_TEST_PLUGIN_REGISTRY.register_plugin(module_copy_silabs.load_plugin())
×
60
HOST_TEST_PLUGIN_REGISTRY.register_plugin(module_reset_silabs.load_plugin())
×
61
HOST_TEST_PLUGIN_REGISTRY.register_plugin(module_copy_stlink.load_plugin())
×
62
HOST_TEST_PLUGIN_REGISTRY.register_plugin(module_reset_stlink.load_plugin())
×
63
HOST_TEST_PLUGIN_REGISTRY.register_plugin(module_power_cycle_mbed.load_plugin())
×
64
HOST_TEST_PLUGIN_REGISTRY.register_plugin(module_reset_pyocd.load_plugin())
×
65
HOST_TEST_PLUGIN_REGISTRY.register_plugin(module_reset_ublox.load_plugin())
×
66
HOST_TEST_PLUGIN_REGISTRY.register_plugin(module_copy_ublox.load_plugin())
×
67
#HOST_TEST_PLUGIN_REGISTRY.register_plugin(module_copy_jn51xx.load_plugin())
68
#HOST_TEST_PLUGIN_REGISTRY.register_plugin(module_reset_jn51xx.load_plugin())
69

70
# TODO: extend plugin loading to files with name module_*.py loaded ad-hoc
71

72
###############################################################################
73
# Functional interface for host test plugin registry
74
###############################################################################
75
def call_plugin(type, capability, *args, **kwargs):
×
76
    """! Interface to call plugin registry functional way
77
    @param capability Plugin capability we want to call
78
    @param args Additional parameters passed to plugin
79
    @param kwargs Additional parameters passed to plugin
80
    @return Returns return value from call_plugin call
81
    """
82
    return HOST_TEST_PLUGIN_REGISTRY.call_plugin(type, capability, *args, **kwargs)
×
83

84
def get_plugin_caps(type):
×
85
    """! Get list of all capabilities for plugin family with the same type
86
    @param type Type of a plugin
87
    @return Returns list of all capabilities for plugin family with the same type. If there are no capabilities empty list is returned
88
    """
89
    return HOST_TEST_PLUGIN_REGISTRY.get_plugin_caps(type)
×
90

91
def get_plugin_info():
×
92
    """! Return plugins information
93
    @return Dictionary HOST_TEST_PLUGIN_REGISTRY
94
    """
95
    return HOST_TEST_PLUGIN_REGISTRY.get_dict()
×
96

97
def print_plugin_info():
×
98
    """! Prints plugins' information in user friendly way
99
    """
100
    print(HOST_TEST_PLUGIN_REGISTRY)
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc