<feed xmlns='http://www.w3.org/2005/Atom'>
<title>Tianocore/edk2.git/UnitTestFrameworkPkg/PrivateInclude, branch dependabot/github_actions/actions/setup-python-7</title>
<subtitle>EDK II (mirror)</subtitle>
<id>https://git.radix-linux.su/Tianocore/edk2.git/atom?h=dependabot%2Fgithub_actions%2Factions%2Fsetup-python-7</id>
<link rel='self' href='https://git.radix-linux.su/Tianocore/edk2.git/atom?h=dependabot%2Fgithub_actions%2Factions%2Fsetup-python-7'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/'/>
<updated>2026-02-23T21:01:28+00:00</updated>
<entry>
<title>UnitTestFrameworkPkg: Replace include guards with #pragma once</title>
<updated>2026-02-23T21:01:28+00:00</updated>
<author>
<name>Michael Kubacki</name>
<email>michael.kubacki@microsoft.com</email>
</author>
<published>2026-02-03T19:35:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/commit/?id=59f58197ddec8213b442732391e09cd37126bd8c'/>
<id>urn:sha1:59f58197ddec8213b442732391e09cd37126bd8c</id>
<content type='text'>
Replace traditional `#ifndef`/`#define`/`#endif` include guards
with `#pragma` once.

`#pragma once` is a widely supported preprocessor directive that
prevents header files from being included multiple times. It is
supported by all toolchains used to build edk2: GCC, Clang/LLVM, and
MSVC.

Compared to macro-based include guards, `#pragma once`:

- Eliminates the risk of macro name collisions or copy/paste errors
  where two headers inadvertently use the same guard macro.
- Eliminate inconsistency in the way include guard macros are named
  (e.g., some files use `__FILE_H__`, others use `FILE_H_`, etc.).
- Reduces boilerplate (three lines replaced by one).
- Avoids polluting the macro namespace with guard symbols.
- Can improve build times as the preprocessor can skip re-opening the
  file entirely, rather than re-reading it to find the matching
  `#endif` ("multiple-include optimization").
  - Note that some compilers may already optimize traditional include
    guards, by recognzining the idiomatic pattern.

This change is made acknowledging that overall portability of the
code will technically be reduced, as `#pragma once` is not part of the
C/C++ standards.

However, this is considered acceptable given:

1. edk2 already defines a subset of supported compilers in
   BaseTools/Conf/tools_def.template, all of which have supported
   `#pragma once` for over two decades.
2. There have been concerns raised to the project about inconsistent
   include guard naming and potential macro collisions.

Approximate compiler support dates:

