[edk2-devel] [PATCH] BaseTools/Plugin: Report error if code coverage failure

Guo, Gua posted 1 patch 1 year ago
Failed in applying to current master (apply log)
.../HostBasedUnitTestRunner/HostBasedUnitTestRunner.py      | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
[edk2-devel] [PATCH] BaseTools/Plugin: Report error if code coverage failure
Posted by Guo, Gua 1 year ago
From: Gua Guo <gua.guo@intel.com>

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>
---
 .../HostBasedUnitTestRunner/HostBasedUnitTestRunner.py      | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/BaseTools/Plugin/HostBasedUnitTestRunner/HostBasedUnitTestRunner.py b/BaseTools/Plugin/HostBasedUnitTestRunner/HostBasedUnitTestRunner.py
index 0e013c5f1a..a3da253d93 100644
--- a/BaseTools/Plugin/HostBasedUnitTestRunner/HostBasedUnitTestRunner.py
+++ b/BaseTools/Plugin/HostBasedUnitTestRunner/HostBasedUnitTestRunner.py
@@ -117,9 +117,11 @@ class HostBasedUnitTestRunner(IUefiBuildPlugin):
 
             if thebuilder.env.GetValue("CODE_COVERAGE") != "FALSE":
                 if thebuilder.env.GetValue("TOOL_CHAIN_TAG") == "GCC5":
-                    self.gen_code_coverage_gcc(thebuilder)
+                    status = self.gen_code_coverage_gcc(thebuilder)
+                    failure_count += status
                 elif thebuilder.env.GetValue("TOOL_CHAIN_TAG").startswith ("VS"):
-                    self.gen_code_coverage_msvc(thebuilder)
+                    status = self.gen_code_coverage_msvc(thebuilder)
+                    failure_count += status
                 else:
                     logging.info("Skipping code coverage. Currently, support GCC and MSVC compiler.")
 
-- 
2.39.2.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#103442): https://edk2.groups.io/g/devel/message/103442
Mute This Topic: https://groups.io/mt/98441497/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-