-
Notifications
You must be signed in to change notification settings - Fork 3k
TOOLS: enable build greentea test coverage for HW #11904
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@jamesbeyond, thank you for your changes. |
@@ -44,7 +44,7 @@ def check_executable(): | |||
) | |||
|
|||
def __init__(self, target, notify=None, macros=None, build_profile=None, | |||
build_dir=None): | |||
build_dir=None, coverage_patterns=None): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As for arm.py; change only applies for gcc-arm so no need to change here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please see my above comments, about why ARM and IAR need to be changed as well.
self.coverage_cppc = self.cppc + ["--coverage", "-DENABLE_LIBGCOV_PORT"] | ||
self.coverage_ld = self.ld + ['--coverage', '-Wl,--wrap,GREENTEA_SETUP', '-Wl,--wrap,_Z25GREENTEA_TESTSUITE_RESULTi'] | ||
|
||
for flag in ["-DMBED_DEBUG"]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could do with a comment here explaining what this is doing, and more importantly why.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comments added
@@ -208,6 +223,12 @@ def get_compile_options(self, defines, includes, for_asm=False): | |||
opts = opts + self.get_config_option(config_header) | |||
return opts | |||
|
|||
def match_coverage_patterns(self, source): | |||
for pattern in self.coverage_patterns: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Document what this new function is doing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comments added
): | ||
ARM.__init__( | ||
self, | ||
target, | ||
notify, | ||
macros, | ||
build_dir=build_dir, | ||
build_profile=build_profile | ||
build_profile=build_profile, | ||
coverage_patterns=None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't need to change this - gcc-arm only
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please see my above comments, about why ARM and IAR need to be changed as well.
@jamesbeyond could you please take a look at the review comments ? |
the asked changes been addressed, could you review again ? @mark-edgeworth |
Ci started |
Test run: SUCCESSSummary: 11 of 11 test jobs passed |
Description (required)
This PR adds a hidden option
--coverage-filters
to thembed test
function. this option allows filters to be passed into the tests building stage. for the files matches with filters will be compiled with a gcov option, the rest of the files will be covered by the default compiler options.Summary of change (What the change is for and why)
This option is key to enabling code coverage from HW, only in the way the gcov complied images should be small enough to fit a HW target
This option only applies to GCC_ARM toolchain, no impact to other toolchains
This option is not visible from
mbed test --help
, so no public users impact, because the function is still in an experimental stage.for the file that matches with given filter compiler options
--coverage
,-DENABLE_LIBGCOV_PORT
are addedlinker options
--coverage
,-Wl,--wrap,GREENTEA_SETUP
,-Wl,--wrap,_Z25GREENTEA_TESTSUITE_RESULTi
are added if the option is enabled.if the option is not in use normal mbed test option will not get impacted
Documentation (Details of any document updates required)
becasue this is
Pull request type (required)
Test results (required)
Reviewers (optional)
@mark-edgeworth
Release Notes (required for feature/major PRs)
Summary of changes
Impact of changes
Migration actions required