2 This is a sample to demostrate the usage of the Unit Test Library that
3 supports the PEI, DXE, SMM, UEFI SHell, and host execution environments.
5 Copyright (c) Microsoft Corporation.<BR>
6 SPDX-License-Identifier: BSD-2-Clause-Patent
9 #include "TestBaseCryptLib.h"
13 Initialize the unit test framework, suite, and unit tests for the
14 sample unit tests and run the unit tests.
16 @retval EFI_SUCCESS All test cases were dispatched.
17 @retval EFI_OUT_OF_RESOURCES There are not enough resources available to
18 initialize the unit tests.
27 UNIT_TEST_FRAMEWORK_HANDLE Framework
;
29 DEBUG(( DEBUG_INFO
, "%a v%a\n", UNIT_TEST_NAME
, UNIT_TEST_VERSION
));
30 CreateUnitTest(UNIT_TEST_NAME
, UNIT_TEST_VERSION
, &Framework
);
35 Status
= RunAllTestSuites (Framework
);
38 FreeUnitTestFramework (Framework
);
45 Standard PEIM entry point for target based unit test execution from PEI.
50 IN EFI_PEI_FILE_HANDLE FileHandle
,
51 IN CONST EFI_PEI_SERVICES
**PeiServices
54 return UefiTestMain ();
58 Standard UEFI entry point for target based unit test execution from DXE, SMM,
64 IN EFI_HANDLE ImageHandle
,
65 IN EFI_SYSTEM_TABLE
*SystemTable
68 return UefiTestMain ();
72 Standard POSIX C entry point for host based unit test execution.
80 return UefiTestMain ();