From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id B8FE97803CD for ; Mon, 18 Dec 2023 02:25:05 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=RImNCJhDP/xqVKJIhMlPvyCn4RW2MveCHm8plbPmSpo=; c=relaxed/simple; d=groups.io; h=ARC-Seal:ARC-Message-Signature:ARC-Authentication-Results:From:To:CC:Subject:Thread-Topic:Thread-Index:Date:Message-ID:References:In-Reply-To:Accept-Language:msip_labels:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Language:Content-Type:Content-Transfer-Encoding; s=20140610; t=1702866304; v=1; b=u8J1nD1StGaN+jbBNp73fML3ZaH1KyOlp8G9QTUBUJdKrIY+FV6IOGZmmw4CU/vnxW4qXnGv Cx3rjxAWW3JmELY4kk9M1bcJDoPgNdQNXino7zgRdR1gUQo92W8MVGZeLsEwCPzG1mslSU2HDcC WZA5JLpxUVK59/kURPU/LLYc= X-Received: by 127.0.0.2 with SMTP id U6l5YY7687511x4g9wxRLmEP; Sun, 17 Dec 2023 18:25:04 -0800 X-Received: from NAM12-MW2-obe.outbound.protection.outlook.com (NAM12-MW2-obe.outbound.protection.outlook.com [40.107.244.89]) by mx.groups.io with SMTP id smtpd.web11.33975.1702866303742520821 for ; Sun, 17 Dec 2023 18:25:03 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=izz5S+E3ZNKvJ7qiPS/alMT684QsDCuF3cX0leU2D6X8UWLIyE3g9NCUZGV/KmUlAXBIipBDhOyc1ShJLUJjuGAISjYQofq+lu6x3c4CitNesAxY11ss8HZ9i77Ysud36udFc7fewr+b+EsH/5FlXfHLDaz6vcEIKjV6h6mbiDtEW5pEVtFZ8gXllUK7fidYHqEIBmwQFnk/ANniu54kES5/S1AQYoNOv7mI1tdrwMmOtG55VaDC/1xvNdO83rnKxMzN1ejaKeCw2Y5fJbB+5gm8iJlwJLC5C5GRTG9e4AHSFTer5fcnmRC2xxIJxvaHowC+U2unn/qGbVqKfV93Hg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=GNHSs2V7dkHH0jMjO770wlGbyIO/CZY60NgqeiQgF6M=; b=jv10iox+cCMCBmGegx+ujxrS3UjLipgRDqG4OE8DBJO8xqkS42ns1b6TjI1yUR3P3s9SOj0PGc4L9CYxzY5N/jgOIEg+RCq0HyN6lH9zXrvn9txR6IYSZDwcw39Nzo0UBRhFSuVQ29DPQ0B0fjcukTadeomnFVQ1O6gncpsp3L9qhWdZVgeplPVzxIbhCElsMFmIVUVVzI/mvOm0B9GB5Q5CjvgL0OWRRIUJRRQI31PB3G54wxz4gQVMgObfgo/8oDXs89or9MqUVLEKB2qTZAKUQNW8Rkv7B2BJFBHbF2ChsUsndgzeUZGY9IA6WpBW1oHJpGbQKgx0tx0Ac1uU+w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none X-Received: from MN2PR12MB3966.namprd12.prod.outlook.com (2603:10b6:208:165::18) by DM4PR12MB6494.namprd12.prod.outlook.com (2603:10b6:8:ba::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7091.37; Mon, 18 Dec 2023 02:25:01 +0000 X-Received: from MN2PR12MB3966.namprd12.prod.outlook.com ([fe80::91d9:e679:32a3:dd05]) by MN2PR12MB3966.namprd12.prod.outlook.com ([fe80::91d9:e679:32a3:dd05%5]) with mapi id 15.20.7091.034; Mon, 18 Dec 2023 02:25:01 +0000 From: "Chang, Abner via groups.io" To: Jeff Brasen , "devel@edk2.groups.io" CC: "ardb+tianocore@kernel.org" , "quic_llindhol@quicinc.com" Subject: Re: [edk2-devel] [PATCH] EmbeddedPkg: Add DtPlatformLoaderLib gmock support Thread-Topic: [PATCH] EmbeddedPkg: Add DtPlatformLoaderLib gmock support Thread-Index: AQHaLElPlH8eziBkYUym9NmOPa4BuLCuWb/Q Date: Mon, 18 Dec 2023 02:25:01 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US, zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_ActionId=7941dadb-9294-43be-9873-68d1a4e3d47d;MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_ContentBits=0;MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_Enabled=true;MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_Method=Standard;MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_Name=General;MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_SetDate=2023-12-18T02:23:16Z;MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_SiteId=3dd8961f-e488-4e60-8e11-a82d994e183d; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: MN2PR12MB3966:EE_|DM4PR12MB6494:EE_ x-ms-office365-filtering-correlation-id: 283a229a-0cf6-47cc-3882-08dbff7089a9 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam-message-info: WKwh8rheJls2n4tQGc+/HLIWlBU36NrQX+TjRW/ADFYWiwzeWsIXdtxDEgcTNl+itUz6JMIIcQyYiyOdrgxzLoP3U+kcoPP6qx1UEuf+xJP06pW6YikD8vO02PAoc40e0KyfLkyVrSrHYdzjSp7uIUUfKwCxOjFrXPpfsUjYp22XJmml31MbZcIfXV24hPMje6+m86SCzZGCx/+vtDi35wPcrS3KUNt8yykG7K22lR1WjDWnDvImqEflO/5+g9ajkDf8XnuBBFN+nGDFUnVLqDSIo/dr5K28ZMKJkzenYpMmK2GDPfuCe3dXgoHkUlT7r6cWTZn/+CKZzGsFyLf4GNXa9HGva5D8SL9Ej+hVhEffZ9Sp/mfqnQoxjK2d71ZlP1+YppGm/attcYYMR6ewPhmeytTyxfvAAJYrsIxq6dIebZpl7p8NDiFUO41bxzWc9Jm0PYMBQNNcA5oIVUAT7AR1WzGOB1bNYljGXNcAd4XT+arP20lLmwiZWBI6i6ENFkH1CpZQrs8FJif45JMlVK/LwjZGDD0V4F09E1XOzk2T2bC+eUFmzliLkAdIelsTeIe09uBSHvUsHmNZs82OnCnJGncj9gC7dGHYkRqLzZ52eLPNTPm/jO4yJDHxJy8soIkydqBV3wQ2SIOCOMf27eXmjlV9/Qz0+539jFBKfro= x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?b+TeEg19opmCxVk6d0eyDOPQookCiVOFWp0Bkq6VzPe/tlanjIazTssnNrXw?= =?us-ascii?Q?UALSoUTQKpAXC91sQwDvdW7KAP1sTgflgi8yO3CFvinnyZy8dzFFvYUwmrxn?= =?us-ascii?Q?H6wyNdzvU58sKSln8fMhYNXFKpWQsjv8g/mBeMs+fjO11LnKTHG5ZLJ0q+Nw?= =?us-ascii?Q?9zPbg2+BBcC09Nz471VMoBNX5LEcxSal5L3l2beKUmZ51fv1/i22/bA96JhP?= =?us-ascii?Q?2eNxxJB6TfUw/Y2c1pg8N0FswNFioi+6n6Cqwujfud+TYfmM0Ig7cTLPKZOY?= =?us-ascii?Q?Gjb3EPmNdQ0OdXrEnWVEXWydztqpYnxhHaGw692USIn0Vtfe1uvI4phLEgQd?= =?us-ascii?Q?IluOJ/c3N7WnJBP212pPjeGNW4+MyF/w6A5ghs9C+KXmAC+WqwVqsP11wyd3?= =?us-ascii?Q?4JYnn3iC+05YF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ascii?Q?4oofKvnSoiceUxeRoPtKKZoDm2Ijjwdc/MM5tLkRjaPCJOOHQfT1a4udN3dS?= =?us-ascii?Q?E7I4Qq3EtjLGfeS3ATUtJ5uqCtZaU30mQhzCsqXI2FjDn6YIVMV52DUTBqlB?= =?us-ascii?Q?LEWKOkCtprCHdGgXRdtQSFube6iLT2NCoKaEsCgItscqkYjGhZI77UokOlu0?= =?us-ascii?Q?mWG8/bGK8UwIpKNLUicNRzisUx8CLfygh9GFpunqgmSHUi4x3muoWBVlOQsi?= =?us-ascii?Q?B/FPBfM/UgteaLuOMnI=3D?= MIME-Version: 1.0 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MN2PR12MB3966.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 283a229a-0cf6-47cc-3882-08dbff7089a9 X-MS-Exchange-CrossTenant-originalarrivaltime: 18 Dec 2023 02:25:01.3846 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: aXsv2zDuuA6UJfS7BwnvwVPN+BpLNcCEJUQFTQLSxlWAugIL0KJMbxBJIZC33WWO40pcSQjnlKu3rkVV8vSZ4g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB6494 Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,abner.chang@amd.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: ma21KDZ0NE3iXbYtGbCSqeayx7686176AA= Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=u8J1nD1S; arc=reject ("signature check failed: fail, {[1] = sig:microsoft.com:reject}"); dmarc=none; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io [AMD Official Use Only - General] Not familiar with gmock and no idea of adding a cpp source file to edk2 (we= done this on edk2 before?). May need someone else to review this change. Thanks Abner > -----Original Message----- > From: Jeff Brasen > Sent: Monday, December 11, 2023 11:47 PM > To: devel@edk2.groups.io > Cc: Chang, Abner ; ardb+tianocore@kernel.org; > quic_llindhol@quicinc.com; Jeff Brasen > Subject: [PATCH] EmbeddedPkg: Add DtPlatformLoaderLib gmock support > > Caution: This message originated from an External Source. Use proper caut= ion > when opening attachments, clicking links, or responding. > > > Add Google Mock Library for DtPlatformLoaderDtbLib > > Signed-off-by: Jeff Brasen > --- > EmbeddedPkg/EmbeddedPkg.dec | 1 + > .../Library/MockDtPlatformDtbLoaderLib.h | 31 +++++++++++++++++++ > .../MockDtPlatformDtbLoaderLib.cpp | 13 ++++++++ > .../MockDtPlatformDtbLoaderLib.inf | 29 +++++++++++++++++ > 4 files changed, 74 insertions(+) > create mode 100644 > EmbeddedPkg/Test/Mock/Include/GoogleTest/Library/MockDtPlatformDtbLo > aderLib.h > create mode 100644 > EmbeddedPkg/Test/Mock/Library/GoogleTest/MockDtPlatformDtbLoaderLib/ > MockDtPlatformDtbLoaderLib.cpp > create mode 100644 > EmbeddedPkg/Test/Mock/Library/GoogleTest/MockDtPlatformDtbLoaderLib/ > MockDtPlatformDtbLoaderLib.inf > > diff --git a/EmbeddedPkg/EmbeddedPkg.dec > b/EmbeddedPkg/EmbeddedPkg.dec > index 94dc3c9b76..b4834e8b4f 100644 > --- a/EmbeddedPkg/EmbeddedPkg.dec > +++ b/EmbeddedPkg/EmbeddedPkg.dec > @@ -28,6 +28,7 @@ > > ################################################################### > ############# > [Includes.common] > Include # Root include for the package > + Test/Mock/Include > > [LibraryClasses.common] > PrePiLib|Include/Library/PrePiLib.h > diff --git > a/EmbeddedPkg/Test/Mock/Include/GoogleTest/Library/MockDtPlatformDtb > LoaderLib.h > b/EmbeddedPkg/Test/Mock/Include/GoogleTest/Library/MockDtPlatformDtb > LoaderLib.h > new file mode 100644 > index 0000000000..23dab21668 > --- /dev/null > +++ > b/EmbeddedPkg/Test/Mock/Include/GoogleTest/Library/MockDtPlatformDtb > LoaderLib.h > @@ -0,0 +1,31 @@ > +/** @file > + Google Test mocks for DtPlatformDtbLoaderLib > + > + Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. All rights reserve= d. > + Copyright (c) 2023, Intel Corporation. All rights reserved. > + SPDX-License-Identifier: BSD-2-Clause-Patent > +**/ > + > +#ifndef MOCK_DT_PLATFORM_DTB_LOADER_LIB_H_ > +#define MOCK_DT_PLATFORM_DTB_LOADER_LIB_H_ > + > +#include > +#include > +extern "C" { > +#include > +#include > +#include > +} > + > +struct MockDtPlatformDtbLoaderLib { > + MOCK_INTERFACE_DECLARATION (MockDtPlatformDtbLoaderLib); > + > + MOCK_FUNCTION_DECLARATION ( > + EFI_STATUS, > + DtPlatformLoadDtb, > + (OUT VOID **Dtb, > + OUT UINTN *DtbSize) > + ); > +}; > + > +#endif > diff --git > a/EmbeddedPkg/Test/Mock/Library/GoogleTest/MockDtPlatformDtbLoaderLi > b/MockDtPlatformDtbLoaderLib.cpp > b/EmbeddedPkg/Test/Mock/Library/GoogleTest/MockDtPlatformDtbLoaderLi > b/MockDtPlatformDtbLoaderLib.cpp > new file mode 100644 > index 0000000000..a5db68e59a > --- /dev/null > +++ > b/EmbeddedPkg/Test/Mock/Library/GoogleTest/MockDtPlatformDtbLoaderLi > b/MockDtPlatformDtbLoaderLib.cpp > @@ -0,0 +1,13 @@ > +/** @file > + Google Test mocks for MockDtPlatformDtbLoaderLib > + > + Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. All rights reserve= d. > + Copyright (c) 2023, Intel Corporation. All rights reserved. > + SPDX-License-Identifier: BSD-2-Clause-Patent > +**/ > + > +#include > + > +MOCK_INTERFACE_DEFINITION (MockDtPlatformDtbLoaderLib); > + > +MOCK_FUNCTION_DEFINITION (MockDtPlatformDtbLoaderLib, > DtPlatformLoadDtb, 2, EFIAPI); > diff --git > a/EmbeddedPkg/Test/Mock/Library/GoogleTest/MockDtPlatformDtbLoaderLi > b/MockDtPlatformDtbLoaderLib.inf > b/EmbeddedPkg/Test/Mock/Library/GoogleTest/MockDtPlatformDtbLoaderLi > b/MockDtPlatformDtbLoaderLib.inf > new file mode 100644 > index 0000000000..9618efd864 > --- /dev/null > +++ > b/EmbeddedPkg/Test/Mock/Library/GoogleTest/MockDtPlatformDtbLoaderLi > b/MockDtPlatformDtbLoaderLib.inf > @@ -0,0 +1,29 @@ > +## @file > +# Google Test mocks for MockDtPlatformDtbLoaderLib > +# > +# Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. All rights > reserved. > +# Copyright (c) 2023, Intel Corporation. All rights reserved. > +# SPDX-License-Identifier: BSD-2-Clause-Patent > +## > + > +[Defines] > + INF_VERSION =3D 0x00010005 > + BASE_NAME =3D MockDtPlatformDtbLoaderLib > + FILE_GUID =3D 34c05e81-3c56-4c78-b4b7-a39be19163a= 4 > + MODULE_TYPE =3D HOST_APPLICATION > + VERSION_STRING =3D 1.0 > + LIBRARY_CLASS =3D DtPlatformDtbLoaderLib > + > +[Sources] > +MockDtPlatformDtbLoaderLib.cpp > + > +[Packages] > + EmbeddedPkg/EmbeddedPkg.dec > + MdePkg/MdePkg.dec > + UnitTestFrameworkPkg/UnitTestFrameworkPkg.dec > + > +[LibraryClasses] > + GoogleTestLib > + > +[BuildOptions] > + MSFT:*_*_*_CC_FLAGS =3D /EHsc > -- > 2.34.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#112614): https://edk2.groups.io/g/devel/message/112614 Mute This Topic: https://groups.io/mt/103110931/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-