<feed xmlns='http://www.w3.org/2005/Atom'>
<title>Tianocore/edk2.git/BaseTools/Plugin/HostBasedUnitTestRunner, branch dependabot/github_actions/github/codeql-action-4</title>
<subtitle>EDK II (mirror)</subtitle>
<id>https://git.radix-linux.su/Tianocore/edk2.git/atom?h=dependabot%2Fgithub_actions%2Fgithub%2Fcodeql-action-4</id>
<link rel='self' href='https://git.radix-linux.su/Tianocore/edk2.git/atom?h=dependabot%2Fgithub_actions%2Fgithub%2Fcodeql-action-4'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/'/>
<updated>2025-09-28T23:38:21+00:00</updated>
<entry>
<title>BaseTools/Plugin/HostBasedUnitTestRunner: Add CLANG support</title>
<updated>2025-09-28T23:38:21+00:00</updated>
<author>
<name>Michael D Kinney</name>
<email>michael.d.kinney@intel.com</email>
</author>
<published>2025-08-22T03:16:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/commit/?id=3c454cf7d43c59f7ff0000ca6ac333e8f359673e'/>
<id>urn:sha1:3c454cf7d43c59f7ff0000ca6ac333e8f359673e</id>
<content type='text'>
Update HostBasedUnitTestRunner to generate merged Cobertura
coverage.xml output file using CLANG code coverage data
from -fprofile-instr-generate -fcoverage-mapping options.

Signed-off-by: Michael D Kinney &lt;michael.d.kinney@intel.com&gt;
</content>
</entry>
<entry>
<title>BaseTools/HostBasedUnitTestRunner: lcov ignore mismatch errors</title>
<updated>2025-06-24T19:32:41+00:00</updated>
<author>
<name>Michael D Kinney</name>
<email>michael.d.kinney@intel.com</email>
</author>
<published>2025-06-19T05:05:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/commit/?id=3f278768fab371ca2d9d2515a85894f8ee3194f9'/>
<id>urn:sha1:3f278768fab371ca2d9d2515a85894f8ee3194f9</id>
<content type='text'>
Ignore mismatch errors for lcov 2.x in all locations that lcov
is run. When building more complex unit tests, these mismatch
errors are showing up in different phases of the code coverage
collection.

Signed-off-by: Michael D Kinney &lt;michael.d.kinney@intel.com&gt;
</content>
</entry>
<entry>
<title>BaseTools/Plugin/HostBasedUnitTestRunner: Set ASAN env vars</title>
<updated>2025-01-21T05:02:38+00:00</updated>
<author>
<name>Michael D Kinney</name>
<email>michael.d.kinney@intel.com</email>
</author>
<published>2024-12-04T03:39:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/commit/?id=139cbb266b4847d1b63a20c568a5df9b26f7489b'/>
<id>urn:sha1:139cbb266b4847d1b63a20c568a5df9b26f7489b</id>
<content type='text'>
The environment variable `GTEST_CATCH_EXCEPTION` must be
set to `0` for so all exceptions are handled by the
address sanitizer and not GoogleTest. This allows stack
back trace and other details to be logged by the address
sanitizer so the source of the issue identified address
sanitizer can be determined.

The environment variable `ASAN_OPTIONS` must be set to
`detect_leaks=0` to disable memory leak detection. The
unit test frameworks may have memory leaks and some
firmware code under test use cases may perform a memory
allocation without a matching memory free as their
expected behavior.

Signed-off-by: Michael D Kinney &lt;michael.d.kinney@intel.com&gt;
</content>
</entry>
<entry>
<title>BaseTools: Coverage: Detect lcov version</title>
<updated>2024-12-05T00:05:47+00:00</updated>
<author>
<name>Oliver Steffen</name>
<email>osteffen@redhat.com</email>
</author>
<published>2024-12-04T11:10:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/commit/?id=47ef19787356e003042d6f37d3853b9a47cb5d9e'/>
<id>urn:sha1:47ef19787356e003042d6f37d3853b9a47cb5d9e</id>
<content type='text'>
Detect the version of lcov and only apply
version 2 workaround when needed.

Fixes 61c714285f8c

Signed-off-by: Oliver Steffen &lt;osteffen@redhat.com&gt;
</content>
</entry>
<entry>
<title>BaseTools: Coverage: make lcov v2.0 work</title>
<updated>2024-12-04T06:08:05+00:00</updated>
<author>
<name>Oliver Steffen</name>
<email>osteffen@redhat.com</email>
</author>
<published>2024-09-30T18:32:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/commit/?id=61c714285f8cb83aa89b91798255f82260fa4ac2'/>
<id>urn:sha1:61c714285f8cb83aa89b91798255f82260fa4ac2</id>
<content type='text'>
lcov 2.0 and newer does additional error and consistency checking
compared to previous versions. This can lead to CI jobs failing due to
new/unexpected errors showing up.

