Skip to content

Commit 91f14ee

Browse files
committed
Add CC_EXCLUDE support to exclude filetypes from reorganized reports. Defaults to exclude Null. Updated documentation
1 parent 6189d11 commit 91f14ee

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

BaseTools/Plugin/HostBasedUnitTestRunner/HostBasedUnitTestRunner.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
import xml.etree.ElementTree
1313
from edk2toolext.environment.plugintypes.uefi_build_plugin import IUefiBuildPlugin
1414
from edk2toolext import edk2_logging
15-
import edk2toollib.windows.locate_tools as locate_tools
1615
from edk2toolext.environment import shell_environment
1716
from edk2toollib.utility_functions import RunCmd
1817
from edk2toollib.utility_functions import GetHostInfo
@@ -293,13 +292,14 @@ def organize_coverage(self, thebuilder) -> int:
293292
package = thebuilder.env.GetValue("CI_PACKAGE_NAME", "")
294293
file_out = package + "_coverage.xml"
295294
cov_file = os.path.join(buildOutputBase, file_out)
295+
exclude = thebuilder.env.GetValue("CC_EXCLUDE", "*NULL*,*Null*,*null*")
296296

297297
params = f"--database {db_path} coverage {cov_file} -o {cov_file} --by-package -ws {workspace}"
298298

299299
params += f" -p {package}" * int(package != "")
300300
params += " --full" * int(thebuilder.env.GetValue("CC_FULL", "FALSE") == "TRUE")
301301
params += " --flatten" * int(thebuilder.env.GetValue("CC_FLATTEN", "FALSE") == "TRUE")
302-
302+
params += f" --exclude {exclude}" * int(exclude != "")
303303
return RunCmd("stuart_report", params)
304304

305305
def parse_workspace(self, thebuilder) -> str:

UnitTestFrameworkPkg/ReadMe.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1516,8 +1516,10 @@ or FALSE e.g. `CC_REORGANIZE=TRUE`:
15161516
1. `CC_FULL`: Generates zero'd out coverage data for untested source files in the package.
15171517
Default: `FALSE`
15181518
1. `CC_FLATTEN`: Groups all source files together, rather than by INF. Default: `FALSE`
1519+
1. `CC_EXCLUDE`: Comma separated list of fnmatch expressions to exclude from results.
1520+
Default: \*NULL\*,\*Null\*,\*null\*
15191521

1520-
** NOTE: `CC_FULL` and `CC_FLATTEN` values only matter if `CC_REORGANIZE=TRUE`, as they only
1522+
** NOTE: `CC_FULL` and `CC_FLATTEN` and `CC_EXCLUDE` values only matter if `CC_REORGANIZE=TRUE`, as they only
15211523
effect how the coverage report is reorganized.
15221524

15231525
**TIP: `CC_FLATTEN=TRUE/FALSE` will produce different coverage percentage results as `TRUE` de-duplicates source files

0 commit comments

Comments
 (0)