UnitTestFrameworkPkg/Library: Add library instances

https://bugzilla.tianocore.org/show_bug.cgi?id=2505

Add the following library instances that are used to
build unit tests for host and target environments.

* CmockaLib with cmocka submodule to:

  https://git.cryptomilk.org/projects/cmocka.git

* DebugLibPosix - Instance of DebugLib based on POSIX
  APIs (e.g. printf).
* MemoryAllocationLibPosix - Instance of MemoryAllocationLib
  based on POSIX APIs (e.g. malloc/free).
* UnitTestBootLibNull - Null instance of the UnitTestBootLib
* UnitTestBootLibUsbClass - UnitTestBootLib instances that
  supports setting boot next to a USB device.
* UnitTestLib - UnitTestLib instance that is designed to work
  with PEI, DXE, SMM, and UEFI Shell target environments.
* UnitTestLibCmocka - UintTestLib instance that uses cmocka
  APIs and can only be use in a host environment.
* UnitTestPersistenceLibNull - Null instance of the
  UnitTestPersistenceLib
* UnitTestPersistenceLibSimpleFileSystem - UnitTestPersistenceLib
  instance that can safe the unit test framework state to a
  media device that supports the UEFI Simple File System
  Protocol.
* UnitTestResultReportLibConOut - UnitTestResultReportLib
  instance that sends report results to the UEFI standard
  output console.
* UnitTestResultReportLibDebugLib - UnitTestResultReportLib
  instance that sends report results to a DebugLib using
  DEBUG() macros.

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>
This commit is contained in:
Michael D Kinney
2020-01-22 10:07:17 -08:00
committed by mergify[bot]
parent 0f7fb5c5e5
commit 0eb522987f
39 changed files with 4693 additions and 0 deletions

View File

@ -0,0 +1,26 @@
/**
NULL implementation for UnitTestBootLib to allow simple compilation
Copyright (c) Microsoft Corporation.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
#include <PiDxe.h>
/**
Set the boot manager to boot from a specific device on the next boot. This
should be set only for the next boot and shouldn't require any manual clean up
@retval EFI_SUCCESS Boot device for next boot was set.
@retval EFI_UNSUPPORTED Setting the boot device for the next boot is not
supportted.
@retval Other Boot device for next boot can not be set.
**/
EFI_STATUS
EFIAPI
SetBootNextDevice(
VOID
)
{
return EFI_UNSUPPORTED;
}

View File

@ -0,0 +1,23 @@
## @file
# NULL library for UnitTestBootUsb
#
# Copyright (c) Microsoft Corporation.<BR>
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
##
[Defines]
INF_VERSION = 0x00010017
BASE_NAME = UnitTestBootLibNull
MODULE_UNI_FILE = UnitTestBootLibNull.uni
FILE_GUID = f143e75d-76e1-4040-b134-8f4f0bd5e3bd
VERSION_STRING = 1.0
MODULE_TYPE = DXE_DRIVER
LIBRARY_CLASS = UnitTestBootLib
[Sources]
UnitTestBootLibNull.c
[Packages]
MdePkg/MdePkg.dec

View File

@ -0,0 +1,11 @@
// /** @file
// NULL library for UnitTestBootUsb
//
// Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>
// SPDX-License-Identifier: BSD-2-Clause-Patent
//
// **/
#string STR_MODULE_ABSTRACT #language en-US "NULL library for UnitTestBootUsb"
#string STR_MODULE_DESCRIPTION #language en-US "NULL library for UnitTestBootUsb."