@@ -443,7 +443,7 @@ def target_supports_toolchain(target, toolchain_name):
443
443
def prepare_toolchain (src_paths , build_dir , target , toolchain_name ,
444
444
macros = None , clean = False , jobs = 1 ,
445
445
notify = None , config = None , app_config = None ,
446
- build_profile = None , ignore = None ):
446
+ build_profile = None , ignore = None , coverage_patterns = None ):
447
447
""" Prepares resource related objects - toolchain, target, config
448
448
449
449
Positional arguments:
@@ -460,6 +460,7 @@ def prepare_toolchain(src_paths, build_dir, target, toolchain_name,
460
460
app_config - location of a chosen mbed_app.json file
461
461
build_profile - a list of mergeable build profiles
462
462
ignore - list of paths to add to mbedignore
463
+ coverage_patterns - list of patterns for code coverage
463
464
"""
464
465
465
466
# We need to remove all paths which are repeated to avoid
@@ -483,6 +484,9 @@ def prepare_toolchain(src_paths, build_dir, target, toolchain_name,
483
484
target .default_toolchain = "uARM"
484
485
toolchain_name = selected_toolchain_name
485
486
487
+ if coverage_patterns :
488
+ target .extra_labels .append (u'COVERAGE' )
489
+
486
490
try :
487
491
cur_tc = TOOLCHAIN_CLASSES [toolchain_name ]
488
492
except KeyError :
@@ -494,7 +498,7 @@ def prepare_toolchain(src_paths, build_dir, target, toolchain_name,
494
498
profile [key ].extend (contents [toolchain_name ].get (key , []))
495
499
496
500
toolchain = cur_tc (
497
- target , notify , macros , build_dir = build_dir , build_profile = profile )
501
+ target , notify , macros , build_dir = build_dir , build_profile = profile , coverage_patterns = coverage_patterns )
498
502
499
503
toolchain .config = config
500
504
toolchain .jobs = jobs
@@ -517,7 +521,7 @@ def build_project(src_paths, build_path, target, toolchain_name,
517
521
report = None , properties = None , project_id = None ,
518
522
project_description = None , config = None ,
519
523
app_config = None , build_profile = None , stats_depth = None ,
520
- ignore = None , resource_filter = None ):
524
+ ignore = None , resource_filter = None , coverage_patterns = None ):
521
525
""" Build a project. A project may be a test or a user program.
522
526
523
527
Positional arguments:
@@ -562,7 +566,7 @@ def build_project(src_paths, build_path, target, toolchain_name,
562
566
toolchain = prepare_toolchain (
563
567
src_paths , build_path , target , toolchain_name , macros = macros ,
564
568
clean = clean , jobs = jobs , notify = notify , config = config ,
565
- app_config = app_config , build_profile = build_profile , ignore = ignore )
569
+ app_config = app_config , build_profile = build_profile , ignore = ignore , coverage_patterns = coverage_patterns )
566
570
toolchain .version_check ()
567
571
568
572
# The first path will give the name to the library
@@ -668,7 +672,7 @@ def build_library(src_paths, build_path, target, toolchain_name,
668
672
archive = True , notify = None , macros = None , inc_dirs = None , jobs = 1 ,
669
673
report = None , properties = None , project_id = None ,
670
674
remove_config_header_file = False , app_config = None ,
671
- build_profile = None , ignore = None , resource_filter = None ):
675
+ build_profile = None , ignore = None , resource_filter = None , coverage_patterns = None ):
672
676
""" Build a library
673
677
674
678
Positional arguments:
@@ -719,7 +723,7 @@ def build_library(src_paths, build_path, target, toolchain_name,
719
723
toolchain = prepare_toolchain (
720
724
src_paths , build_path , target , toolchain_name , macros = macros ,
721
725
clean = clean , jobs = jobs , notify = notify , app_config = app_config ,
722
- build_profile = build_profile , ignore = ignore )
726
+ build_profile = build_profile , ignore = ignore , coverage_patterns = coverage_patterns )
723
727
toolchain .version_check ()
724
728
725
729
# The first path will give the name to the library
0 commit comments