]> git.proxmox.com Git - mirror_edk2.git/blame - UnitTestFrameworkPkg/Library/UnitTestResultReportLib/UnitTestResultReportLibDebugLib.c
UnitTestFrameworkPkg: Sample unit test hangs when running in OVMF/QEMU
[mirror_edk2.git] / UnitTestFrameworkPkg / Library / UnitTestResultReportLib / UnitTestResultReportLibDebugLib.c
CommitLineData
0eb52298
MK
1/** @file\r
2 Implement UnitTestResultReportLib doing plain txt out to console\r
3\r
4 Copyright (c) Microsoft Corporation.<BR>\r
5 SPDX-License-Identifier: BSD-2-Clause-Patent\r
6**/\r
7\r
8#include <Uefi.h>\r
9#include <Library/BaseLib.h>\r
10#include <Library/PrintLib.h>\r
11#include <Library/DebugLib.h>\r
12\r
13VOID\r
f297b7f2 14EFIAPI\r
0eb52298
MK
15ReportPrint (\r
16 IN CONST CHAR8 *Format,\r
17 ...\r
18 )\r
19{\r
20 VA_LIST Marker;\r
21 CHAR8 String[256];\r
22 UINTN Length;\r
23\r
24 VA_START (Marker, Format);\r
25 Length = AsciiVSPrint (String, sizeof (String), Format, Marker);\r
26 if (Length == 0) {\r
27 DEBUG ((DEBUG_ERROR, "%a formatted string is too long\n", __FUNCTION__));\r
28 } else {\r
29 DEBUG ((DEBUG_INFO, String));\r
30 }\r
31 VA_END (Marker);\r
32}\r
33\r
34VOID\r
35ReportOutput (\r
36 IN CONST CHAR8 *Output\r
37 )\r
38{\r
39 CHAR8 AsciiString[128];\r
40 UINTN Length;\r
41 UINTN Index;\r
42\r
43 Length = AsciiStrLen (Output);\r
44 for (Index = 0; Index < Length; Index += (sizeof (AsciiString) - 1)) {\r
568eee7c 45 AsciiStrnCpyS (AsciiString, sizeof (AsciiString), &Output[Index], sizeof (AsciiString) - 1);\r
0eb52298
MK
46 DEBUG ((DEBUG_INFO, AsciiString));\r
47 }\r
48}\r