@@ -437,7 +437,7 @@ def target_supports_toolchain(target, toolchain_name):
437437def prepare_toolchain (src_paths , build_dir , target , toolchain_name ,
438438 macros = None , clean = False , jobs = 1 ,
439439 notify = None , config = None , app_config = None ,
440- build_profile = None , ignore = None ):
440+ build_profile = None , ignore = None , coverage_patterns = None ):
441441 """ Prepares resource related objects - toolchain, target, config
442442
443443 Positional arguments:
@@ -477,6 +477,9 @@ def prepare_toolchain(src_paths, build_dir, target, toolchain_name,
477477 target .default_toolchain = "uARM"
478478 toolchain_name = selected_toolchain_name
479479
480+ if coverage_patterns :
481+ target .extra_labels .append (u'COVERAGE' )
482+
480483 try :
481484 cur_tc = TOOLCHAIN_CLASSES [toolchain_name ]
482485 except KeyError :
@@ -488,7 +491,7 @@ def prepare_toolchain(src_paths, build_dir, target, toolchain_name,
488491 profile [key ].extend (contents [toolchain_name ].get (key , []))
489492
490493 toolchain = cur_tc (
491- target , notify , macros , build_dir = build_dir , build_profile = profile )
494+ target , notify , macros , build_dir = build_dir , build_profile = profile , coverage_patterns = coverage_patterns )
492495
493496 toolchain .config = config
494497 toolchain .jobs = jobs
@@ -511,7 +514,7 @@ def build_project(src_paths, build_path, target, toolchain_name,
511514 report = None , properties = None , project_id = None ,
512515 project_description = None , config = None ,
513516 app_config = None , build_profile = None , stats_depth = None ,
514- ignore = None , resource_filter = None ):
517+ ignore = None , resource_filter = None , coverage_patterns = None ):
515518 """ Build a project. A project may be a test or a user program.
516519
517520 Positional arguments:
@@ -556,7 +559,7 @@ def build_project(src_paths, build_path, target, toolchain_name,
556559 toolchain = prepare_toolchain (
557560 src_paths , build_path , target , toolchain_name , macros = macros ,
558561 clean = clean , jobs = jobs , notify = notify , config = config ,
559- app_config = app_config , build_profile = build_profile , ignore = ignore )
562+ app_config = app_config , build_profile = build_profile , ignore = ignore , coverage_patterns = coverage_patterns )
560563 toolchain .version_check ()
561564
562565 # The first path will give the name to the library
@@ -662,7 +665,7 @@ def build_library(src_paths, build_path, target, toolchain_name,
662665 archive = True , notify = None , macros = None , inc_dirs = None , jobs = 1 ,
663666 report = None , properties = None , project_id = None ,
664667 remove_config_header_file = False , app_config = None ,
665- build_profile = None , ignore = None , resource_filter = None ):
668+ build_profile = None , ignore = None , resource_filter = None , coverage_patterns = None ):
666669 """ Build a library
667670
668671 Positional arguments:
@@ -713,7 +716,7 @@ def build_library(src_paths, build_path, target, toolchain_name,
713716 toolchain = prepare_toolchain (
714717 src_paths , build_path , target , toolchain_name , macros = macros ,
715718 clean = clean , jobs = jobs , notify = notify , app_config = app_config ,
716- build_profile = build_profile , ignore = ignore )
719+ build_profile = build_profile , ignore = ignore , coverage_patterns = coverage_patterns )
717720 toolchain .version_check ()
718721
719722 # The first path will give the name to the library
0 commit comments