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 D11B2AC19FA for ; Fri, 1 Dec 2023 17:10:15 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=c1jdW7Jxt9Kb1VdnXZo1ilgIHvnWNl6t0wkiKEAChQU=; c=relaxed/simple; d=groups.io; h=DKIM-Filter:Message-ID:Date:MIME-Version:User-Agent:Subject:To:Cc:References:From:In-Reply-To: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=1701450614; v=1; b=Z+4sBGrwM/7FYyxIkAKMy2usNOdd0RMELVdKo77L6ctgMwPrc5CVOc9eS++twQFMoBb93pHE IdTF90VMcipgmiU1Y+RdYJ+Rzuoj91JAlWrgfWEGFnGTy1EtUGK/FwO7rjGJeXpoX5C+zo97vVc nwBp83sNVFD8bCD2hd3bnvWo= X-Received: by 127.0.0.2 with SMTP id w5hnYY7687511xHbkTlzsnus; Fri, 01 Dec 2023 09:10:14 -0800 X-Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mx.groups.io with SMTP id smtpd.web11.5177.1701450613958843353 for ; Fri, 01 Dec 2023 09:10:14 -0800 X-Received: from [192.168.4.22] (unknown [47.201.241.198]) by linux.microsoft.com (Postfix) with ESMTPSA id 28C8020B74C0; Fri, 1 Dec 2023 09:10:13 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 28C8020B74C0 Message-ID: <730cdbbc-ef36-47ce-b0c7-19c6dd29d6e5@linux.microsoft.com> Date: Fri, 1 Dec 2023 12:10:11 -0500 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [edk2-devel] [PATCH 2/2] UnitTestFrameworkPkg/Readme.md: Remove the mention of the gtest main() limitation To: devel@edk2.groups.io, pedro.falcato@gmail.com Cc: Michael D Kinney , Sean Brogan References: <20231130224214.86027-1-pedro.falcato@gmail.com> <20231130224214.86027-3-pedro.falcato@gmail.com> From: "Michael Kubacki" In-Reply-To: <20231130224214.86027-3-pedro.falcato@gmail.com> 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,mikuback@linux.microsoft.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: bcNJjkbFy4r1hfY7im2aTJnhx7686176AA= Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed 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=Z+4sBGrw; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=linux.microsoft.com (policy=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 Hi Pedro, PatchCheck flagged the subject length: UnitTestFrameworkPkg/Readme.md: Remove the mention of the gtest main() limitation The commit message format is not valid: * First line of commit message (subject line) is too long (81 >=3D 76)= . =20 https://github.com/tianocore/tianocore.github.io/wiki/Commit-Message-Format The code passed all checks. I think the following is also clear enough: "UnitTestFrameworkPkg/Readme.md: Remove the gtest main() limitation" Thanks, Michael On 11/30/2023 5:42 PM, Pedro Falcato wrote: > As of the previous commit, this limitation is no longer a thing. > You can now write gtest unit tests with multiple files and no need for > any hack such as #include. >=20 > Signed-off-by: Pedro Falcato > Cc: Michael D Kinney > Cc: Michael Kubacki > Cc: Sean Brogan > --- > UnitTestFrameworkPkg/ReadMe.md | 16 ---------------- > 1 file changed, 16 deletions(-) >=20 > diff --git a/UnitTestFrameworkPkg/ReadMe.md b/UnitTestFrameworkPkg/ReadMe= .md > index 7da6a320a7f1..d6a3e0c15a2b 100644 > --- a/UnitTestFrameworkPkg/ReadMe.md > +++ b/UnitTestFrameworkPkg/ReadMe.md > @@ -1096,22 +1096,6 @@ int main(int argc, char* argv[]) { > } > ``` > =20 > -However, while GoogleTest does not require test suites or test cases to = be > -registered, there is still one rule within EDK II that currently needs t= o be > -followed. This rule is that all tests for a given GoogleTest application= must > -be contained within the same source file that contains the `main()` func= tion > -shown above. These tests can be written directly in the file or a `#incl= ude` > -can be used to add them into the file indirectly. > - > -The reason for this is due to EDK II taking the host application INF fil= e and > -first compiling all of its source files into a static library. This stat= ic > -library is then linked into the final host application. The problem with= this > -method is that only the tests in the object file containing the `main()` > -function are linked into the final host application. This is because the= other > -tests are contained in their own object files within the static library = and > -they have no symbols in them that the final host application depends on,= so > -those object files are not linked into the final host application. > - > ### GoogleTest - A Simple Test Case > =20 > Below is a sample test case from `SampleGoogleTestHost`. -=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 (#111984): https://edk2.groups.io/g/devel/message/111984 Mute This Topic: https://groups.io/mt/102904624/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-