See:
- https://edk2.groups.io/g/devel/message/116138
- https://github.com/linux-test-project/lcov/issues/209
- https://github.com/linux-test-project/lcov/issues/238

Signed-off-by: Oliver Steffen &lt;osteffen@redhat.com&gt;
</content>
</entry>
<entry>
<title>BaseTools/HostBasedUnitTestRunner: Promote Unittest error to CI fail.</title>
<updated>2024-07-15T16:50:00+00:00</updated>
<author>
<name>v-bhavanisu</name>
<email>144935558+v-bhavanisu@users.noreply.github.com</email>
</author>
<published>2024-07-12T17:45:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/commit/?id=8e6ba0dcae40bfd4c191b2cd47e08f38186513d1'/>
<id>urn:sha1:8e6ba0dcae40bfd4c191b2cd47e08f38186513d1</id>
<content type='text'>
Some unit tests would fail to execute or execute and not produce any output
logs. In these cases, the only output would be in the CI Log as
`UnitTest Execution Error`.

A UnitTest Execution Error should be considered the same as a unit tests
test failing.

Signed-off-by: Aaron Pop &lt;aaronpop@microsoft.com&gt;
</content>
</entry>
<entry>
<title>BaseTools/Plugin: Too many execute files cause "cmd too long" failure</title>
<updated>2023-05-11T05:45:51+00:00</updated>
<author>
<name>Gua Guo</name>
<email>gua.guo@intel.com</email>
</author>
<published>2023-05-08T10:45:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/commit/?id=6dd64168ed1f74c6226784233fa36a619a985a66'/>
<id>urn:sha1:6dd64168ed1f74c6226784233fa36a619a985a66</id>
<content type='text'>
Windows command prompt have 8191 characters limitation,
enhance it to make command too long can be resloved.

Provide an example, if have too many cov files, it causes to run single
command over the 8191 characters limitation.
&gt; OpenCppCoverage
&gt;  --export_type binary:coverage.cov
&gt;  --working_dir={workspace}Build
&gt;  --input_coverage=AAA.cov
&gt;  ...
&gt;  --input_coverage=NNN.cov

The solution is passing many coverage files in single command line to
breaking it up into many command lines with one coverage file per
command line in order to prevent single line is over to 8191 characters.

- Command Line 1
&gt; OpenCppCoverage
&gt;  --export_type binary:coverage.cov
&gt;  --working_dir={workspace}Build
&gt;  --input_coverage=AAA.cov
&gt;  --input_coverage=coverage.cov
...

- Command Line N
&gt; OpenCppCoverage
&gt;  --export_type. binary:coverage.cov
&gt;  --working_dir={workspace}Build
&gt;  --input_coverage=NNN.cov
&gt;  --input_coverage=coverage.cov

Cc: Michael D Kinney &lt;michael.d.kinney@intel.com&gt;
Cc: Sean Brogan &lt;sean.brogan@microsoft.com&gt;
Cc: Michael Kubacki &lt;mikuback@linux.microsoft.com&gt;
Cc: Rebecca Cran &lt;rebecca@bsdio.com&gt;
Cc: Liming Gao &lt;gaoliming@byosoft.com.cn&gt;
Cc: Bob Feng &lt;bob.c.feng@intel.com&gt;
Cc: Yuwei Chen &lt;yuwei.chen@intel.com&gt;
Signed-off-by: Gua Guo &lt;gua.guo@intel.com&gt;
Reviewed-by: Michael Kubacki &lt;mikuback@linux.microsoft.com&gt;
Reviewed-by: Michael D Kinney &lt;michael.d.kinney@intel.com&gt;
</content>
</entry>
<entry>
<title>BaseTools/Plugin: Report error if code coverage failure</title>
<updated>2023-04-27T21:55:58+00:00</updated>
<author>
<name>Gua Guo</name>
<email>gua.guo@intel.com</email>
</author>
<published>2023-04-23T01:14:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/commit/?id=9688e231d7b4d4c8569234d225e2d5b871671534'/>
<id>urn:sha1:9688e231d7b4d4c8569234d225e2d5b871671534</id>
<content type='text'>
If code coverage exist failure, CI/CD need to catch it

