summaryrefslogtreecommitdiffstats
path: root/BaseTools
diff options
context:
space:
mode:
authorGua Guo <gua.guo@intel.com>2023-04-23 09:14:22 +0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2023-04-27 21:55:58 +0000
commit9688e231d7b4d4c8569234d225e2d5b871671534 (patch)
tree0424331c6c04fd93ec7bac33805e7f2c95d05f7e /BaseTools
parentedacc551e6586258ab046dd852f65d674e3e2af0 (diff)
downloadedk2-9688e231d7b4d4c8569234d225e2d5b871671534.tar.gz
edk2-9688e231d7b4d4c8569234d225e2d5b871671534.tar.bz2
edk2-9688e231d7b4d4c8569234d225e2d5b871671534.zip
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>
Diffstat (limited to 'BaseTools')
-rw-r--r--BaseTools/Plugin/HostBasedUnitTestRunner/HostBasedUnitTestRunner.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/BaseTools/Plugin/HostBasedUnitTestRunner/HostBasedUnitTestRunner.py b/BaseTools/Plugin/HostBasedUnitTestRunner/HostBasedUnitTestRunner.py
index a384b55629..d993de9412 100644
--- a/BaseTools/Plugin/HostBasedUnitTestRunner/HostBasedUnitTestRunner.py
+++ b/BaseTools/Plugin/HostBasedUnitTestRunner/HostBasedUnitTestRunner.py
@@ -130,9 +130,13 @@ class HostBasedUnitTestRunner(IUefiBuildPlugin):
if thebuilder.env.GetValue("CODE_COVERAGE") != "FALSE":
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"):
- self.gen_code_coverage_msvc(thebuilder)
+ ret = self.gen_code_coverage_msvc(thebuilder)
+ if ret != 0:
+ failure_count += 1
else:
logging.info("Skipping code coverage. Currently, support GCC and MSVC compiler.")