<feed xmlns='http://www.w3.org/2005/Atom'>
<title>Tianocore/edk2.git/BaseTools/Plugin/HostBasedUnitTestRunner, branch trunk</title>
<subtitle>EDK II (mirror)</subtitle>
<id>https://git.radix-linux.su/Tianocore/edk2.git/atom?h=trunk</id>
<link rel='self' href='https://git.radix-linux.su/Tianocore/edk2.git/atom?h=trunk'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/'/>
<updated>2024-06-04T03:43:08+00:00</updated>
<entry>
<title>Renormalized end-of-lines from master@27b044605cd5f6b33a3d231576003850b3fe305b</title>
<updated>2024-06-04T03:43:08+00:00</updated>
<author>
<name>kx</name>
<email>kx@radix.pro</email>
</author>
<published>2024-06-04T03:43:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/commit/?id=7e2ccccace24636f29ddc210b94606abd4c7e42b'/>
<id>urn:sha1:7e2ccccace24636f29ddc210b94606abd4c7e42b</id>
<content type='text'>
</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>
<entry>
<title>BaseTools/Plugin/HostBaseUnitTestRunner: Enable gtest xml output</title>
<updated>2022-11-11T05:46:51+00:00</updated>
<author>
<name>Michael D Kinney</name>
<email>michael.d.kinney@intel.com</email>
</author>
<published>2022-10-31T17:09:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/commit/?id=31377aba8f4e126266251bc53bc148599bb4565a'/>
<id>urn:sha1:31377aba8f4e126266251bc53bc148599bb4565a</id>
<content type='text'>
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4134

Set environment variable GTEST_OUTPUT to specify the output
format of XML and the output file name.  Both CMOCKA_XML_FILE
and GTEST_OUTPUT are set for each host based unit test to
support both cmocka unit tests and gtest unit tests.

Cc: Bob Feng &lt;bob.c.feng@intel.com&gt;
Cc: Liming Gao &lt;gaoliming@byosoft.com.cn&gt;
Cc: Yuwei Chen &lt;yuwei.chen@intel.com&gt;
Signed-off-by: Michael D Kinney &lt;michael.d.kinney@intel.com&gt;
Reviewed-by: Bob Feng &lt;bob.c.feng@intel.com&gt;
</content>
</entry>
<entry>
<title>BaseTools/Plugin: Update HostBasedUnitTestRunner to support Linux</title>
<updated>2020-05-08T05:54:46+00:00</updated>
<author>
<name>Sean Brogan</name>
<email>sean.brogan@microsoft.com</email>
</author>
<published>2020-04-15T20:30:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/commit/?id=c8543b8d830d22882dab4ece47f0413f9c6eb431'/>
<id>urn:sha1:c8543b8d830d22882dab4ece47f0413f9c6eb431</id>
<content type='text'>
REF:https://bugzilla.tianocore.org/show_bug.cgi?id=2513

Update HostBasedUnitTestRunner plugin to support the Linux environment
and remove any Windows only logic.

Cc: Bob Feng &lt;bob.c.feng@intel.com&gt;
Cc: Liming Gao &lt;liming.gao@intel.com&gt;
Cc: Bret Barkelew &lt;Bret.Barkelew@microsoft.com&gt;
Cc: Michael D Kinney &lt;michael.d.kinney@intel.com&gt;
Signed-off-by: Sean Brogan &lt;sean.brogan@microsoft.com&gt;
Signed-off-by: Michael Kubacki &lt;michael.kubacki@microsoft.com&gt;
Reviewed-by: Shenglei Zhang &lt;shenglei.zhang@intel.com&gt;
Reviewed-by: Liming Gao &lt;liming.gao@intel.com&gt;
</content>
</entry>
<entry>
<title>BaseTools/Plugin: Add HostBasedUnitTestRunner plugin</title>
<updated>2020-02-07T19:18:53+00:00</updated>
<author>
<name>Michael D Kinney</name>
<email>michael.d.kinney@intel.com</email>
</author>
<published>2020-01-22T23:28:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/commit/?id=0a5d2b505cca2a6038a6bca1e299b09c73ae34a4'/>
<id>urn:sha1:0a5d2b505cca2a6038a6bca1e299b09c73ae34a4</id>
<content type='text'>
https://bugzilla.tianocore.org/show_bug.cgi?id=2505

Add plugin to BaseTools to run host based unit tests.

Cc: Sean Brogan &lt;sean.brogan@microsoft.com&gt;
Cc: Bret Barkelew &lt;Bret.Barkelew@microsoft.com&gt;
Cc: Bob Feng &lt;bob.c.feng@intel.com&gt;
Cc: Liming Gao &lt;liming.gao@intel.com&gt;
Signed-off-by: Michael D Kinney &lt;michael.d.kinney@intel.com&gt;
Reviewed-by: Bret Barkelew &lt;Bret.Barkelew@microsoft.com&gt;
Acked-by: Bob Feng &lt;bob.c.feng@intel.com&gt;
</content>
</entry>
</feed>