Cc: Michael D Kinney &lt;michael.d.kinney@intel.com&gt;
Cc: Sean Brogan &lt;sean.brogan@microsoft.com&gt;
Cc: Michael Kubacki &lt;mikuback@linux.microsoft.com&gt;
Signed-off-by: Gua Guo &lt;gua.guo@intel.com&gt;
Reviewed-by: Michael D Kinney &lt;michael.d.kinney@intel.com&gt;
Reviewed-by: Michael Kubacki &lt;mikuback@linux.microsoft.com&gt;
</content>
</entry>
<entry>
<title>BaseTools/Plugin: Clarify code coverage failure message</title>
<updated>2023-04-20T22:39:10+00:00</updated>
<author>
<name>Michael Kubacki</name>
<email>michael.kubacki@microsoft.com</email>
</author>
<published>2023-04-18T15:00:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/commit/?id=3163f34a42a5dacaf63499e69bf0fefdc409d89e'/>
<id>urn:sha1:3163f34a42a5dacaf63499e69bf0fefdc409d89e</id>
<content type='text'>
HostBasedUnitTestRunner.py is a build plugin responsible for locating
and executing host-based unit tests.

Recently, commit 6bb00aa introduced support for the plugin to
generate code coverage reports via lcov and OpenCppCoverage.

The plugin has discovered unit tests by searching for executables
with "Test" in the name for a while. However, the test coverage
change makes assumptions about test presence when crafting the
OpenCppCoverage command that ultimately fails with an ambiguous error
message if no host-based unit tests are discovered (see "ERROR").

```
SECTION - Run Host based Unit Tests
SUBSECTION - Testing for architecture: X64
ERROR - UnitTest Coverage: Failed to generate cobertura format xml in
        single package.
PROGRESS - ---&gt;Test Success: Host Unit Test Compiler Plugin NOOPT
```

This change preempts that message with a check in the plugin to
determine if any host-based tests were discovered. If not, a message
is printed with more guidance about how the developer should proceed
to either (1) fix their tests so code coverage is generated as
expected or (2) prevent the error message.

New message:

```
SECTION - Run Host based Unit Tests
SUBSECTION - Testing for architecture: X64
WARNING - UnitTest Coverage:
  No unit tests discovered. Test coverage will not be generated.

  Prevent this message by:
  1. Adding host-based unit tests to this package
  2. Ensuring tests have the word "Test" in their name
  3. Disabling HostUnitTestCompilerPlugin in the package CI YAML file
PROGRESS - ---&gt;Test Success: Host Unit Test Compiler Plugin NOOPT
```

Cc: Rebecca Cran &lt;rebecca@bsdio.com&gt;
Cc: Liming Gao &lt;gaoliming@byosoft.com.cn&gt;
Cc: Bob Feng &lt;bob.c.feng@intel.com&gt;
Cc: Yuwei Chen &lt;yuwei.chen@intel.com&gt;
Cc: Michael D Kinney &lt;michael.d.kinney@intel.com&gt;
Cc: Sean Brogan &lt;sean.brogan@microsoft.com&gt;
Signed-off-by: Michael Kubacki &lt;michael.kubacki@microsoft.com&gt;
Reviewed-by: Liming Gao &lt;gaoliming@byosoft.com.cn&gt;
Reviewed-by: Rebecca Cran &lt;rebecca@bsdio.com&gt;
</content>
</entry>
<entry>
<title>BaseTools/Plugin: Add coverage support for Unit Test</title>
<updated>2023-01-04T02:06:01+00:00</updated>
<author>
<name>Gua Guo</name>
<email>gua.guo@intel.com</email>
</author>
<published>2022-09-27T04:25:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/commit/?id=6bb00aa4846c874a8b98163624c41856b486daee'/>
<id>urn:sha1:6bb00aa4846c874a8b98163624c41856b486daee</id>
<content type='text'>
For GCC, use lcov to generate Unit Test code coverage
report

For VS2019, use OpenCppCoverage to generate code
coverage report

Cc: Bob Feng &lt;bob.c.feng@intel.com&gt;
Cc: Bret Barkelew &lt;Bret.Barkelew@microsoft.com&gt;
Cc: Liming Gao &lt;gaoliming@bysoft.com.cn&gt;
Reviewed-by: Michael D Kinney &lt;michael.d.kinney@intel.com&gt;
Cc: Sean Brogan &lt;sean.brogan@microsoft.com&gt;
Reviewed-by: Michael Kubacki &lt;mikuback@linux.microsoft.com&gt;
Signed-off-by: Gua Guo &lt;gua.guo@intel.com&gt;
</content>
</entry>
</feed>