- MSVC: Supported since Visual C++ 4.2 (1996)
- GCC: Supported since 3.4 (2004)
  (http://gnu.ist.utl.pt/software/gcc/gcc-3.4/changes.html)
- Clang (LLVM based): Since initial release in 2007

Signed-off-by: Michael Kubacki &lt;michael.kubacki@microsoft.com&gt;
</content>
</entry>
<entry>
<title>UnitTestFrameworkPkg: UnitTestLib: Support Failure Strings of 512 Chars</title>
<updated>2024-10-08T01:26:36+00:00</updated>
<author>
<name>Oliver Smith-Denny</name>
<email>osde@microsoft.com</email>
</author>
<published>2024-10-02T15:13:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/commit/?id=2ee050d1d5bdc071f01ae66ce886c35ebf36b27e'/>
<id>urn:sha1:2ee050d1d5bdc071f01ae66ce886c35ebf36b27e</id>
<content type='text'>
Currently, there is a mismatch of allowed string sizes in UnitTestLib.
The UT_LOG_* macros allow a string size of 512, but failure messages
are constrained to 120 characters and some other string lengths are
similarly constrained. 120 characters is too few for some longer
error messages, particularly the ones that print out the path to
the failing line. This can result in the actual error not getting
printed in the log.

This patch updates all UnitTestLib allowed string lengths to be 512
characters.

Signed-off-by: Oliver Smith-Denny &lt;osde@linux.microsoft.com&gt;
</content>
</entry>
<entry>
<title>UnitTestFrameworkPkg: Library classes private to public</title>
<updated>2022-12-01T21:01:21+00:00</updated>
<author>
<name>Michael D Kinney</name>
<email>michael.d.kinney@intel.com</email>
</author>
<published>2022-11-30T21:14:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/commit/?id=a1d57239140f09a8b2cc386f9421f6f4e634435f'/>
<id>urn:sha1:a1d57239140f09a8b2cc386f9421f6f4e634435f</id>
<content type='text'>
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4178

* Change GoogleTestLib class from private to public.
* Change UnitTestPersistenceLib class from private to public.

Cc: Michael Kubacki &lt;mikuback@linux.microsoft.com&gt;
Cc: Sean Brogan &lt;sean.brogan@microsoft.com&gt;
Cc: Ray Ni &lt;ray.ni@intel.com&gt;
Cc: Zhiguang Liu &lt;zhiguang.liu@intel.com&gt;
Signed-off-by: Michael D Kinney &lt;michael.d.kinney@intel.com&gt;
Reviewed-by: Michael Kubacki &lt;michael.kubacki@microsoft.com&gt;
Reviewed-by: Ray Ni &lt;ray.ni@intel.com&gt;
</content>
</entry>
<entry>
<title>UnitTestFrameworkPkg: Apply uncrustify changes</title>
<updated>2021-12-07T17:24:28+00:00</updated>
<author>
<name>Michael Kubacki</name>
<email>michael.kubacki@microsoft.com</email>
</author>
<published>2021-12-05T22:54:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/commit/?id=7c0ad2c33810ead45b7919f8f8d0e282dae52e71'/>
<id>urn:sha1:7c0ad2c33810ead45b7919f8f8d0e282dae52e71</id>
<content type='text'>
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3737

Apply uncrustify changes to .c/.h files in the UnitTestFrameworkPkg package

Cc: Andrew Fish &lt;afish@apple.com&gt;
Cc: Leif Lindholm &lt;leif@nuviainc.com&gt;
Cc: Michael D Kinney &lt;michael.d.kinney@intel.com&gt;
Signed-off-by: Michael Kubacki &lt;michael.kubacki@microsoft.com&gt;
Reviewed-by: Bret Barkelew &lt;bret.barkelew@microsoft.com&gt;
</content>
</entry>
<entry>
<title>UnitTestFrameworkPkg/UnitTestLib: Add checks for ASSERT()</title>
<updated>2020-07-15T05:25:21+00:00</updated>
<author>
<name>Michael D Kinney</name>
<email>michael.d.kinney@intel.com</email>
</author>
<published>2020-06-11T00:57:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/commit/?id=26824851b041d9e81921ec7ef97220d2a2576157'/>
<id>urn:sha1:26824851b041d9e81921ec7ef97220d2a2576157</id>
<content type='text'>
REF: REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2801

Add UnitTestDebugAssertLib that provides the UnitTestDebugAssert()
service and the gUnitTestExpectAssertFailureJumpBuffer global
variable.  This NULL library is linked against all host and target
unit test builds.  This guarantees that the UnitTestDebugAssert()
service is available to link against all libraries and modules that
use the DebugLib class.

EDKII_UNIT_TEST_FRAMEWORK_ENABLED must always be defined when
building unit tests so the behavior of the DebugLib ASSERT()
macros can be adjusted to allow the unit test framework to
catch an ASSERT() if it is triggered by a function under test.

Cc: Sean Brogan &lt;sean.brogan@microsoft.com&gt;
Cc: Bret Barkelew &lt;Bret.Barkelew@microsoft.com&gt;
Cc: Jiewen Yao &lt;jiewen.yao@intel.com&gt;
Signed-off-by: Michael D Kinney &lt;michael.d.kinney@intel.com&gt;
Reviewed-by: Liming Gao &lt;liming.gao@intel.com&gt;
Reviewed-by: Bret Barkelew &lt;Bret.Barkelew@microsoft.com&gt;
</content>
</entry>
<entry>
<title>UnitTestFrameworkPkg: Add public and private interfaces</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-22T18:06:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/commit/?id=0f7fb5c5e5ad4b1654d67c65c77999bd9e5a5af5'/>
<id>urn:sha1:0f7fb5c5e5ad4b1654d67c65c77999bd9e5a5af5</id>
<content type='text'>
https://bugzilla.tianocore.org/show_bug.cgi?id=2505

Add public interfaces for use by unit test implementations.

* Include path to cmocka library interfaces.
* PcdUnitTestLogLevel to set the unit test logging message
  level to filter log messages.

Add private interfaces that are used by UnitTestLib
implementations.

* [Private] UnitTestBootLib - Set boot next to continue unit
  tests across a reboot.
* [Private] UnitTestPersistenceLib - Save unit test framework
  state to a persistent storage device.
* [Private] UnitTestResultLib - Output unit test results to a
  console device.
* [Private] UnitTestFrameworkTypes.h - Internal structures
  used by UnitTestLib implementations to keep track if unit
  test frameworks, unit test suites, and unit tests along with
  the serialized storage format to save a unit test framework
  state to persistent storage.

Cc: Sean Brogan &lt;sean.brogan@microsoft.com&gt;
Cc: Bret Barkelew &lt;Bret.Barkelew@microsoft.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;
</content>
</entry>
</feed>
