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 2037CD80808 for ; Thu, 30 Nov 2023 22:42:24 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=DBxKEo0I5vuVgoC/9JlnWhVnR43RKxsP93mhE64Fjys=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding; s=20140610; t=1701384143; v=1; b=eHj7JabARlWYVinb79jB+Em7uQMRcrfuKZxNXVC2eY8t3BiP1q8ZJqMRMwzIUTxsNGSVYVAZ rNphvGneeIhcu3HD0eV9i6pJ5coib84XOA24ZefhFL83pG++TXoh2jbgz8gGRJkIUq6aJgnnLVJ JVRcoQKjP6XpS5K4e0Gdfupk= X-Received: by 127.0.0.2 with SMTP id 6Ot7YY7687511xy1Il6FLuip; Thu, 30 Nov 2023 14:42:23 -0800 X-Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com [209.85.128.54]) by mx.groups.io with SMTP id smtpd.web11.9238.1701384142840332961 for ; Thu, 30 Nov 2023 14:42:23 -0800 X-Received: by mail-wm1-f54.google.com with SMTP id 5b1f17b1804b1-40b4744d603so15167295e9.2 for ; Thu, 30 Nov 2023 14:42:22 -0800 (PST) X-Gm-Message-State: tXXXa4bzrpS4BC8R9ezGHivJx7686176AA= X-Google-Smtp-Source: AGHT+IFBfu1JwOz0cwzWzRrVUzsOXiSSWSklf5ETuKHJ1Hr27NR9aUlj1Lw1JdV0gZuzuU+gK9aQtw== X-Received: by 2002:adf:ee41:0:b0:333:3117:c456 with SMTP id w1-20020adfee41000000b003333117c456mr35503wro.231.1701384140752; Thu, 30 Nov 2023 14:42:20 -0800 (PST) X-Received: from PC-PEDRO-ARCH.lan ([2001:8a0:7280:5801:9441:3dce:686c:bfc7]) by smtp.gmail.com with ESMTPSA id k26-20020adfb35a000000b003332faefd86sm547243wrd.0.2023.11.30.14.42.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Nov 2023 14:42:20 -0800 (PST) From: "Pedro Falcato" To: devel@edk2.groups.io Cc: Pedro Falcato , Michael D Kinney , Michael Kubacki , Sean Brogan Subject: [edk2-devel] [PATCH 2/2] UnitTestFrameworkPkg/Readme.md: Remove the mention of the gtest main() limitation Date: Thu, 30 Nov 2023 22:42:14 +0000 Message-ID: <20231130224214.86027-3-pedro.falcato@gmail.com> In-Reply-To: <20231130224214.86027-1-pedro.falcato@gmail.com> References: <20231130224214.86027-1-pedro.falcato@gmail.com> MIME-Version: 1.0 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,pedro.falcato@gmail.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: Content-Transfer-Encoding: 8bit X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=eHj7JabA; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=gmail.com (policy=none) 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. Signed-off-by: Pedro Falcato Cc: Michael D Kinney Cc: Michael Kubacki Cc: Sean Brogan --- UnitTestFrameworkPkg/ReadMe.md | 16 ---------------- 1 file changed, 16 deletions(-) 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[]) { } ``` -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 to 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()` function -shown above. These tests can be written directly in the file or a `#include` -can be used to add them into the file indirectly. - -The reason for this is due to EDK II taking the host application INF file and -first compiling all of its source files into a static library. This static -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 Below is a sample test case from `SampleGoogleTestHost`. -- 2.43.0 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#111917): https://edk2.groups.io/g/devel/message/111917 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] -=-=-=-=-=-=-=-=-=-=-=-