* [Patch 1/1] UnitTestFrameworkPkg: Library classes private to public
@ 2022-11-30 21:19 Michael D Kinney
2022-11-30 23:02 ` [edk2-devel] " Michael Kubacki
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Michael D Kinney @ 2022-11-30 21:19 UTC (permalink / raw)
To: devel; +Cc: Michael Kubacki, Sean Brogan, Ray Ni, Zhiguang Liu
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4178
* Change GoogleTestLib class from private to public.
* Change UnitTestPersistenceLib class from private to public.
Cc: Michael Kubacki <mikuback@linux.microsoft.com>
Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Zhiguang Liu <zhiguang.liu@intel.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
---
.../Library/UnitTestPersistenceLib.h | 0
UnitTestFrameworkPkg/UnitTestFrameworkPkg.dec | 13 +++++++------
2 files changed, 7 insertions(+), 6 deletions(-)
rename UnitTestFrameworkPkg/{PrivateInclude => Include}/Library/UnitTestPersistenceLib.h (100%)
diff --git a/UnitTestFrameworkPkg/PrivateInclude/Library/UnitTestPersistenceLib.h b/UnitTestFrameworkPkg/Include/Library/UnitTestPersistenceLib.h
similarity index 100%
rename from UnitTestFrameworkPkg/PrivateInclude/Library/UnitTestPersistenceLib.h
rename to UnitTestFrameworkPkg/Include/Library/UnitTestPersistenceLib.h
diff --git a/UnitTestFrameworkPkg/UnitTestFrameworkPkg.dec b/UnitTestFrameworkPkg/UnitTestFrameworkPkg.dec
index ed12f32009d8..14e387d63a0f 100644
--- a/UnitTestFrameworkPkg/UnitTestFrameworkPkg.dec
+++ b/UnitTestFrameworkPkg/UnitTestFrameworkPkg.dec
@@ -26,11 +26,16 @@ [Includes.Common.Private]
Library/CmockaLib/cmocka/include/cmockery
Library/GoogleTestLib/googletest/googletest
-[LibraryClasses.Common.Private]
+[LibraryClasses]
## @libraryclass Allows save and restore unit test internal state
#
- UnitTestPersistenceLib|PrivateInclude/Library/UnitTestPersistenceLib.h
+ UnitTestPersistenceLib|Include/Library/UnitTestPersistenceLib.h
+ ## @libraryclass GoogleTest infrastructure
+ #
+ GoogleTestLib|Include/Library/GoogleTestLib.h
+
+[LibraryClasses.Common.Private]
## @libraryclass Provides a unit test result report
#
UnitTestResultReportLib|PrivateInclude/Library/UnitTestResultReportLib.h
@@ -39,10 +44,6 @@ [LibraryClasses.Common.Private]
#
UnitTestBootLib|PrivateInclude/Library/UnitTestBootLib.h
- ## @libraryclass GoogleTest infrastructure
- #
- GoogleTestLib|Include/Library/GoogleTestLib.h
-
[Guids]
gUnitTestFrameworkPkgTokenSpaceGuid = { 0x833d3aba, 0x39b4, 0x43a2, { 0xb9, 0x30, 0x7a, 0x34, 0x53, 0x39, 0x31, 0xb3 } }
--
2.37.1.windows.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [edk2-devel] [Patch 1/1] UnitTestFrameworkPkg: Library classes private to public
2022-11-30 21:19 [Patch 1/1] UnitTestFrameworkPkg: Library classes private to public Michael D Kinney
@ 2022-11-30 23:02 ` Michael Kubacki
2022-12-01 2:17 ` Ni, Ray
2022-12-05 7:44 ` Zhiguang Liu
2 siblings, 0 replies; 7+ messages in thread
From: Michael Kubacki @ 2022-11-30 23:02 UTC (permalink / raw)
To: devel, michael.d.kinney; +Cc: Sean Brogan, Ray Ni, Zhiguang Liu
Reviewed-by: Michael Kubacki <michael.kubacki@microsoft.com>
On 11/30/2022 4:19 PM, Michael D Kinney wrote:
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4178
>
> * Change GoogleTestLib class from private to public.
> * Change UnitTestPersistenceLib class from private to public.
>
> Cc: Michael Kubacki <mikuback@linux.microsoft.com>
> Cc: Sean Brogan <sean.brogan@microsoft.com>
> Cc: Ray Ni <ray.ni@intel.com>
> Cc: Zhiguang Liu <zhiguang.liu@intel.com>
> Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
> ---
> .../Library/UnitTestPersistenceLib.h | 0
> UnitTestFrameworkPkg/UnitTestFrameworkPkg.dec | 13 +++++++------
> 2 files changed, 7 insertions(+), 6 deletions(-)
> rename UnitTestFrameworkPkg/{PrivateInclude => Include}/Library/UnitTestPersistenceLib.h (100%)
>
> diff --git a/UnitTestFrameworkPkg/PrivateInclude/Library/UnitTestPersistenceLib.h b/UnitTestFrameworkPkg/Include/Library/UnitTestPersistenceLib.h
> similarity index 100%
> rename from UnitTestFrameworkPkg/PrivateInclude/Library/UnitTestPersistenceLib.h
> rename to UnitTestFrameworkPkg/Include/Library/UnitTestPersistenceLib.h
> diff --git a/UnitTestFrameworkPkg/UnitTestFrameworkPkg.dec b/UnitTestFrameworkPkg/UnitTestFrameworkPkg.dec
> index ed12f32009d8..14e387d63a0f 100644
> --- a/UnitTestFrameworkPkg/UnitTestFrameworkPkg.dec
> +++ b/UnitTestFrameworkPkg/UnitTestFrameworkPkg.dec
> @@ -26,11 +26,16 @@ [Includes.Common.Private]
> Library/CmockaLib/cmocka/include/cmockery
> Library/GoogleTestLib/googletest/googletest
>
> -[LibraryClasses.Common.Private]
> +[LibraryClasses]
> ## @libraryclass Allows save and restore unit test internal state
> #
> - UnitTestPersistenceLib|PrivateInclude/Library/UnitTestPersistenceLib.h
> + UnitTestPersistenceLib|Include/Library/UnitTestPersistenceLib.h
>
> + ## @libraryclass GoogleTest infrastructure
> + #
> + GoogleTestLib|Include/Library/GoogleTestLib.h
> +
> +[LibraryClasses.Common.Private]
> ## @libraryclass Provides a unit test result report
> #
> UnitTestResultReportLib|PrivateInclude/Library/UnitTestResultReportLib.h
> @@ -39,10 +44,6 @@ [LibraryClasses.Common.Private]
> #
> UnitTestBootLib|PrivateInclude/Library/UnitTestBootLib.h
>
> - ## @libraryclass GoogleTest infrastructure
> - #
> - GoogleTestLib|Include/Library/GoogleTestLib.h
> -
> [Guids]
> gUnitTestFrameworkPkgTokenSpaceGuid = { 0x833d3aba, 0x39b4, 0x43a2, { 0xb9, 0x30, 0x7a, 0x34, 0x53, 0x39, 0x31, 0xb3 } }
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Patch 1/1] UnitTestFrameworkPkg: Library classes private to public
2022-11-30 21:19 [Patch 1/1] UnitTestFrameworkPkg: Library classes private to public Michael D Kinney
2022-11-30 23:02 ` [edk2-devel] " Michael Kubacki
@ 2022-12-01 2:17 ` Ni, Ray
2022-12-05 7:44 ` Zhiguang Liu
2 siblings, 0 replies; 7+ messages in thread
From: Ni, Ray @ 2022-12-01 2:17 UTC (permalink / raw)
To: Kinney, Michael D, devel@edk2.groups.io
Cc: Michael Kubacki, Sean Brogan, Liu, Zhiguang
Reviewed-by: Ray Ni <ray.ni@intel.com>
> -----Original Message-----
> From: Kinney, Michael D <michael.d.kinney@intel.com>
> Sent: Thursday, December 1, 2022 5:20 AM
> To: devel@edk2.groups.io
> Cc: Michael Kubacki <mikuback@linux.microsoft.com>; Sean Brogan
> <sean.brogan@microsoft.com>; Ni, Ray <ray.ni@intel.com>; Liu, Zhiguang
> <zhiguang.liu@intel.com>
> Subject: [Patch 1/1] UnitTestFrameworkPkg: Library classes private to public
>
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4178
>
> * Change GoogleTestLib class from private to public.
> * Change UnitTestPersistenceLib class from private to public.
>
> Cc: Michael Kubacki <mikuback@linux.microsoft.com>
> Cc: Sean Brogan <sean.brogan@microsoft.com>
> Cc: Ray Ni <ray.ni@intel.com>
> Cc: Zhiguang Liu <zhiguang.liu@intel.com>
> Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
> ---
> .../Library/UnitTestPersistenceLib.h | 0
> UnitTestFrameworkPkg/UnitTestFrameworkPkg.dec | 13 +++++++------
> 2 files changed, 7 insertions(+), 6 deletions(-)
> rename UnitTestFrameworkPkg/{PrivateInclude =>
> Include}/Library/UnitTestPersistenceLib.h (100%)
>
> diff --git
> a/UnitTestFrameworkPkg/PrivateInclude/Library/UnitTestPersistenceLib.h
> b/UnitTestFrameworkPkg/Include/Library/UnitTestPersistenceLib.h
> similarity index 100%
> rename from
> UnitTestFrameworkPkg/PrivateInclude/Library/UnitTestPersistenceLib.h
> rename to UnitTestFrameworkPkg/Include/Library/UnitTestPersistenceLib.h
> diff --git a/UnitTestFrameworkPkg/UnitTestFrameworkPkg.dec
> b/UnitTestFrameworkPkg/UnitTestFrameworkPkg.dec
> index ed12f32009d8..14e387d63a0f 100644
> --- a/UnitTestFrameworkPkg/UnitTestFrameworkPkg.dec
> +++ b/UnitTestFrameworkPkg/UnitTestFrameworkPkg.dec
> @@ -26,11 +26,16 @@ [Includes.Common.Private]
> Library/CmockaLib/cmocka/include/cmockery
> Library/GoogleTestLib/googletest/googletest
>
> -[LibraryClasses.Common.Private]
> +[LibraryClasses]
> ## @libraryclass Allows save and restore unit test internal state
> #
> - UnitTestPersistenceLib|PrivateInclude/Library/UnitTestPersistenceLib.h
> + UnitTestPersistenceLib|Include/Library/UnitTestPersistenceLib.h
>
> + ## @libraryclass GoogleTest infrastructure
> + #
> + GoogleTestLib|Include/Library/GoogleTestLib.h
> +
> +[LibraryClasses.Common.Private]
> ## @libraryclass Provides a unit test result report
> #
> UnitTestResultReportLib|PrivateInclude/Library/UnitTestResultReportLib.h
> @@ -39,10 +44,6 @@ [LibraryClasses.Common.Private]
> #
> UnitTestBootLib|PrivateInclude/Library/UnitTestBootLib.h
>
> - ## @libraryclass GoogleTest infrastructure
> - #
> - GoogleTestLib|Include/Library/GoogleTestLib.h
> -
> [Guids]
> gUnitTestFrameworkPkgTokenSpaceGuid = { 0x833d3aba, 0x39b4, 0x43a2,
> { 0xb9, 0x30, 0x7a, 0x34, 0x53, 0x39, 0x31, 0xb3 } }
>
> --
> 2.37.1.windows.1
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Patch 1/1] UnitTestFrameworkPkg: Library classes private to public
2022-11-30 21:19 [Patch 1/1] UnitTestFrameworkPkg: Library classes private to public Michael D Kinney
2022-11-30 23:02 ` [edk2-devel] " Michael Kubacki
2022-12-01 2:17 ` Ni, Ray
@ 2022-12-05 7:44 ` Zhiguang Liu
2022-12-05 7:54 ` Zhiguang Liu
2 siblings, 1 reply; 7+ messages in thread
From: Zhiguang Liu @ 2022-12-05 7:44 UTC (permalink / raw)
To: Kinney, Michael D, devel@edk2.groups.io
Cc: Michael Kubacki, Sean Brogan, Ni, Ray
Hi Mike,
Thanks for the patch.
One comment is that UnitTestPersistenceLib depends on a struct definition UNIT_TEST_SAVE_HEADER, which is defined in private headers.
Do you think it is ok to also move it into UnitTestPersistenceLib.h?
Or what we really need from the struct in UnitTestPersistenceLib is the SaveStateSize, we can define a new public struct UNIT_TEST_SAVE_HEADER_PUBLIC to only contains the needed fields, like
typedef struct {
UINT8 Version;
UINT32 SaveStateSize; // Size of the entire serialized buffer.
UINT8 RawData[];
} UNIT_TEST_SAVE_HEADER;
Thanks
Zhiguang
> -----Original Message-----
> From: Kinney, Michael D <michael.d.kinney@intel.com>
> Sent: Thursday, December 1, 2022 5:20 AM
> To: devel@edk2.groups.io
> Cc: Michael Kubacki <mikuback@linux.microsoft.com>; Sean Brogan
> <sean.brogan@microsoft.com>; Ni, Ray <ray.ni@intel.com>; Liu, Zhiguang
> <zhiguang.liu@intel.com>
> Subject: [Patch 1/1] UnitTestFrameworkPkg: Library classes private to public
>
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4178
>
> * Change GoogleTestLib class from private to public.
> * Change UnitTestPersistenceLib class from private to public.
>
> Cc: Michael Kubacki <mikuback@linux.microsoft.com>
> Cc: Sean Brogan <sean.brogan@microsoft.com>
> Cc: Ray Ni <ray.ni@intel.com>
> Cc: Zhiguang Liu <zhiguang.liu@intel.com>
> Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
> ---
> .../Library/UnitTestPersistenceLib.h | 0
> UnitTestFrameworkPkg/UnitTestFrameworkPkg.dec | 13 +++++++------
> 2 files changed, 7 insertions(+), 6 deletions(-) rename
> UnitTestFrameworkPkg/{PrivateInclude =>
> Include}/Library/UnitTestPersistenceLib.h (100%)
>
> diff --git
> a/UnitTestFrameworkPkg/PrivateInclude/Library/UnitTestPersistenceLib.h
> b/UnitTestFrameworkPkg/Include/Library/UnitTestPersistenceLib.h
> similarity index 100%
> rename from
> UnitTestFrameworkPkg/PrivateInclude/Library/UnitTestPersistenceLib.h
> rename to UnitTestFrameworkPkg/Include/Library/UnitTestPersistenceLib.h
> diff --git a/UnitTestFrameworkPkg/UnitTestFrameworkPkg.dec
> b/UnitTestFrameworkPkg/UnitTestFrameworkPkg.dec
> index ed12f32009d8..14e387d63a0f 100644
> --- a/UnitTestFrameworkPkg/UnitTestFrameworkPkg.dec
> +++ b/UnitTestFrameworkPkg/UnitTestFrameworkPkg.dec
> @@ -26,11 +26,16 @@ [Includes.Common.Private]
> Library/CmockaLib/cmocka/include/cmockery
> Library/GoogleTestLib/googletest/googletest
>
> -[LibraryClasses.Common.Private]
> +[LibraryClasses]
> ## @libraryclass Allows save and restore unit test internal state
> #
> - UnitTestPersistenceLib|PrivateInclude/Library/UnitTestPersistenceLib.h
> + UnitTestPersistenceLib|Include/Library/UnitTestPersistenceLib.h
>
> + ## @libraryclass GoogleTest infrastructure #
> + GoogleTestLib|Include/Library/GoogleTestLib.h
> +
> +[LibraryClasses.Common.Private]
> ## @libraryclass Provides a unit test result report
> #
> UnitTestResultReportLib|PrivateInclude/Library/UnitTestResultReportLib.h
> @@ -39,10 +44,6 @@ [LibraryClasses.Common.Private]
> #
> UnitTestBootLib|PrivateInclude/Library/UnitTestBootLib.h
>
> - ## @libraryclass GoogleTest infrastructure
> - #
> - GoogleTestLib|Include/Library/GoogleTestLib.h
> -
> [Guids]
> gUnitTestFrameworkPkgTokenSpaceGuid = { 0x833d3aba, 0x39b4, 0x43a2,
> { 0xb9, 0x30, 0x7a, 0x34, 0x53, 0x39, 0x31, 0xb3 } }
>
> --
> 2.37.1.windows.1
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Patch 1/1] UnitTestFrameworkPkg: Library classes private to public
2022-12-05 7:44 ` Zhiguang Liu
@ 2022-12-05 7:54 ` Zhiguang Liu
2022-12-05 18:18 ` Michael D Kinney
0 siblings, 1 reply; 7+ messages in thread
From: Zhiguang Liu @ 2022-12-05 7:54 UTC (permalink / raw)
To: Kinney, Michael D, devel@edk2.groups.io
Cc: Michael Kubacki, Sean Brogan, Ni, Ray
Another suggestion from Ray is to change the API adding a new parameter(size), so we can avoid using the UNIT_TEST_SAVE_HEADER struct.
EFI_STATUS
EFIAPI
SaveUnitTestCache (
IN UNIT_TEST_FRAMEWORK_HANDLE FrameworkHandle,
IN VOID *SaveData,
IN UINTN Size
);
Thanks
Zhiguang
> -----Original Message-----
> From: Liu, Zhiguang
> Sent: Monday, December 5, 2022 3:44 PM
> To: Kinney, Michael D <michael.d.kinney@intel.com>; devel@edk2.groups.io
> Cc: Michael Kubacki <mikuback@linux.microsoft.com>; Sean Brogan
> <sean.brogan@microsoft.com>; Ni, Ray <ray.ni@intel.com>
> Subject: RE: [Patch 1/1] UnitTestFrameworkPkg: Library classes private to
> public
>
> Hi Mike,
> Thanks for the patch.
> One comment is that UnitTestPersistenceLib depends on a struct definition
> UNIT_TEST_SAVE_HEADER, which is defined in private headers.
> Do you think it is ok to also move it into UnitTestPersistenceLib.h?
> Or what we really need from the struct in UnitTestPersistenceLib is the
> SaveStateSize, we can define a new public struct
> UNIT_TEST_SAVE_HEADER_PUBLIC to only contains the needed fields, like
>
> typedef struct {
> UINT8 Version;
> UINT32 SaveStateSize; // Size of the entire serialized buffer.
> UINT8 RawData[];
> } UNIT_TEST_SAVE_HEADER;
>
> Thanks
> Zhiguang
>
> > -----Original Message-----
> > From: Kinney, Michael D <michael.d.kinney@intel.com>
> > Sent: Thursday, December 1, 2022 5:20 AM
> > To: devel@edk2.groups.io
> > Cc: Michael Kubacki <mikuback@linux.microsoft.com>; Sean Brogan
> > <sean.brogan@microsoft.com>; Ni, Ray <ray.ni@intel.com>; Liu, Zhiguang
> > <zhiguang.liu@intel.com>
> > Subject: [Patch 1/1] UnitTestFrameworkPkg: Library classes private to
> > public
> >
> > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4178
> >
> > * Change GoogleTestLib class from private to public.
> > * Change UnitTestPersistenceLib class from private to public.
> >
> > Cc: Michael Kubacki <mikuback@linux.microsoft.com>
> > Cc: Sean Brogan <sean.brogan@microsoft.com>
> > Cc: Ray Ni <ray.ni@intel.com>
> > Cc: Zhiguang Liu <zhiguang.liu@intel.com>
> > Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
> > ---
> > .../Library/UnitTestPersistenceLib.h | 0
> > UnitTestFrameworkPkg/UnitTestFrameworkPkg.dec | 13 +++++++------
> > 2 files changed, 7 insertions(+), 6 deletions(-) rename
> > UnitTestFrameworkPkg/{PrivateInclude =>
> > Include}/Library/UnitTestPersistenceLib.h (100%)
> >
> > diff --git
> > a/UnitTestFrameworkPkg/PrivateInclude/Library/UnitTestPersistenceLib.h
> > b/UnitTestFrameworkPkg/Include/Library/UnitTestPersistenceLib.h
> > similarity index 100%
> > rename from
> > UnitTestFrameworkPkg/PrivateInclude/Library/UnitTestPersistenceLib.h
> > rename to
> > UnitTestFrameworkPkg/Include/Library/UnitTestPersistenceLib.h
> > diff --git a/UnitTestFrameworkPkg/UnitTestFrameworkPkg.dec
> > b/UnitTestFrameworkPkg/UnitTestFrameworkPkg.dec
> > index ed12f32009d8..14e387d63a0f 100644
> > --- a/UnitTestFrameworkPkg/UnitTestFrameworkPkg.dec
> > +++ b/UnitTestFrameworkPkg/UnitTestFrameworkPkg.dec
> > @@ -26,11 +26,16 @@ [Includes.Common.Private]
> > Library/CmockaLib/cmocka/include/cmockery
> > Library/GoogleTestLib/googletest/googletest
> >
> > -[LibraryClasses.Common.Private]
> > +[LibraryClasses]
> > ## @libraryclass Allows save and restore unit test internal state
> > #
> > -
> > UnitTestPersistenceLib|PrivateInclude/Library/UnitTestPersistenceLib.h
> > + UnitTestPersistenceLib|Include/Library/UnitTestPersistenceLib.h
> >
> > + ## @libraryclass GoogleTest infrastructure #
> > + GoogleTestLib|Include/Library/GoogleTestLib.h
> > +
> > +[LibraryClasses.Common.Private]
> > ## @libraryclass Provides a unit test result report
> > #
> >
> > UnitTestResultReportLib|PrivateInclude/Library/UnitTestResultReportLib
> > .h @@ -39,10 +44,6 @@ [LibraryClasses.Common.Private]
> > #
> > UnitTestBootLib|PrivateInclude/Library/UnitTestBootLib.h
> >
> > - ## @libraryclass GoogleTest infrastructure
> > - #
> > - GoogleTestLib|Include/Library/GoogleTestLib.h
> > -
> > [Guids]
> > gUnitTestFrameworkPkgTokenSpaceGuid = { 0x833d3aba, 0x39b4, 0x43a2,
> > { 0xb9, 0x30, 0x7a, 0x34, 0x53, 0x39, 0x31, 0xb3 } }
> >
> > --
> > 2.37.1.windows.1
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Patch 1/1] UnitTestFrameworkPkg: Library classes private to public
2022-12-05 7:54 ` Zhiguang Liu
@ 2022-12-05 18:18 ` Michael D Kinney
2022-12-06 1:31 ` Zhiguang Liu
0 siblings, 1 reply; 7+ messages in thread
From: Michael D Kinney @ 2022-12-05 18:18 UTC (permalink / raw)
To: Liu, Zhiguang, devel@edk2.groups.io, Kinney, Michael D
Cc: Michael Kubacki, Sean Brogan, Ni, Ray
Zhiguang,
This would be a non-backwards compatible change to this API.
But since this has been a private API, I think we can easily accommodate a change
like this if we do it right now and make sure the UnitTestFrameworkPkg implementations
are updated in same patch series.
Can you please put together a patch series with this proposed API change for review
and enter a BZ with the request as well.
Thanks,
Mike
> -----Original Message-----
> From: Liu, Zhiguang <zhiguang.liu@intel.com>
> Sent: Sunday, December 4, 2022 11:55 PM
> To: Kinney, Michael D <michael.d.kinney@intel.com>; devel@edk2.groups.io
> Cc: Michael Kubacki <mikuback@linux.microsoft.com>; Sean Brogan <sean.brogan@microsoft.com>; Ni, Ray <ray.ni@intel.com>
> Subject: RE: [Patch 1/1] UnitTestFrameworkPkg: Library classes private to public
>
> Another suggestion from Ray is to change the API adding a new parameter(size), so we can avoid using the UNIT_TEST_SAVE_HEADER
> struct.
>
> EFI_STATUS
> EFIAPI
> SaveUnitTestCache (
> IN UNIT_TEST_FRAMEWORK_HANDLE FrameworkHandle,
> IN VOID *SaveData,
> IN UINTN Size
> );
>
> Thanks
> Zhiguang
>
> > -----Original Message-----
> > From: Liu, Zhiguang
> > Sent: Monday, December 5, 2022 3:44 PM
> > To: Kinney, Michael D <michael.d.kinney@intel.com>; devel@edk2.groups.io
> > Cc: Michael Kubacki <mikuback@linux.microsoft.com>; Sean Brogan
> > <sean.brogan@microsoft.com>; Ni, Ray <ray.ni@intel.com>
> > Subject: RE: [Patch 1/1] UnitTestFrameworkPkg: Library classes private to
> > public
> >
> > Hi Mike,
> > Thanks for the patch.
> > One comment is that UnitTestPersistenceLib depends on a struct definition
> > UNIT_TEST_SAVE_HEADER, which is defined in private headers.
> > Do you think it is ok to also move it into UnitTestPersistenceLib.h?
> > Or what we really need from the struct in UnitTestPersistenceLib is the
> > SaveStateSize, we can define a new public struct
> > UNIT_TEST_SAVE_HEADER_PUBLIC to only contains the needed fields, like
> >
> > typedef struct {
> > UINT8 Version;
> > UINT32 SaveStateSize; // Size of the entire serialized buffer.
> > UINT8 RawData[];
> > } UNIT_TEST_SAVE_HEADER;
> >
> > Thanks
> > Zhiguang
> >
> > > -----Original Message-----
> > > From: Kinney, Michael D <michael.d.kinney@intel.com>
> > > Sent: Thursday, December 1, 2022 5:20 AM
> > > To: devel@edk2.groups.io
> > > Cc: Michael Kubacki <mikuback@linux.microsoft.com>; Sean Brogan
> > > <sean.brogan@microsoft.com>; Ni, Ray <ray.ni@intel.com>; Liu, Zhiguang
> > > <zhiguang.liu@intel.com>
> > > Subject: [Patch 1/1] UnitTestFrameworkPkg: Library classes private to
> > > public
> > >
> > > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4178
> > >
> > > * Change GoogleTestLib class from private to public.
> > > * Change UnitTestPersistenceLib class from private to public.
> > >
> > > Cc: Michael Kubacki <mikuback@linux.microsoft.com>
> > > Cc: Sean Brogan <sean.brogan@microsoft.com>
> > > Cc: Ray Ni <ray.ni@intel.com>
> > > Cc: Zhiguang Liu <zhiguang.liu@intel.com>
> > > Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
> > > ---
> > > .../Library/UnitTestPersistenceLib.h | 0
> > > UnitTestFrameworkPkg/UnitTestFrameworkPkg.dec | 13 +++++++------
> > > 2 files changed, 7 insertions(+), 6 deletions(-) rename
> > > UnitTestFrameworkPkg/{PrivateInclude =>
> > > Include}/Library/UnitTestPersistenceLib.h (100%)
> > >
> > > diff --git
> > > a/UnitTestFrameworkPkg/PrivateInclude/Library/UnitTestPersistenceLib.h
> > > b/UnitTestFrameworkPkg/Include/Library/UnitTestPersistenceLib.h
> > > similarity index 100%
> > > rename from
> > > UnitTestFrameworkPkg/PrivateInclude/Library/UnitTestPersistenceLib.h
> > > rename to
> > > UnitTestFrameworkPkg/Include/Library/UnitTestPersistenceLib.h
> > > diff --git a/UnitTestFrameworkPkg/UnitTestFrameworkPkg.dec
> > > b/UnitTestFrameworkPkg/UnitTestFrameworkPkg.dec
> > > index ed12f32009d8..14e387d63a0f 100644
> > > --- a/UnitTestFrameworkPkg/UnitTestFrameworkPkg.dec
> > > +++ b/UnitTestFrameworkPkg/UnitTestFrameworkPkg.dec
> > > @@ -26,11 +26,16 @@ [Includes.Common.Private]
> > > Library/CmockaLib/cmocka/include/cmockery
> > > Library/GoogleTestLib/googletest/googletest
> > >
> > > -[LibraryClasses.Common.Private]
> > > +[LibraryClasses]
> > > ## @libraryclass Allows save and restore unit test internal state
> > > #
> > > -
> > > UnitTestPersistenceLib|PrivateInclude/Library/UnitTestPersistenceLib.h
> > > + UnitTestPersistenceLib|Include/Library/UnitTestPersistenceLib.h
> > >
> > > + ## @libraryclass GoogleTest infrastructure #
> > > + GoogleTestLib|Include/Library/GoogleTestLib.h
> > > +
> > > +[LibraryClasses.Common.Private]
> > > ## @libraryclass Provides a unit test result report
> > > #
> > >
> > > UnitTestResultReportLib|PrivateInclude/Library/UnitTestResultReportLib
> > > .h @@ -39,10 +44,6 @@ [LibraryClasses.Common.Private]
> > > #
> > > UnitTestBootLib|PrivateInclude/Library/UnitTestBootLib.h
> > >
> > > - ## @libraryclass GoogleTest infrastructure
> > > - #
> > > - GoogleTestLib|Include/Library/GoogleTestLib.h
> > > -
> > > [Guids]
> > > gUnitTestFrameworkPkgTokenSpaceGuid = { 0x833d3aba, 0x39b4, 0x43a2,
> > > { 0xb9, 0x30, 0x7a, 0x34, 0x53, 0x39, 0x31, 0xb3 } }
> > >
> > > --
> > > 2.37.1.windows.1
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Patch 1/1] UnitTestFrameworkPkg: Library classes private to public
2022-12-05 18:18 ` Michael D Kinney
@ 2022-12-06 1:31 ` Zhiguang Liu
0 siblings, 0 replies; 7+ messages in thread
From: Zhiguang Liu @ 2022-12-06 1:31 UTC (permalink / raw)
To: Kinney, Michael D, devel@edk2.groups.io
Cc: Michael Kubacki, Sean Brogan, Ni, Ray
Hi Mike,
Yes, I will file a BZ and work out a patch serial, including current patch.
Thanks
Zhiguang
> -----Original Message-----
> From: Kinney, Michael D <michael.d.kinney@intel.com>
> Sent: Tuesday, December 6, 2022 2:18 AM
> To: Liu, Zhiguang <zhiguang.liu@intel.com>; devel@edk2.groups.io; Kinney,
> Michael D <michael.d.kinney@intel.com>
> Cc: Michael Kubacki <mikuback@linux.microsoft.com>; Sean Brogan
> <sean.brogan@microsoft.com>; Ni, Ray <ray.ni@intel.com>
> Subject: RE: [Patch 1/1] UnitTestFrameworkPkg: Library classes private to
> public
>
> Zhiguang,
>
> This would be a non-backwards compatible change to this API.
>
> But since this has been a private API, I think we can easily accommodate a
> change like this if we do it right now and make sure the
> UnitTestFrameworkPkg implementations are updated in same patch series.
>
> Can you please put together a patch series with this proposed API change for
> review and enter a BZ with the request as well.
>
> Thanks,
>
> Mike
>
> > -----Original Message-----
> > From: Liu, Zhiguang <zhiguang.liu@intel.com>
> > Sent: Sunday, December 4, 2022 11:55 PM
> > To: Kinney, Michael D <michael.d.kinney@intel.com>;
> > devel@edk2.groups.io
> > Cc: Michael Kubacki <mikuback@linux.microsoft.com>; Sean Brogan
> > <sean.brogan@microsoft.com>; Ni, Ray <ray.ni@intel.com>
> > Subject: RE: [Patch 1/1] UnitTestFrameworkPkg: Library classes private
> > to public
> >
> > Another suggestion from Ray is to change the API adding a new
> > parameter(size), so we can avoid using the UNIT_TEST_SAVE_HEADER
> struct.
> >
> > EFI_STATUS
> > EFIAPI
> > SaveUnitTestCache (
> > IN UNIT_TEST_FRAMEWORK_HANDLE FrameworkHandle,
> > IN VOID *SaveData,
> > IN UINTN Size
> > );
> >
> > Thanks
> > Zhiguang
> >
> > > -----Original Message-----
> > > From: Liu, Zhiguang
> > > Sent: Monday, December 5, 2022 3:44 PM
> > > To: Kinney, Michael D <michael.d.kinney@intel.com>;
> > > devel@edk2.groups.io
> > > Cc: Michael Kubacki <mikuback@linux.microsoft.com>; Sean Brogan
> > > <sean.brogan@microsoft.com>; Ni, Ray <ray.ni@intel.com>
> > > Subject: RE: [Patch 1/1] UnitTestFrameworkPkg: Library classes
> > > private to public
> > >
> > > Hi Mike,
> > > Thanks for the patch.
> > > One comment is that UnitTestPersistenceLib depends on a struct
> > > definition UNIT_TEST_SAVE_HEADER, which is defined in private headers.
> > > Do you think it is ok to also move it into UnitTestPersistenceLib.h?
> > > Or what we really need from the struct in UnitTestPersistenceLib is
> > > the SaveStateSize, we can define a new public struct
> > > UNIT_TEST_SAVE_HEADER_PUBLIC to only contains the needed fields,
> > > like
> > >
> > > typedef struct {
> > > UINT8 Version;
> > > UINT32 SaveStateSize; // Size of the entire serialized
> buffer.
> > > UINT8 RawData[];
> > > } UNIT_TEST_SAVE_HEADER;
> > >
> > > Thanks
> > > Zhiguang
> > >
> > > > -----Original Message-----
> > > > From: Kinney, Michael D <michael.d.kinney@intel.com>
> > > > Sent: Thursday, December 1, 2022 5:20 AM
> > > > To: devel@edk2.groups.io
> > > > Cc: Michael Kubacki <mikuback@linux.microsoft.com>; Sean Brogan
> > > > <sean.brogan@microsoft.com>; Ni, Ray <ray.ni@intel.com>; Liu,
> > > > Zhiguang <zhiguang.liu@intel.com>
> > > > Subject: [Patch 1/1] UnitTestFrameworkPkg: Library classes private
> > > > to public
> > > >
> > > > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4178
> > > >
> > > > * Change GoogleTestLib class from private to public.
> > > > * Change UnitTestPersistenceLib class from private to public.
> > > >
> > > > Cc: Michael Kubacki <mikuback@linux.microsoft.com>
> > > > Cc: Sean Brogan <sean.brogan@microsoft.com>
> > > > Cc: Ray Ni <ray.ni@intel.com>
> > > > Cc: Zhiguang Liu <zhiguang.liu@intel.com>
> > > > Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
> > > > ---
> > > > .../Library/UnitTestPersistenceLib.h | 0
> > > > UnitTestFrameworkPkg/UnitTestFrameworkPkg.dec | 13 +++++++--
> ----
> > > > 2 files changed, 7 insertions(+), 6 deletions(-) rename
> > > > UnitTestFrameworkPkg/{PrivateInclude =>
> > > > Include}/Library/UnitTestPersistenceLib.h (100%)
> > > >
> > > > diff --git
> > > > a/UnitTestFrameworkPkg/PrivateInclude/Library/UnitTestPersistenceL
> > > > ib.h
> > > > b/UnitTestFrameworkPkg/Include/Library/UnitTestPersistenceLib.h
> > > > similarity index 100%
> > > > rename from
> > > > UnitTestFrameworkPkg/PrivateInclude/Library/UnitTestPersistenceLib
> > > > .h
> > > > rename to
> > > > UnitTestFrameworkPkg/Include/Library/UnitTestPersistenceLib.h
> > > > diff --git a/UnitTestFrameworkPkg/UnitTestFrameworkPkg.dec
> > > > b/UnitTestFrameworkPkg/UnitTestFrameworkPkg.dec
> > > > index ed12f32009d8..14e387d63a0f 100644
> > > > --- a/UnitTestFrameworkPkg/UnitTestFrameworkPkg.dec
> > > > +++ b/UnitTestFrameworkPkg/UnitTestFrameworkPkg.dec
> > > > @@ -26,11 +26,16 @@ [Includes.Common.Private]
> > > > Library/CmockaLib/cmocka/include/cmockery
> > > > Library/GoogleTestLib/googletest/googletest
> > > >
> > > > -[LibraryClasses.Common.Private]
> > > > +[LibraryClasses]
> > > > ## @libraryclass Allows save and restore unit test internal state
> > > > #
> > > > -
> > > > UnitTestPersistenceLib|PrivateInclude/Library/UnitTestPersistenceL
> > > > UnitTestPersistenceLib|ib.h
> > > > + UnitTestPersistenceLib|Include/Library/UnitTestPersistenceLib.h
> > > >
> > > > + ## @libraryclass GoogleTest infrastructure #
> > > > + GoogleTestLib|Include/Library/GoogleTestLib.h
> > > > +
> > > > +[LibraryClasses.Common.Private]
> > > > ## @libraryclass Provides a unit test result report
> > > > #
> > > >
> > > > UnitTestResultReportLib|PrivateInclude/Library/UnitTestResultRepor
> > > > UnitTestResultReportLib|tLib
> > > > .h @@ -39,10 +44,6 @@ [LibraryClasses.Common.Private]
> > > > #
> > > > UnitTestBootLib|PrivateInclude/Library/UnitTestBootLib.h
> > > >
> > > > - ## @libraryclass GoogleTest infrastructure
> > > > - #
> > > > - GoogleTestLib|Include/Library/GoogleTestLib.h
> > > > -
> > > > [Guids]
> > > > gUnitTestFrameworkPkgTokenSpaceGuid = { 0x833d3aba, 0x39b4,
> > > > 0x43a2, { 0xb9, 0x30, 0x7a, 0x34, 0x53, 0x39, 0x31, 0xb3 } }
> > > >
> > > > --
> > > > 2.37.1.windows.1
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2022-12-06 1:31 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-30 21:19 [Patch 1/1] UnitTestFrameworkPkg: Library classes private to public Michael D Kinney
2022-11-30 23:02 ` [edk2-devel] " Michael Kubacki
2022-12-01 2:17 ` Ni, Ray
2022-12-05 7:44 ` Zhiguang Liu
2022-12-05 7:54 ` Zhiguang Liu
2022-12-05 18:18 ` Michael D Kinney
2022-12-06 1:31 ` Zhiguang Liu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox