summaryrefslogtreecommitdiff
path: root/UnitTestFrameworkPkg/UnitTestFrameworkPkg.dsc
AgeCommit message (Collapse)AuthorFilesLines
2024-02-14UnitTestFrameworkPkg: Add DSC and host tests that always failMichael D Kinney1-0/+26
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4683 Add sample unit tests that always fail or generate unexpected exceptions along with a new DSC file to build the unit tests that always fail or generate unexpected exceptions. This can be used to verify the log information on failures is accurate and provides the correct information to determine the source of the unit test failure. Divide by zero is used to generate unexpected exceptions. The compiler warnings for divide by zero are disables for the unit tests that generate divide by zero exceptions on purpose. These tests are not added to CI because CI would always fail. The UnitTestFrameworkPkg.ci.yaml file is updated to ignore the INF files for host-based testing that always fail. Cc: Michael Kubacki <mikuback@linux.microsoft.com> Cc: Sean Brogan <sean.brogan@microsoft.com> Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Michael Kubacki <michael.kubacki@microsoft.com>
2023-06-13UnitTestFrameworkPkg: Add UnitTestPeiServicesTablePointerLibZhiguang Liu1-0/+1
This library supports a PeiServicesTablePointerLib implementation that allows code dependent upon PeiServicesTable to operate in an isolated execution environment such as within the context of a host-based unit test framework. The unit test should initialize the PeiServicesTable database with any required elements (e.g. PPIs, Hob etc.) prior to the services being invoked by code under test. It is strongly recommended to clean any global databases by using EFI_PEI_SERVICES.ResetSystem2 after every unit test so the tests execute in a predictable manner from a clean state. Cc: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Michael Kubacki <mikuback@linux.microsoft.com> Cc: Sean Brogan <sean.brogan@microsoft.com> Reviewed-by: Ray Ni <ray.ni@intel.com> Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com>
2022-11-07UnitTestFrameworkPkg: Add UnitTestUefiBootServicesTableLibMichael Kubacki1-0/+1
This library supports a Boot Services table library implementation that allows code dependent upon UefiBootServicesTableLib to operate in an isolated execution environment such as within the context of a host-based unit test framework. The unit test should initialize the Boot Services database with any required elements (e.g. protocols, events, handles, etc.) prior to the services being invoked by code under test. It is strongly recommended to clean any global databases (e.g. protocol, event, handles, etc.) after every unit test so the tests execute in a predictable manner from a clean state. This library is being moved here from PrmPkg so it can be made more generally available to other packages and improved upon for others use. Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Sean Brogan <sean.brogan@microsoft.com> Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com> Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
2022-10-14UnitTestFrameworkPkg: Add LOONGARCH64 architecture for EDK2 CI.Chao Li1-1/+2
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4053 Add LOONGARCH64 architecture to UnitTestFramworkPkg for LOONGARCH64 EDK2 CI. Cc: Michael D Kinney <michael.d.kinney@intel.com> Signed-off-by: Chao Li <lichao@loongson.cn> Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
2021-03-31UnitTestFrameworkPkg: Consume MdeLibs.dsc.inc for RegisterFilterLibDandan Bi1-1/+2
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3246 MdeLibs.dsc.inc was added for some basic/default library instances provided by MdePkg and RegisterFilterLibNull Library was also added into it as the first version of MdeLibs.dsc.inc. So update platform dsc to consume MdeLibs.dsc.inc for RegisterFilterLibNull which will be consumed by IoLib and BaseLib. Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Sean Brogan <sean.brogan@microsoft.com> Cc: Bret Barkelew <Bret.Barkelew@microsoft.com> Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> Acked-by: Ard Biesheuvel <ardb@kernel.org>
2020-07-15UnitTestFramewokPkg/SampleUnitTest: Use UT_EXPECT_ASSERT_FAILURE()Michael D Kinney1-0/+3
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 <sean.brogan@microsoft.com> Cc: Bret Barkelew <Bret.Barkelew@microsoft.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2020-07-15UnitTestFrameworkPkg/UnitTestLib: Add checks for ASSERT()Michael D Kinney1-0/+1
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 <sean.brogan@microsoft.com> Cc: Bret Barkelew <Bret.Barkelew@microsoft.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Bret Barkelew <Bret.Barkelew@microsoft.com>
2020-04-03UnitTestFrameworkPkg: Add RISC-V architecture for RISC-V EDK2 CI.Abner Chang1-1/+2
Add RISC-V architecture to UnitTestFrameworkPkg for RISC-V EDK2 CI. BZ:2562: https://bugzilla.tianocore.org/show_bug.cgi?id=2562 Signed-off-by: Abner Chang <abner.chang@hpe.com> Reviewed-by: Bret Barkelew <bret.barkelew@microsoft.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Sean Brogan <sean.brogan@microsoft.com> Cc: Bret Barkelew <Bret.Barkelew@microsoft.com> Cc: Leif Lindholm <leif@nuviainc.com> Cc: Gilbert Chen <gilbert.chen@hpe.com> Cc: Daniel Schaefer <daniel.schaefer@hpe.com>
2020-02-11UnitTestFrameworkPkg: Disable EBC in DSC fileMichael D Kinney1-1/+1
https://bugzilla.tianocore.org/show_bug.cgi?id=2514 Remove EBC as one of the supported architectures in the UnitTestFrameworkPkg DSC file. The EBC compiler does not support vararg macros and the UnitTestLib class uses this feature. Cc: Sean Brogan <sean.brogan@microsoft.com> Cc: Bret Barkelew <Bret.Barkelew@microsoft.com> Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Bret Barkelew <Bret.Barkelew@microsoft.com>
2020-02-07UnitTestFrameworkPkg: Add DSC, DSC INC, and YAML filesMichael D Kinney1-0/+34
https://bugzilla.tianocore.org/show_bug.cgi?id=2505 * DSC in root of package file to perform a package build of the UnitTestFrameworkPkg and build sample unit test for all supported target environments. * DSC file in Test directory to build the sample unit test for the host environment. * UnitTestFrameworkPkgTarget.dsc.inc - DSC include file to !include when building unit tests for target environments. * UnitTestFrameworkPkgHost.dsc.inc - DSC include file to !include when building unit tests for target environments. * YAML file with set of CI checks to perform on UnitTestFrameworkPkg. Cc: Sean Brogan <sean.brogan@microsoft.com> Cc: Bret Barkelew <Bret.Barkelew@microsoft.com> Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Bret Barkelew <Bret.Barkelew@microsoft.com> Reviewed-by: Sean Brogan <sean.brogan@microsoft.com>