Branch: refs/heads/master
Home: https://github.com/tianocore/edk2
Commit: 5b86bbf891677882a9d097f87cd0128562c12c43
https://github.com/tianocore/edk2/commit/5b86bbf891677882a9d097f87cd0128562c12c43
Author: Michael D Kinney <[email protected]>
Date: 2020-07-15 (Wed, 15 Jul 2020)
Changed paths:
M BaseTools/Source/Python/Workspace/WorkspaceCommon.py
Log Message:
-----------
BaseTools/Python: Allow HOST_APPLICATION to use NULL libraries
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2797
Update HOST_APPLICATION module type to use NULL library instances.
Cc: Bob Feng <[email protected]>
Cc: Liming Gao <[email protected]>
Cc: Sean Brogan <[email protected]>
Cc: Bret Barkelew <[email protected]>
Cc: Jiewen Yao <[email protected]>
Signed-off-by: Michael D Kinney <[email protected]>
Reviewed-by: Bob Feng <[email protected]>
Reviewed-by: Sean Brogan <[email protected]>
Reviewed-by: Liming Gao <[email protected]>
Commit: 9af8a299cec10656b757ae30a71c1310260d3c31
https://github.com/tianocore/edk2/commit/9af8a299cec10656b757ae30a71c1310260d3c31
Author: Michael D Kinney <[email protected]>
Date: 2020-07-15 (Wed, 15 Jul 2020)
Changed paths:
A MdePkg/Library/BaseCpuLibNull/BaseCpuLibNull.c
A MdePkg/Library/BaseCpuLibNull/BaseCpuLibNull.inf
A MdePkg/Library/BaseCpuLibNull/BaseCpuLibNull.uni
M MdePkg/MdePkg.dsc
Log Message:
-----------
MdePkg/BaseCpuLibNull: Add Null version of CpuLib for host testing
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2798
The services in CpuLib usually generate exceptions in a unit test
host application. Provide a Null instance that can be safely used.
This Null instance can also be used as a template for implementing
new instances of CpuLib.
Cc: Liming Gao <[email protected]>
Cc: Sean Brogan <[email protected]>
Cc: Bret Barkelew <[email protected]>
Cc: Jiewen Yao <[email protected]>
Signed-off-by: Michael D Kinney <[email protected]>
Reviewed-by: Liming Gao <[email protected]>
Reviewed-by: Sean Brogan <[email protected]>
Reviewed-by: Liming Gao <[email protected]>
Commit: 0a81a98e900118857395b101f413c1c17b66c073
https://github.com/tianocore/edk2/commit/0a81a98e900118857395b101f413c1c17b66c073
Author: Michael D Kinney <[email protected]>
Date: 2020-07-15 (Wed, 15 Jul 2020)
Changed paths:
A MdePkg/Library/BaseCacheMaintenanceLibNull/BaseCacheMaintenanceLibNull.c
A MdePkg/Library/BaseCacheMaintenanceLibNull/BaseCacheMaintenanceLibNull.inf
A MdePkg/Library/BaseCacheMaintenanceLibNull/BaseCacheMaintenanceLibNull.uni
M MdePkg/MdePkg.dsc
Log Message:
-----------
MdePkg/BaseCacheMaintenanceLibNull: Add Null instance for host testing
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2799
The services in CacheMaintenanceLib usually generate exceptions in a
unit test host application. Provide a Null instance that can be safely
used.
This Null instance can also be used as a template for implementing
new instances of CacheMaintenanceLib.
Cc: Liming Gao <[email protected]>
Cc: Sean Brogan <[email protected]>
Cc: Bret Barkelew <[email protected]>
Cc: Jiewen Yao <[email protected]>
Signed-off-by: Michael D Kinney <[email protected]>
Reviewed-by: Liming Gao <[email protected]>
Commit: d3c9e40abcc839f59d56b7fca7787647533d96fe
https://github.com/tianocore/edk2/commit/d3c9e40abcc839f59d56b7fca7787647533d96fe
Author: Michael D Kinney <[email protected]>
Date: 2020-07-15 (Wed, 15 Jul 2020)
Changed paths:
M MdePkg/Library/BaseLib/BaseLib.inf
M MdePkg/Library/BaseLib/Ia32/GccInline.c
A MdePkg/Library/BaseLib/Ia32/GccInlinePriv.c
M MdePkg/Library/BaseLib/X64/GccInline.c
A MdePkg/Library/BaseLib/X64/GccInlinePriv.c
Log Message:
-----------
MdePkg/BaseLib: Break out IA32/X64 GCC inline privileged functions
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2800
Break out the IA32/X64 GCC inline functions that can not be used
in a unit test host application into their own source file. This
does not make any changes to the BaseLib library instance. This
is in preparation for a new BaseLib instances that is safe to use
with host-based unit test applications.
Cc: Liming Gao <[email protected]>
Cc: Sean Brogan <[email protected]>
Cc: Bret Barkelew <[email protected]>
Cc: Jiewen Yao <[email protected]>
Signed-off-by: Michael D Kinney <[email protected]>
Reviewed-by: Liming Gao <[email protected]>
Commit: 540fd45f755f1646e019099c90c9f59286604228
https://github.com/tianocore/edk2/commit/540fd45f755f1646e019099c90c9f59286604228
Author: Michael D Kinney <[email protected]>
Date: 2020-07-15 (Wed, 15 Jul 2020)
Changed paths:
A MdePkg/Library/BaseLib/UnitTestHost.c
A MdePkg/Library/BaseLib/UnitTestHost.h
A MdePkg/Library/BaseLib/UnitTestHostBaseLib.inf
A MdePkg/Library/BaseLib/UnitTestHostBaseLib.uni
A MdePkg/Library/BaseLib/X86UnitTestHost.c
M MdePkg/MdePkg.dec
M MdePkg/Test/MdePkgHostTest.dsc
A MdePkg/Test/UnitTest/Include/Library/UnitTestHostBaseLib.h
Log Message:
-----------
MdePkg/Library/BaseLib: Add BaseLib instance for host based unit tests
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2800
Add a new version of BaseLib that is safe for use from host based
unit test applications. Host based unit test applications may need
to provide implementations of some BaseLib functions that provide
simple emulation to exercise the code under test. The structure
UNIT_TEST_HOST_BASE_LIB is filled in with services that provide
default emulation for BaseLib APIs that would normally generate
exceptions in a host based unit test application. This structure
allows an individual unit test to replace the default emulation of
a BaseLib service with an alternate version that is required by a
specific unit test. A global variable of type UNIT_TEST_HOST_BASE_LIB
is provided through the new UnitTestHostBaseLib library class.
Normally cmocka would be used to mock services the code under
test calls. However, the BaseLib is used by the Unit Test
Framework itself, so using a mocked interface is not possible.
The use of a structure to provide hooks for unit test is not
expected to be a common feature. It should only be required
for libraries that are used by both the Unit Test Framework and
the code under test where the code under test requires a
different behavior than the Unit Test Framework.
Cc: Liming Gao <[email protected]>
Cc: Sean Brogan <[email protected]>
Cc: Bret Barkelew <[email protected]>
Cc: Jiewen Yao <[email protected]>
Signed-off-by: Michael D Kinney <[email protected]>
Reviewed-by: Liming Gao <[email protected]>
Commit: a0a49eb87c5819a76a0a5fea81d2b51ffdfcb3aa
https://github.com/tianocore/edk2/commit/a0a49eb87c5819a76a0a5fea81d2b51ffdfcb3aa
Author: Michael D Kinney <[email protected]>
Date: 2020-07-15 (Wed, 15 Jul 2020)
Changed paths:
M UnitTestFrameworkPkg/UnitTestFrameworkPkgHost.dsc.inc
Log Message:
-----------
UnitTestFrameworkPkg: Use host libraries from MdePkg
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2800
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2799
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2798
Update the default unit test library mappings to use the
library instances from the MdePkg that are safe for host
based unit tests.
Cc: Sean Brogan <[email protected]>
Cc: Bret Barkelew <[email protected]>
Cc: Jiewen Yao <[email protected]>
Signed-off-by: Michael D Kinney <[email protected]>
Reviewed-by: Liming Gao <[email protected]>
Reviewed-by: Bret Barkelew <[email protected]>
Commit: 35f9d7c41b380d67953dabc5994a65e32baa7d39
https://github.com/tianocore/edk2/commit/35f9d7c41b380d67953dabc5994a65e32baa7d39
Author: Michael D Kinney <[email protected]>
Date: 2020-07-15 (Wed, 15 Jul 2020)
Changed paths:
M UnitTestFrameworkPkg/UnitTestFrameworkPkgHost.dsc.inc
Log Message:
-----------
UnitTestFrameworkPkg: Enable source level debug for host tests
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2804
Optionally enable a feature to support source level debug of a
host based unit test. By default, this feature is disabled.
Exceptions are caught by the unit test framework and are
interpreted as a test failure.
When a unit test is under development, bugs may generate
exceptions or a unit test developer may want to trace the
execution of unit tests to debug some unexpected behavior.
Defining UNIT_TESTING_DEBUG in the DSC file or from the build
command line allows exceptions to be caught by the host OS
and allows the developer to debug their unit test under
development or debug the Unit Test Framework itself.
Cc: Sean Brogan <[email protected]>
Cc: Bret Barkelew <[email protected]>
Cc: Jiewen Yao <[email protected]>
Signed-off-by: Michael D Kinney <[email protected]>
Reviewed-by: Liming Gao <[email protected]>
Reviewed-by: Bret Barkelew <[email protected]>
Commit: f08715947ad52ee4fd67358660860ea63a532e15
https://github.com/tianocore/edk2/commit/f08715947ad52ee4fd67358660860ea63a532e15
Author: Michael D Kinney <[email protected]>
Date: 2020-07-15 (Wed, 15 Jul 2020)
Changed paths:
M UnitTestFrameworkPkg/UnitTestFrameworkPkgHost.dsc.inc
Log Message:
-----------
UnitTestFrameworkPkg: Set host application stack size to 256KB
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2803
The UEFI Specification defines the minimum stack size before
ExitBootServices() to be 128KB. When running a host based unit
test, there may be additional stack overhead from the host
application environment and cmocka.
Update the build flags to set the size of the stack to 256KB
which is double the UEFI Specification requirement.
Cc: Sean Brogan <[email protected]>
Cc: Bret Barkelew <[email protected]>
Cc: Jiewen Yao <[email protected]>
Signed-off-by: Michael D Kinney <[email protected]>
Reviewed-by: Liming Gao <[email protected]>
Reviewed-by: Bret Barkelew <[email protected]>
Commit: 813c2b15255406f587484ffcedfd01ca9ab5d056
https://github.com/tianocore/edk2/commit/813c2b15255406f587484ffcedfd01ca9ab5d056
Author: Michael D Kinney <[email protected]>
Date: 2020-07-15 (Wed, 15 Jul 2020)
Changed paths:
M UnitTestFrameworkPkg/UnitTestFrameworkPkgTarget.dsc.inc
Log Message:
-----------
UnitTestFrameworkPkg: Change target mode DebugLib mapping
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2801
The default DebugLib for target mode was DebugLibNull. This
library instance disables all ASSERT() and DEBUG() macros
which removes the ability to write unit tests that check for
ASSERT() behaviors.
The DebugLib is changed to PeiDxeDebugLibReportStatusCode.inf
that guarantees that DEBUG() and ASSERT() macros are active. The
default ReportStatusCodeLib is set to BaseReportStatusCodeLibNull.inf
so no messages are sent to any devices preserving the DebugLibNull
behavior.
A platform specific unit test can always override these mappings
with a platform specific DebugLib.
Cc: Sean Brogan <[email protected]>
Cc: Bret Barkelew <[email protected]>
Cc: Jiewen Yao <[email protected]>
Signed-off-by: Michael D Kinney <[email protected]>
Reviewed-by: Liming Gao <[email protected]>
Reviewed-by: Bret Barkelew <[email protected]>
Commit: 77e42ca4dfbf51918d677f32ab64bb99dd07cc40
https://github.com/tianocore/edk2/commit/77e42ca4dfbf51918d677f32ab64bb99dd07cc40
Author: Michael D Kinney <[email protected]>
Date: 2020-07-15 (Wed, 15 Jul 2020)
Changed paths:
M UnitTestFrameworkPkg/Library/UnitTestLib/RunTestsCmocka.c
Log Message:
-----------
UnitTestFrameworkPkg/UnitTestLib: Move print log into cleanup
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2805
If a unit test fails with an exception or an assert, then the
CmockaUnitTestFunctionRunner() is terminated and the logic
that follows the invocation of the unit test is skipped. This
currently skips the logic that prints log messages.
Move the print of log messages to the end of the function
CmockaUnitTestTeardownFunctionRunner() that is guaranteed to
be executed when a unit test completes normally or is
terminated with an exception or an assert.
Cc: Sean Brogan <[email protected]>
Cc: Bret Barkelew <[email protected]>
Cc: Jiewen Yao <[email protected]>
Signed-off-by: Michael D Kinney <[email protected]>
Reviewed-by: Liming Gao <[email protected]>
Reviewed-by: Bret Barkelew <[email protected]>
Commit: 425df6923ec00df32bb6f20d1440a2e920f0e1e7
https://github.com/tianocore/edk2/commit/425df6923ec00df32bb6f20d1440a2e920f0e1e7
Author: Michael D Kinney <[email protected]>
Date: 2020-07-15 (Wed, 15 Jul 2020)
Changed paths:
M UnitTestFrameworkPkg/Library/UnitTestLib/Assert.c
Log Message:
-----------
UnitTestFrameworkPkg/UnitTestLib: Fix target mode log messages
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2806
Update the log messages generated in target mode to use
FileName instead of FunctionName. FunctionName is an empty
string so the log messages generated do not provide enough
information to know the source of a unit test failure.
Using FileName combined with LineNumber provides the
right information to identify the location of a unit test
failure.
Cc: Sean Brogan <[email protected]>
Cc: Bret Barkelew <[email protected]>
Cc: Jiewen Yao <[email protected]>
Signed-off-by: Michael D Kinney <[email protected]>
Reviewed-by: Liming Gao <[email protected]>
Reviewed-by: Bret Barkelew <[email protected]>
Commit: 26824851b041d9e81921ec7ef97220d2a2576157
https://github.com/tianocore/edk2/commit/26824851b041d9e81921ec7ef97220d2a2576157
Author: Michael D Kinney <[email protected]>
Date: 2020-07-15 (Wed, 15 Jul 2020)
Changed paths:
A
UnitTestFrameworkPkg/Library/UnitTestDebugAssertLib/UnitTestDebugAssertLib.c
A
UnitTestFrameworkPkg/Library/UnitTestDebugAssertLib/UnitTestDebugAssertLib.inf
A
UnitTestFrameworkPkg/Library/UnitTestDebugAssertLib/UnitTestDebugAssertLib.uni
M UnitTestFrameworkPkg/Library/UnitTestLib/Assert.c
M UnitTestFrameworkPkg/Library/UnitTestLib/AssertCmocka.c
M UnitTestFrameworkPkg/Library/UnitTestLib/RunTests.c
M
UnitTestFrameworkPkg/Library/UnitTestResultReportLib/UnitTestResultReportLib.c
M UnitTestFrameworkPkg/PrivateInclude/UnitTestFrameworkTypes.h
M UnitTestFrameworkPkg/Test/UnitTestFrameworkPkgHostTest.dsc
M UnitTestFrameworkPkg/UnitTestFrameworkPkg.dsc
M UnitTestFrameworkPkg/UnitTestFrameworkPkgTarget.dsc.inc
Log Message:
-----------
UnitTestFrameworkPkg/UnitTestLib: Add checks for ASSERT()
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 <[email protected]>
Cc: Bret Barkelew <[email protected]>
Cc: Jiewen Yao <[email protected]>
Signed-off-by: Michael D Kinney <[email protected]>
Reviewed-by: Liming Gao <[email protected]>
Reviewed-by: Bret Barkelew <[email protected]>
Commit: 75e92c13541672a3af349067a040b9dda3d4452d
https://github.com/tianocore/edk2/commit/75e92c13541672a3af349067a040b9dda3d4452d
Author: Michael D Kinney <[email protected]>
Date: 2020-07-15 (Wed, 15 Jul 2020)
Changed paths:
M MdePkg/Include/Library/DebugLib.h
Log Message:
-----------
MdePkg/Include: Hook DebugLib _ASSERT() for unit tests
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2801
Update DebugLib.h _ASSERT() macro to check if unit testing
is enabled and call UnitTestDebugAssert() instead of
DebugAssert() so the an ASSERT() condition that is triggered
by a function under test can be handled by the Unit Test
Framework.
If EDKII_UNIT_TEST_FRAMEWORK_ENABLED is not defined, then
the existing DebugLib behavior is preserved.
Cc: Liming Gao <[email protected]>
Cc: Sean Brogan <[email protected]>
Cc: Bret Barkelew <[email protected]>
Cc: Jiewen Yao <[email protected]>
Signed-off-by: Michael D Kinney <[email protected]>
Reviewed-by: Liming Gao <[email protected]>
Commit: 133891b712a9ceda0fbdb9649b559773e4cdc6db
https://github.com/tianocore/edk2/commit/133891b712a9ceda0fbdb9649b559773e4cdc6db
Author: Michael D Kinney <[email protected]>
Date: 2020-07-15 (Wed, 15 Jul 2020)
Changed paths:
M MdePkg/Include/Library/UnitTestLib.h
Log Message:
-----------
MdePkg/Include: Add UT_EXPECT_ASSERT_FAILURE() to UnitTestLib
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2801
Add the UT_EXPECT_ASSERT_FAILURE(FunctionCall, Status) macro
to the UnitTestLib that can be used to check if a function
under test triggers an ASSERT() condition. If an ASSERT()
condition is triggered, then the macro returns. If the
ASSERT() condition is not triggered, then the current unit
test fails with a status of UNIT_TEST_ERROR_TEST_FAILED.
If ASSERT()s are disabled, then this check for ASSERT()
behavior is not possible, and the check is skipped.
The global variable gUnitTestExpectAssertFailureJumpBuffer
is added to the UnitTestLib to save/restore context when
the UT_EXPECT_ASSERT_FAILURE(FunctionCall, Status) macro
is used. The UT_EXPECT_ASSERT_FAILURE() macro uses the
SetJump() service with this global variable. The UnitTestLib
service UnitTestDebugAssert() uses the LongJump() service
with this global to restore context if an ASSERT() is
triggered by the code under test.
Add UnitTestExpectAssertFailure() to the UnitTestLib class.
The UnitTestExpectAssertFailure() is called from the new
UT_EXPECT_ASSERT_FAILURE() macro after the status of this
macro check is known.
Add UnitTestDebugAssert() to the UnitTestLib class. The
UnitTestDebugAssert() service is the same as the DebugLib
DebugAssert() service and is invoked from the DebugLib
_ASSERT() macro if unit testing is enabled. This allows the
Unit Test Framework to know when code under test triggers an
ASSERT() condition.
Cc: Liming Gao <[email protected]>
Cc: Sean Brogan <[email protected]>
Cc: Bret Barkelew <[email protected]>
Cc: Jiewen Yao <[email protected]>
Signed-off-by: Michael D Kinney <[email protected]>
Reviewed-by: Liming Gao <[email protected]>
Commit: 9a6c4ac68e3d9590cf17914e07e929a1f0e7c190
https://github.com/tianocore/edk2/commit/9a6c4ac68e3d9590cf17914e07e929a1f0e7c190
Author: Michael D Kinney <[email protected]>
Date: 2020-07-15 (Wed, 15 Jul 2020)
Changed paths:
M MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf
Log Message:
-----------
MdePkg/Library/BaseStackCheckLib: Fix PCD type in INF
Update INF file to use a [Pcd] section instead of a
[FixedPcd] section. [FixedPcd] should only be used in an
INF file if the source code looks up the PCD value using
the PcdLib FixedPcdGetxx() services. Using [FixedPcd]
forces a platform to configure the PCD to type FixedAtBuild.
In this case, PcdDebugPropertyMask supports PCD types
FixedAtBuild and PatchableInModule. Without this change
any platform that wants to use PcdDebugPropertyMask as
type PatchableInModule breaks the build.
Cc: Liming Gao <[email protected]>
Signed-off-by: Michael D Kinney <[email protected]>
Reviewed-by: Liming Gao <[email protected]>
Commit: 5d29e2d020e8b0ad70f3f766c38429c3bfad0d41
https://github.com/tianocore/edk2/commit/5d29e2d020e8b0ad70f3f766c38429c3bfad0d41
Author: Michael D Kinney <[email protected]>
Date: 2020-07-15 (Wed, 15 Jul 2020)
Changed paths:
M UnitTestFrameworkPkg/Test/UnitTest/Sample/SampleUnitTest/SampleUnitTest.c
M
UnitTestFrameworkPkg/Test/UnitTest/Sample/SampleUnitTest/SampleUnitTestDxe.inf
M
UnitTestFrameworkPkg/Test/UnitTest/Sample/SampleUnitTest/SampleUnitTestHost.inf
M
UnitTestFrameworkPkg/Test/UnitTest/Sample/SampleUnitTest/SampleUnitTestPei.inf
M
UnitTestFrameworkPkg/Test/UnitTest/Sample/SampleUnitTest/SampleUnitTestSmm.inf
M
UnitTestFrameworkPkg/Test/UnitTest/Sample/SampleUnitTest/SampleUnitTestUefiShell.inf
M UnitTestFrameworkPkg/Test/UnitTestFrameworkPkgHostTest.dsc
M UnitTestFrameworkPkg/UnitTestFrameworkPkg.dsc
Log Message:
-----------
UnitTestFramewokPkg/SampleUnitTest: Use UT_EXPECT_ASSERT_FAILURE()
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2801
Add samples for all UnitTestLib macros including using
UT_EXPECT_ASSERT_FAILURE() for positive test cases where an
ASSERT() is triggered and detected correctly.
Additional test cases are added that disable ASSERT()s and
verify that UT_EXPECT_ASSERT_FAILURE() macros are skipped.
Cc: Sean Brogan <[email protected]>
Cc: Bret Barkelew <[email protected]>
Cc: Jiewen Yao <[email protected]>
Signed-off-by: Michael D Kinney <[email protected]>
Reviewed-by: Liming Gao <[email protected]>
Compare: https://github.com/tianocore/edk2/compare/c7195b9ec3c5...5d29e2d020e8
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits