2 This header file describes a library that contains functions to save and
3 restore unit test internal state, in case the test needs to pause and resume
4 (eg. a reboot-based test).
6 Copyright (c) Microsoft Corporation.<BR>
7 Copyright (c) 2019 - 2020, Intel Corporation. All rights reserved.<BR>
8 SPDX-License-Identifier: BSD-2-Clause-Patent
12 #ifndef _UNIT_TEST_PERSISTENCE_LIB_H_
13 #define _UNIT_TEST_PERSISTENCE_LIB_H_
15 #include <UnitTestFrameworkTypes.h>
17 #define UNIT_TEST_PERSISTENCE_LIB_VERSION 1
20 Determines whether a persistence cache already exists for
23 @param[in] FrameworkHandle A pointer to the framework that is being persisted.
26 @retval FALSE Cache doesn't exist or an error occurred.
32 IN UNIT_TEST_FRAMEWORK_HANDLE FrameworkHandle
36 Will save the data associated with an internal Unit Test Framework
37 state in a manner that can persist a Unit Test Application quit or
40 @param[in] FrameworkHandle A pointer to the framework that is being persisted.
41 @param[in] SaveData A pointer to the buffer containing the serialized
42 framework internal state.
44 @retval EFI_SUCCESS Data is persisted and the test can be safely quit.
45 @retval Others Data is not persisted and test cannot be resumed upon exit.
51 IN UNIT_TEST_FRAMEWORK_HANDLE FrameworkHandle
,
52 IN UNIT_TEST_SAVE_HEADER
*SaveData
56 Will retrieve any cached state associated with the given framework.
57 Will allocate a buffer to hold the loaded data.
59 @param[in] FrameworkHandle A pointer to the framework that is being persisted.
60 @param[in] SaveData A pointer pointer that will be updated with the address
61 of the loaded data buffer.
63 @retval EFI_SUCCESS Data has been loaded successfully and SaveData is updated
64 with a pointer to the buffer.
65 @retval Others An error has occurred and no data has been loaded. SaveData
72 IN UNIT_TEST_FRAMEWORK_HANDLE FrameworkHandle
,
73 OUT UNIT_TEST_SAVE_HEADER
**SaveData