Greg Steiert / maxim_dev

Dependents:   sensomed

Embed: (wiki syntax)

« Back to documentation index

examples_lib Namespace Reference

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 get_num_failures
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::compile_repos (   config,
  toolchains 
)
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 236 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 162 of file examples_lib.py.

def examples_lib::get_repo_list (   example )
Returns a list of all the repos associated with the specific example in the json
    config file.
    If there are repos listed under the mbed section then these will be returned as a 
    list. If not then the github single repo with be returned. 
    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
repos - The list of repos contained within that example in the json file 

Definition at line 123 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 24 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 35 of file examples_lib.py.

def examples_lib::source_repos (   config )
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 144 of file examples_lib.py.

def examples_lib::target_cross_ide (   allowed_ides,
  features = [],
  targets = [] 
)
Generate pairs of target and ides

Args:
allowed_ides - a list of all possible IDEs

Kwargs:
features - the features that must be in the features array of a
           target
targets - a list of available targets

Definition at line 98 of file examples_lib.py.

def examples_lib::target_cross_toolchain (   allowed_toolchains,
  features = [],
  targets = [] 
)
Generate pairs of target and toolchains

Args:
allowed_toolchains - a list of all possible toolchains

Kwargs:
features - the features that must be in the features array of a
           target
targets - a list of available targets

Definition at line 74 of file examples_lib.py.

def examples_lib::update_mbedos_version (   config,
  tag 
)
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 296 of file examples_lib.py.