diff options
Diffstat (limited to 'src/VBox/Devices/EFI/Firmware/UnitTestFrameworkPkg/PrivateInclude/Library')
3 files changed, 134 insertions, 0 deletions
diff --git a/src/VBox/Devices/EFI/Firmware/UnitTestFrameworkPkg/PrivateInclude/Library/UnitTestBootLib.h b/src/VBox/Devices/EFI/Firmware/UnitTestFrameworkPkg/PrivateInclude/Library/UnitTestBootLib.h new file mode 100644 index 00000000..0b834d20 --- /dev/null +++ b/src/VBox/Devices/EFI/Firmware/UnitTestFrameworkPkg/PrivateInclude/Library/UnitTestBootLib.h @@ -0,0 +1,31 @@ +/** @file + Provides a library function that can be customized to set the platform to boot + from USB on the next boot. This allows the test framework to reboot back to + USB. Since boot managers are not all the same creating a lib to support + platform customization will make porting to new code base/platform easier. + + Copyright (c) Microsoft Corporation.<BR> + Copyright (c) 2019 - 2020, Intel Corporation. All rights reserved.<BR> + SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#ifndef __UNIT_TEST_BOOT_LIB_H__ +#define __UNIT_TEST_BOOT_LIB_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 + ); + +#endif diff --git a/src/VBox/Devices/EFI/Firmware/UnitTestFrameworkPkg/PrivateInclude/Library/UnitTestPersistenceLib.h b/src/VBox/Devices/EFI/Firmware/UnitTestFrameworkPkg/PrivateInclude/Library/UnitTestPersistenceLib.h new file mode 100644 index 00000000..2bec0b52 --- /dev/null +++ b/src/VBox/Devices/EFI/Firmware/UnitTestFrameworkPkg/PrivateInclude/Library/UnitTestPersistenceLib.h @@ -0,0 +1,76 @@ +/** @file + 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.<BR> + Copyright (c) 2019 - 2020, Intel Corporation. All rights reserved.<BR> + SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#ifndef _UNIT_TEST_PERSISTENCE_LIB_H_ +#define _UNIT_TEST_PERSISTENCE_LIB_H_ + +#include <UnitTestFrameworkTypes.h> + +#define UNIT_TEST_PERSISTENCE_LIB_VERSION 1 + +/** + Determines whether a persistence cache already exists for + the given framework. + + @param[in] FrameworkHandle A pointer to the framework that is being persisted. + + @retval TRUE + @retval FALSE Cache doesn't exist or an error occurred. + +**/ +BOOLEAN +EFIAPI +DoesCacheExist ( + IN UNIT_TEST_FRAMEWORK_HANDLE FrameworkHandle + ); + +/** + 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. + + @param[in] FrameworkHandle A pointer to the framework that is being persisted. + @param[in] SaveData A pointer to the buffer containing the serialized + framework internal state. + + @retval EFI_SUCCESS Data is persisted and the test can be safely quit. + @retval Others Data is not persisted and test cannot be resumed upon exit. + +**/ +EFI_STATUS +EFIAPI +SaveUnitTestCache ( + IN UNIT_TEST_FRAMEWORK_HANDLE FrameworkHandle, + IN UNIT_TEST_SAVE_HEADER *SaveData + ); + +/** + Will retrieve any cached state associated with the given framework. + Will allocate a buffer to hold the loaded data. + + @param[in] FrameworkHandle A pointer to the framework that is being persisted. + @param[in] SaveData A pointer pointer that will be updated with the address + of the loaded data buffer. + + @retval EFI_SUCCESS Data has been loaded successfully and SaveData is updated + with a pointer to the buffer. + @retval Others An error has occurred and no data has been loaded. SaveData + is set to NULL. + +**/ +EFI_STATUS +EFIAPI +LoadUnitTestCache ( + IN UNIT_TEST_FRAMEWORK_HANDLE FrameworkHandle, + OUT UNIT_TEST_SAVE_HEADER **SaveData + ); + +#endif diff --git a/src/VBox/Devices/EFI/Firmware/UnitTestFrameworkPkg/PrivateInclude/Library/UnitTestResultReportLib.h b/src/VBox/Devices/EFI/Firmware/UnitTestFrameworkPkg/PrivateInclude/Library/UnitTestResultReportLib.h new file mode 100644 index 00000000..80d17cb6 --- /dev/null +++ b/src/VBox/Devices/EFI/Firmware/UnitTestFrameworkPkg/PrivateInclude/Library/UnitTestResultReportLib.h @@ -0,0 +1,27 @@ +/** @file + Provides a unit test result report. This allows new result output formats to + be easily customized. + + Copyright (c) Microsoft Corporation.<BR> + Copyright (c) 2019 - 2020, Intel Corporation. All rights reserved.<BR> + SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#ifndef __UNIT_TEST_RESULT_REPORT_LIB_H__ +#define __UNIT_TEST_RESULT_REPORT_LIB_H__ + +#include <UnitTestFrameworkTypes.h> + +/** +Method to produce the Unit Test run results + +@retval Success +**/ +EFI_STATUS +EFIAPI +OutputUnitTestFrameworkReport ( + IN UNIT_TEST_FRAMEWORK_HANDLE FrameworkHandle + ); + +#endif |