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

Michael D Kinney michael.d.kinney at intel.com
Thu Apr 27 00:50:40 UTC 2023


Reviewed-by: Michael D Kinney <michael.d.kinney at intel.com>


> -----Original Message-----
> From: Guo, Gua <gua.guo at intel.com>
> Sent: Wednesday, April 26, 2023 5:34 PM
> To: devel at edk2.groups.io
> Cc: Guo, Gua <gua.guo at intel.com>; Kinney, Michael D
> <michael.d.kinney at intel.com>; Sean Brogan <sean.brogan at microsoft.com>;
> Michael Kubacki <mikuback at linux.microsoft.com>
> Subject: [PATCH v2 1/2] BaseTools/Plugin: Report error if code coverage failure
> 
> From: Gua Guo <gua.guo at intel.com>
> 
> If code coverage exist failure, CI/CD need to catch it
> 
> Cc: Michael D Kinney <michael.d.kinney at intel.com>
> Cc: Sean Brogan <sean.brogan at microsoft.com>
> Cc: Michael Kubacki <mikuback at linux.microsoft.com>
> Signed-off-by: Gua Guo <gua.guo at intel.com>
> ---
>  .../HostBasedUnitTestRunner/HostBasedUnitTestRunner.py    | 8 ++++++--
>  1 file 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.")
> 
> 
> 
> --
> 2.39.2.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#103675): https://edk2.groups.io/g/devel/message/103675
Mute This Topic: https://groups.io/mt/98527915/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/leave/3943202/1813853/130120423/xyzzy [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-




More information about the edk2-devel-archive mailing list