From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mx.groups.io with SMTP id smtpd.web08.21.1667949182063513285 for ; Tue, 08 Nov 2022 15:13:03 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=QTbOHfHv; spf=pass (domain: intel.com, ip: 134.134.136.24, mailfrom: michael.d.kinney@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1667949183; x=1699485183; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=pUluqtLKcTiAPwte4FOMBejmD6oVtfPLcwOz3kyju7E=; b=QTbOHfHvK9bJ8e/1jy8CP+zjI4SH442lAP0cxu0lEoIML+n4cYOKuMJh 2R10294XQxw4aUcpObXdJXeGqQptxjm5uHVC64zCnhMYKagzs16j08te3 CPepPsUbFe55y9AqirT+kWa1PZ7SawDwzD5QhN+vH2wQQE8a5Ly8LyJYo FmUg2ZIIJoMVvk+Gu8+UK/N7wgXDzCx/ickyFqZTOKDdJD8jeD4mlfLyt ToUIQIpFeCODBv6gsEJ2bj1LY4+LHg0bejYgVeBYUt0VnVa7LWVY/d6jO YDPgaK1c01sO+W0zMk/P01bOE+KoW7MvlZh6/L0cVcPR1iyt7RkVJQSy+ w==; X-IronPort-AV: E=McAfee;i="6500,9779,10525"; a="311990225" X-IronPort-AV: E=Sophos;i="5.96,149,1665471600"; d="scan'208";a="311990225" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Nov 2022 15:13:01 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10525"; a="636512169" X-IronPort-AV: E=Sophos;i="5.96,149,1665471600"; d="scan'208";a="636512169" Received: from mdkinney-mobl2.amr.corp.intel.com ([10.209.46.35]) by orsmga002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Nov 2022 15:13:01 -0800 From: "Michael D Kinney" To: devel@edk2.groups.io Cc: Bob Feng , Liming Gao , Yuwei Chen Subject: [Patch v3 6/7] BaseTools/Plugin/HostBaseUnitTestRunner: Enable gtest xml output Date: Tue, 8 Nov 2022 15:12:51 -0800 Message-Id: <20221108231252.1864-7-michael.d.kinney@intel.com> X-Mailer: git-send-email 2.37.1.windows.1 In-Reply-To: <20221108231252.1864-1-michael.d.kinney@intel.com> References: <20221108231252.1864-1-michael.d.kinney@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 Cc: Liming Gao Cc: Yuwei Chen Signed-off-by: Michael D Kinney Reviewed-by: Bob Feng --- .../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