Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
examples_lib Namespace Reference
Functions | |
| def | print_list |
| def | print_summary |
| def | target_cross_toolchain |
| def | target_cross_ide |
| def | get_repo_list |
| def | source_repos |
| def | clone_repos |
| def | deploy_repos |
| def | get_num_failures |
| def | export_repos |
| def | compile_repos |
| def | update_mbedos_version |
Detailed Description
Import and bulid a bunch of example programs This library includes functions that are shared between the examples.py and the update.py modules.
Function Documentation
| def examples_lib::clone_repos | ( | config, | |
| examples, | |||
retry = 3 |
|||
| ) |
Clones each of the repos associated with the specific examples name from the
json config file. Note if there is already a clone of the repo then it will first
be removed to ensure a clean, up to date cloning.
Args:
config - the json object imported from the file.
Definition at line 172 of file examples_lib.py.
| def examples_lib::compile_repos | ( | config, | |
| toolchains, | |||
| targets, | |||
| profile, | |||
| examples | |||
| ) |
Compiles combinations of example programs, targets and compile chains.
The results are returned in a [key: value] dictionary format:
Where key = The example name from the json config file
value = a list containing: pass_status, successes, and failures
where pass_status = The overall pass status for the compilation of the full
set of example programs comprising the example suite.
True if all examples pass, false otherwise
successes = list of passing examples.
failures = list of failing examples.
Both successes and failures contain the example name, target and compile chain
Args:
config - the json object imported from the file.
toolchains - List of toolchains to compile for.
results - results of the compilation stage.
Definition at line 317 of file examples_lib.py.
| def examples_lib::deploy_repos | ( | config, | |
| examples | |||
| ) |
If the example directory exists as provided by the json config file,
pull in the examples dependencies by using `mbed-cli deploy`.
Args:
config - the json object imported from the file.
Definition at line 194 of file examples_lib.py.
| def examples_lib::export_repos | ( | config, | |
| ides, | |||
| targets, | |||
| examples | |||
| ) |
Exports and builds combinations of example programs, targets and IDEs.
The results are returned in a [key: value] dictionary format:
Where key = The example name from the json config file
value = a list containing: pass_status, successes, export failures, build_failures,
and build_skips
where pass_status = The overall pass status for the export of the full
set of example programs comprising the example suite.
IE they must build and export) True if all examples pass, false otherwise
successes = list of examples that exported and built (if possible)
If the exporter has no build functionality, then it is a pass
if exported
export_failures = list of examples that failed to export.
build_failures = list of examples that failed to build
build_skips = list of examples that cannot build
Both successes and failures contain the example name, target and IDE
Args:
config - the json object imported from the file.
ides - List of IDES to export to
Definition at line 231 of file examples_lib.py.
| def examples_lib::get_num_failures | ( | results, | |
export = False |
|||
| ) |
Returns the number of failed compilations from the results summary
Args:
results - results summary of the compilation stage. See compile_repos() for
details of the format.
num_failures
Definition at line 214 of file examples_lib.py.
| def examples_lib::get_repo_list | ( | example ) |
Returns a list of all the repos and their types associated with the
specific example in the json config file.
If the key 'test-repo-source' is set to 'mbed', then it will return the
mbed section as a list. Otherwise, it will return the single github repo.
NOTE: This does not currently deal with multiple examples underneath a github
sourced exampe repo.
Args:
example - Example for which the repo list is requested
Definition at line 125 of file examples_lib.py.
| def examples_lib::print_list | ( | lst ) |
Prints to screen the contents of a list Args: lst - a list of any type, to be displayed
Definition at line 26 of file examples_lib.py.
| def examples_lib::print_summary | ( | results, | |
export = False |
|||
| ) |
Prints to screen the results of compiling/exporting combinations of example programs,
targets and compile toolchains/IDEs.
Args:
results - results of the compilation stage. See compile_repos() and export_repos()
for details of the format.
Definition at line 52 of file examples_lib.py.
| def examples_lib::source_repos | ( | config, | |
| examples | |||
| ) |
Imports each of the repos and its dependencies (.lib files) associated
with the specific examples name from the json config file. Note if
there is already a clone of the repo then it will first be removed to
ensure a clean, up to date cloning.
Args:
config - the json object imported from the file.
Definition at line 152 of file examples_lib.py.
| def examples_lib::target_cross_ide | ( | allowed_targets, | |
| allowed_ides, | |||
features = [], |
|||
toolchains = [] |
|||
| ) |
Generate pairs of target and ides
Args:
allowed_targets - a list of all possible targets
allowed_ides - a list of all possible IDEs
Kwargs:
features - the features that must be in the features array of a
target
Definition at line 105 of file examples_lib.py.
| def examples_lib::target_cross_toolchain | ( | allowed_targets, | |
| allowed_toolchains, | |||
features = [] |
|||
| ) |
Generate pairs of target and toolchains
Args:
allowed_targets - a list of all possible targets
allowed_toolchains - a list of all possible toolchains
Kwargs:
features - the features that must be in the features array of a
target
Definition at line 87 of file examples_lib.py.
| def examples_lib::update_mbedos_version | ( | config, | |
| tag, | |||
| examples | |||
| ) |
For each example repo identified in the config json object, update the version of
mbed-os to that specified by the supplied GitHub tag. This function assumes that each
example repo has already been cloned.
Args:
config - the json object imported from the file.
tag - GitHub tag corresponding to a version of mbed-os to upgrade to.
Definition at line 388 of file examples_lib.py.
Generated on Sun Dec 4 2022 15:54:43 by
1.7.2