TianoCore EDK2 master
|
#include <Library/UnitTestLib.h>
Go to the source code of this file.
Macros | |
#define | UNIT_TEST_PERSISTENCE_LIB_VERSION 1 |
Functions | |
BOOLEAN EFIAPI | DoesCacheExist (IN UNIT_TEST_FRAMEWORK_HANDLE FrameworkHandle) |
EFI_STATUS EFIAPI | SaveUnitTestCache (IN UNIT_TEST_FRAMEWORK_HANDLE FrameworkHandle, IN VOID *SaveData, IN UINTN SaveStateSize) |
EFI_STATUS EFIAPI | LoadUnitTestCache (IN UNIT_TEST_FRAMEWORK_HANDLE FrameworkHandle, OUT VOID **SaveData, OUT UINTN *SaveStateSize) |
This header file describes a library that contains functions to save and restore unit test internal state, in case the test needs to pause and resume (eg. a reboot-based test).
Copyright (c) Microsoft Corporation.
Copyright (c) 2019 - 2022, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file UnitTestPersistenceLib.h.
#define UNIT_TEST_PERSISTENCE_LIB_VERSION 1 |
Definition at line 17 of file UnitTestPersistenceLib.h.
BOOLEAN EFIAPI DoesCacheExist | ( | IN UNIT_TEST_FRAMEWORK_HANDLE | FrameworkHandle | ) |
Determines whether a persistence cache already exists for the given framework.
[in] | FrameworkHandle | A pointer to the framework that is being persisted. |
TRUE | |
FALSE | Cache doesn't exist or an error occurred. |
Definition at line 24 of file UnitTestPersistenceLibNull.c.
EFI_STATUS EFIAPI LoadUnitTestCache | ( | IN UNIT_TEST_FRAMEWORK_HANDLE | FrameworkHandle, |
OUT VOID ** | SaveData, | ||
OUT UINTN * | SaveStateSize | ||
) |
Will retrieve any cached state associated with the given framework. Will allocate a buffer to hold the loaded data.
[in] | FrameworkHandle | A pointer to the framework that is being persisted. |
[out] | SaveData | A pointer pointer that will be updated with the address of the loaded data buffer. |
[out] | SaveStateSize | Return the size of SaveData in bytes. |
EFI_SUCCESS | Data has been loaded successfully and SaveData is updated with a pointer to the buffer. |
Others | An error has occurred and no data has been loaded. SaveData is set to NULL. |
Definition at line 73 of file UnitTestPersistenceLibNull.c.
EFI_STATUS EFIAPI SaveUnitTestCache | ( | IN UNIT_TEST_FRAMEWORK_HANDLE | FrameworkHandle, |
IN VOID * | SaveData, | ||
IN UINTN | SaveStateSize | ||
) |
Will save the data associated with an internal Unit Test Framework state in a manner that can persist a Unit Test Application quit or even a system reboot.
[in] | FrameworkHandle | A pointer to the framework that is being persisted. |
[in] | SaveData | A pointer to the buffer containing the serialized framework internal state. |
[in] | SaveStateSize | The size of SaveData in bytes. |
EFI_SUCCESS | Data is persisted and the test can be safely quit. |
Others | Data is not persisted and test cannot be resumed upon exit. |
Definition at line 47 of file UnitTestPersistenceLibNull.c.