]> git.donarmstrong.com Git - qmk_firmware.git/blob - tool/mbed/mbed-sdk/workspace_tools/host_tests/host_tests_plugins/__init__.py
Squashed 'tmk_core/' changes from 7967731..b9e0ea0
[qmk_firmware.git] / tool / mbed / mbed-sdk / workspace_tools / host_tests / host_tests_plugins / __init__.py
1 """
2 mbed SDK
3 Copyright (c) 2011-2013 ARM Limited
4
5 Licensed under the Apache License, Version 2.0 (the "License");
6 you may not use this file except in compliance with the License.
7 You may obtain a copy of the License at
8
9     http://www.apache.org/licenses/LICENSE-2.0
10
11 Unless required by applicable law or agreed to in writing, software
12 distributed under the License is distributed on an "AS IS" BASIS,
13 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 See the License for the specific language governing permissions and
15 limitations under the License.
16 """
17
18 import host_test_registry
19
20 # This plugins provide 'flashing' methods to host test scripts
21 import module_copy_mbed
22 import module_copy_shell
23 import module_copy_silabs
24 #import module_copy_firefox
25 #import module_copy_mps2
26
27 # Plugins used to reset certain platform
28 import module_reset_mbed
29 import module_reset_silabs
30 #import module_reset_mps2
31
32
33 # Plugin registry instance
34 HOST_TEST_PLUGIN_REGISTRY = host_test_registry.HostTestRegistry()
35
36 # Static plugin registration
37 # Some plugins are commented out if they are not stable or not commonly used
38 HOST_TEST_PLUGIN_REGISTRY.register_plugin(module_copy_mbed.load_plugin())
39 HOST_TEST_PLUGIN_REGISTRY.register_plugin(module_copy_shell.load_plugin())
40 HOST_TEST_PLUGIN_REGISTRY.register_plugin(module_reset_mbed.load_plugin())
41 #HOST_TEST_PLUGIN_REGISTRY.register_plugin(module_copy_firefox.load_plugin())
42
43 # Extra platforms support
44 #HOST_TEST_PLUGIN_REGISTRY.register_plugin(module_copy_mps2.load_plugin())
45 #HOST_TEST_PLUGIN_REGISTRY.register_plugin(module_reset_mps2.load_plugin())
46 HOST_TEST_PLUGIN_REGISTRY.register_plugin(module_copy_silabs.load_plugin())
47 HOST_TEST_PLUGIN_REGISTRY.register_plugin(module_reset_silabs.load_plugin())
48
49 # TODO: extend plugin loading to files with name module_*.py loaded ad-hoc
50
51 ###############################################################################
52 # Functional interface for host test plugin registry
53 ###############################################################################
54 def call_plugin(type, capability, *args, **kwargs):
55     """ Interface to call plugin registry functional way
56     """
57     return HOST_TEST_PLUGIN_REGISTRY.call_plugin(type, capability, *args, **kwargs)
58
59 def get_plugin_caps(type):
60     """ Returns list of all capabilities for plugin family with the same type.
61         If there are no capabilities empty list is returned
62     """
63     return HOST_TEST_PLUGIN_REGISTRY.get_plugin_caps(type)
64
65 def print_plugin_info():
66     """ Prints plugins' information in user friendly way
67     """
68     print HOST_TEST_PLUGIN_REGISTRY