BaseTools/Plugin: Report error if code coverage failure

If code coverage exist failure, CI/CD need to catch it

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Michael Kubacki <mikuback@linux.microsoft.com>
Signed-off-by: Gua Guo <gua.guo@intel.com>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Michael Kubacki <mikuback@linux.microsoft.com>
This commit is contained in:
Gua Guo 2023-04-23 09:14:22 +08:00 committed by mergify[bot]
parent edacc551e6
commit 9688e231d7
1 changed files with 6 additions and 2 deletions

View File

@ -130,9 +130,13 @@ class HostBasedUnitTestRunner(IUefiBuildPlugin):
if thebuilder.env.GetValue("CODE_COVERAGE") != "FALSE": if thebuilder.env.GetValue("CODE_COVERAGE") != "FALSE":
if thebuilder.env.GetValue("TOOL_CHAIN_TAG") == "GCC5": if thebuilder.env.GetValue("TOOL_CHAIN_TAG") == "GCC5":
self.gen_code_coverage_gcc(thebuilder) ret = self.gen_code_coverage_gcc(thebuilder)
if ret != 0:
failure_count += 1
elif thebuilder.env.GetValue("TOOL_CHAIN_TAG").startswith ("VS"): elif thebuilder.env.GetValue("TOOL_CHAIN_TAG").startswith ("VS"):
self.gen_code_coverage_msvc(thebuilder) ret = self.gen_code_coverage_msvc(thebuilder)
if ret != 0:
failure_count += 1
else: else:
logging.info("Skipping code coverage. Currently, support GCC and MSVC compiler.") logging.info("Skipping code coverage. Currently, support GCC and MSVC compiler.")