From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mx.groups.io with SMTP id smtpd.web09.5869.1667521514298713743 for ; Thu, 03 Nov 2022 17:25:14 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="body hash did not verify" header.i=@linux.microsoft.com header.s=default header.b=a5r0v2wa; spf=pass (domain: linux.microsoft.com, ip: 13.77.154.182, mailfrom: mikuback@linux.microsoft.com) Received: from localhost.localdomain (unknown [47.201.8.94]) by linux.microsoft.com (Postfix) with ESMTPSA id 4F76D205DA45; Thu, 3 Nov 2022 17:25:13 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 4F76D205DA45 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1667521513; bh=HupiFd/hxzCraCBR12SvB4Ky14V20FkbPhknVLiK61U=; h=From:To:Cc:Subject:Date:From; b=a5r0v2waZXKfcrbos5ZYxT69mIvcn/F6Oe3QD7w3z6z8WAv/Y6kpRtAYg5kmkqCGr cH9dygXtbsqLT+oZcq0u0+aoU8pUFwmadCMiyDlesTR2OdNWf3TD405a9Ec+1TQkpb JqKiuAk4ZCCZ0Vk1/xp/A+9F1HYprn8vQlsBYXS8= From: "Michael Kubacki" To: devel@edk2.groups.io Cc: Michael D Kinney , Sean Brogan Subject: [PATCH v1 0/2] UnitTestFrameworkPkg: Add UnitTestUefiBootServicesTableLib Date: Thu, 3 Nov 2022 20:24:38 -0400 Message-Id: <20221104002440.2316-1-mikuback@linux.microsoft.com> X-Mailer: git-send-email 2.28.0.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Michael Kubacki This patch series moves a library that is useful for stubbing UEFI Boot Services from PrmPkg to UnitTestFrameworkPkg. An example of library usage that makes use of mocked protocol interfaces to retain protocol state is here: https://github.com/tianocore/edk2/blob/master/PrmPkg/Library/DxePrmContex= tBufferLib/UnitTest/DxePrmContextBufferLibUnitTest.c Over the last few months, I've had several people contact me about such mocking and I've pointed them to the library instance in PrmPkg. I've also heard they would like to contribute and consider it for use in features outside PrmPkg so I'd like to propose moving the library instance to UnitTestFrameworkPkg so it can be more widely available and accessible for others to improve upon. Cc: Michael D Kinney Cc: Sean Brogan Signed-off-by: Michael Kubacki Michael Kubacki (2): UnitTestFrameworkPkg: Add UnitTestUefiBootServicesTableLib PrmPkg: Use UnitTestFrameworkPkg UEFI BS library PrmPkg/Test/UnitTest/Library/UefiBootServicesTableLibUnitTest/UefiBootSe= rvicesTableLibUnitTest.c =3D> UnitTestFrameworkPkg/Library/UnitTestUefiBo= otServicesTableLib/UnitTestUefiBootServicesTableLib.c = | 4 ++-- PrmPkg/Test/UnitTest/Library/UefiBootServicesTableLibUnitTest/UefiBootSe= rvicesTableLibUnitTestEventTimer.c =3D> UnitTestFrameworkPkg/Library/Unit= TestUefiBootServicesTableLib/UnitTestUefiBootServicesTableLibEventTimer.c= | 2 +- PrmPkg/Test/UnitTest/Library/UefiBootServicesTableLibUnitTest/UefiBootSe= rvicesTableLibUnitTestImage.c =3D> UnitTestFrameworkPkg/Library/UnitTestU= efiBootServicesTableLib/UnitTestUefiBootServicesTableLibImage.c = | 2 +- PrmPkg/Test/UnitTest/Library/UefiBootServicesTableLibUnitTest/UefiBootSe= rvicesTableLibUnitTestMemory.c =3D> UnitTestFrameworkPkg/Library/UnitTest= UefiBootServicesTableLib/UnitTestUefiBootServicesTableLibMemory.c = | 2 +- PrmPkg/Test/UnitTest/Library/UefiBootServicesTableLibUnitTest/UefiBootSe= rvicesTableLibUnitTestMisc.c =3D> UnitTestFrameworkPkg/Library/UnitTestUe= fiBootServicesTableLib/UnitTestUefiBootServicesTableLibMisc.c = | 2 +- PrmPkg/Test/UnitTest/Library/UefiBootServicesTableLibUnitTest/UefiBootSe= rvicesTableLibUnitTestProtocol.c =3D> UnitTestFrameworkPkg/Library/UnitTe= stUefiBootServicesTableLib/UnitTestUefiBootServicesTableLibProtocol.c = | 2 +- PrmPkg/Test/UnitTest/Library/UefiBootServicesTableLibUnitTest/UefiBootSe= rvicesTableLibUnitTestTpl.c =3D> UnitTestFrameworkPkg/Library/UnitTestUef= iBootServicesTableLib/UnitTestUefiBootServicesTableLibTpl.c = | 2 +- PrmPkg/PrmPkg.dsc = = |= 1 - PrmPkg/Test/PrmPkgHostTest.dsc = = |= 6 ----- PrmPkg/Test/UnitTest/Library/UefiBootServicesTableLibUnitTest/UefiBootSe= rvicesTableLibUnitTest.h =3D> UnitTestFrameworkPkg/Library/UnitTestUefiBo= otServicesTableLib/UnitTestUefiBootServicesTableLib.h = | 0 PrmPkg/Test/UnitTest/Library/UefiBootServicesTableLibUnitTest/UefiBootSe= rvicesTableLibUnitTest.inf =3D> UnitTestFrameworkPkg/Library/UnitTestUefi= BootServicesTableLib/UnitTestUefiBootServicesTableLib.inf = | 24 ++++++++++---------- PrmPkg/Test/UnitTest/Library/UefiBootServicesTableLibUnitTest/UefiBootSe= rvicesTableLibTest.uni =3D> UnitTestFrameworkPkg/Library/UnitTestUefiBoot= ServicesTableLib/UnitTestUefiBootServicesTableLib.uni = | 0 PrmPkg/Test/UnitTest/Library/UefiBootServicesTableLibUnitTest/UefiBootSe= rvicesTableLibUnitTestProtocol.h =3D> UnitTestFrameworkPkg/Library/UnitTe= stUefiBootServicesTableLib/UnitTestUefiBootServicesTableLibProtocol.h = | 2 +- UnitTestFrameworkPkg/UnitTestFrameworkPkg.dsc = = |= 1 + UnitTestFrameworkPkg/UnitTestFrameworkPkgHost.dsc.inc = = |= 1 + 15 files changed, 23 insertions(+), 28 deletions(-) rename PrmPkg/Test/UnitTest/Library/UefiBootServicesTableLibUnitTest/Uef= iBootServicesTableLibUnitTest.c =3D> UnitTestFrameworkPkg/Library/UnitTes= tUefiBootServicesTableLib/UnitTestUefiBootServicesTableLib.c (97%) rename PrmPkg/Test/UnitTest/Library/UefiBootServicesTableLibUnitTest/Uef= iBootServicesTableLibUnitTestEventTimer.c =3D> UnitTestFrameworkPkg/Libra= ry/UnitTestUefiBootServicesTableLib/UnitTestUefiBootServicesTableLibEvent= Timer.c (95%) rename PrmPkg/Test/UnitTest/Library/UefiBootServicesTableLibUnitTest/Uef= iBootServicesTableLibUnitTestImage.c =3D> UnitTestFrameworkPkg/Library/Un= itTestUefiBootServicesTableLib/UnitTestUefiBootServicesTableLibImage.c (9= 6%) rename PrmPkg/Test/UnitTest/Library/UefiBootServicesTableLibUnitTest/Uef= iBootServicesTableLibUnitTestMemory.c =3D> UnitTestFrameworkPkg/Library/U= nitTestUefiBootServicesTableLib/UnitTestUefiBootServicesTableLibMemory.c = (96%) rename PrmPkg/Test/UnitTest/Library/UefiBootServicesTableLibUnitTest/Uef= iBootServicesTableLibUnitTestMisc.c =3D> UnitTestFrameworkPkg/Library/Uni= tTestUefiBootServicesTableLib/UnitTestUefiBootServicesTableLibMisc.c (96%= ) rename PrmPkg/Test/UnitTest/Library/UefiBootServicesTableLibUnitTest/Uef= iBootServicesTableLibUnitTestProtocol.c =3D> UnitTestFrameworkPkg/Library= /UnitTestUefiBootServicesTableLib/UnitTestUefiBootServicesTableLibProtoco= l.c (96%) rename PrmPkg/Test/UnitTest/Library/UefiBootServicesTableLibUnitTest/Uef= iBootServicesTableLibUnitTestTpl.c =3D> UnitTestFrameworkPkg/Library/Unit= TestUefiBootServicesTableLib/UnitTestUefiBootServicesTableLibTpl.c (89%) rename PrmPkg/Test/UnitTest/Library/UefiBootServicesTableLibUnitTest/Uef= iBootServicesTableLibUnitTest.h =3D> UnitTestFrameworkPkg/Library/UnitTes= tUefiBootServicesTableLib/UnitTestUefiBootServicesTableLib.h (100%) rename PrmPkg/Test/UnitTest/Library/UefiBootServicesTableLibUnitTest/Uef= iBootServicesTableLibUnitTest.inf =3D> UnitTestFrameworkPkg/Library/UnitT= estUefiBootServicesTableLib/UnitTestUefiBootServicesTableLib.inf (54%) rename PrmPkg/Test/UnitTest/Library/UefiBootServicesTableLibUnitTest/Uef= iBootServicesTableLibTest.uni =3D> UnitTestFrameworkPkg/Library/UnitTestU= efiBootServicesTableLib/UnitTestUefiBootServicesTableLib.uni (100%) rename PrmPkg/Test/UnitTest/Library/UefiBootServicesTableLibUnitTest/Uef= iBootServicesTableLibUnitTestProtocol.h =3D> UnitTestFrameworkPkg/Library= /UnitTestUefiBootServicesTableLib/UnitTestUefiBootServicesTableLibProtoco= l.h (95%) --=20 2.28.0.windows.1