Skip to content

Commit

Permalink
Use CI_PACKAGE_NAME
Browse files Browse the repository at this point in the history
  • Loading branch information
Javagedes committed Nov 8, 2023
1 parent bc5f740 commit d542f65
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ def __GetHostUnitTestArch(self, environment):
def RunBuildPlugin(self, packagename, Edk2pathObj, pkgconfig, environment, PLM, PLMHelper, tc, output_stream=None):
self._env = environment
environment.SetValue("CI_BUILD_TYPE", "host_unit_test", "Set in HostUnitTestCompilerPlugin")
environment.SetValue("CI_PACKAGE_NAME", packagename, "Set in HostUnitTestCompilerPlugin")

# Parse the config for required DscPath element
if "DscPath" not in pkgconfig:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ def gen_code_coverage_gcc(self, thebuilder):

# Filter out auto-generated and test code
# MU_CHANGE begin - reformat coverage data
file_out = thebuilder.env.GetValue("PLATFORM_NAME", "") + "_coverage.xml"
file_out = thebuilder.env.GetValue("CI_PACKAGE_NAME", "") + "_coverage.xml"
ret = RunCmd("lcov_cobertura",f"{buildOutputBase}/total-coverage.info --excludes ^.*UnitTest\|^.*MU\|^.*Mock\|^.*DEBUG -o {buildOutputBase}/{file_out}")
# MU_CHANGE end - reformat coverage data
if ret != 0:
Expand Down Expand Up @@ -222,7 +222,7 @@ def gen_code_coverage_msvc(self, thebuilder):

# Generate and XML file if requested.by each package
# MU_CHANGE begin - reformat coverage data
file_out = thebuilder.env.GetValue("PLATFORM_NAME", "") + "_coverage.xml"
file_out = thebuilder.env.GetValue("CI_PACKAGE_NAME", "") + "_coverage.xml"
ret = RunCmd("OpenCppCoverage", f"--export_type cobertura:{os.path.join(buildOutputBase, file_out)} {coverageFile}", workingdir=f"{workspace}Build/")
# MU_CHANGE end - reformat coverage data
if ret != 0:
Expand All @@ -247,7 +247,7 @@ def organize_coverage(self, thebuilder) -> int:
"""Organize the generated coverage file by INF."""
db = self.parse_workspace(thebuilder)
buildOutputBase = thebuilder.env.GetValue("BUILD_OUTPUT_BASE")
file_out = thebuilder.env.GetValue("PLATFORM_NAME", "") + "_coverage.xml"
file_out = thebuilder.env.GetValue("CI_PACKAGE_NAME", "") + "_coverage.xml"
cov_file = os.path.join(buildOutputBase, file_out)

return RunCmd("stuart_report", f"--database {db} coverage {cov_file} -o {cov_file} --by-package")
Expand Down

0 comments on commit d542f65

Please sign in to comment.