public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Michael D Kinney" <michael.d.kinney@intel.com>
To: devel@edk2.groups.io
Cc: Bob Feng <bob.c.feng@intel.com>,
	Liming Gao <gaoliming@byosoft.com.cn>,
	Yuwei Chen <yuwei.chen@intel.com>
Subject: [Patch V2 6/7] BaseTools/Plugin/HostBaseUnitTestRunner: Enable gtest xml output
Date: Fri,  4 Nov 2022 13:25:27 -0700	[thread overview]
Message-ID: <20221104202528.1157-7-michael.d.kinney@intel.com> (raw)
In-Reply-To: <20221104202528.1157-1-michael.d.kinney@intel.com>

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4134

Set environment variable GTEST_OUTPUT to specify the output
format of XML and the output file name.  Both CMOCKA_XML_FILE
and GTEST_OUTPUT are set for each host based unit test to
support both cmocka unit tests and gtest unit tests.

Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Yuwei Chen <yuwei.chen@intel.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
---
 .../HostBasedUnitTestRunner/HostBasedUnitTestRunner.py     | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/BaseTools/Plugin/HostBasedUnitTestRunner/HostBasedUnitTestRunner.py b/BaseTools/Plugin/HostBasedUnitTestRunner/HostBasedUnitTestRunner.py
index c1eeaf26251e..a8220aacd396 100644
--- a/BaseTools/Plugin/HostBasedUnitTestRunner/HostBasedUnitTestRunner.py
+++ b/BaseTools/Plugin/HostBasedUnitTestRunner/HostBasedUnitTestRunner.py
@@ -85,9 +85,12 @@ class HostBasedUnitTestRunner(IUefiBuildPlugin):
                 raise NotImplementedError("Unsupported Operating System")
 
             for test in testList:
-                # Configure output name.
+                # Configure output name if test uses cmocka.
                 shell_env.set_shell_var(
-                    'CMOCKA_XML_FILE', test + ".%g." + arch + ".result.xml")
+                    'CMOCKA_XML_FILE', test + ".CMOCKA.%g." + arch + ".result.xml")
+                # Configure output name if test uses gtest.
+                shell_env.set_shell_var(
+                    'GTEST_OUTPUT', "xml:" + test + ".GTEST." + arch + ".result.xml")
 
                 # Run the test.
                 ret = RunCmd('"' + test + '"', "", workingdir=cp)
-- 
2.37.1.windows.1


  parent reply	other threads:[~2022-11-04 20:25 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-04 20:25 [Patch V2 0/7] Add GoogleTest to UnitTestFrameworkPkg Michael D Kinney
2022-11-04 20:25 ` [Patch V2 1/7] MdePkg/Include: Update Base.h to improve C++ compatibility Michael D Kinney
2022-11-08  6:59   ` 回复: " gaoliming
2022-11-04 20:25 ` [Patch V2 2/7] MdePkg/Include/Library: Undefine _ASSERT() if already defined Michael D Kinney
2022-11-08  6:59   ` 回复: " gaoliming
2022-11-04 20:25 ` [Patch V2 3/7] UnitTestFrameworkPkg: Add googletest submodule and GoogleTestLib Michael D Kinney
2022-11-08  7:47   ` 回复: [edk2-devel] " gaoliming
2022-11-08 23:03     ` Michael D Kinney
2022-11-04 20:25 ` [Patch V2 4/7] UnitTestFrameworkPkg/Library/CmockaLib: Enable symbol files Michael D Kinney
2022-11-04 20:25 ` [Patch V2 5/7] .pytool: Add googletest submodule to CISettings.py Michael D Kinney
2022-11-04 20:25 ` Michael D Kinney [this message]
2022-11-04 20:25 ` [Patch V2 7/7] MdePkg/Test: Add port of BaseSafeIntLib unit tests to GoogleTest Michael D Kinney
2022-11-08  6:59   ` 回复: [edk2-devel] " gaoliming

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221104202528.1157-7-michael.d.kinney@intel.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox