From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mx.groups.io with SMTP id smtpd.web10.2518.1667593537052236213 for ; Fri, 04 Nov 2022 13:25:39 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=QO4C/P7i; spf=pass (domain: intel.com, ip: 192.55.52.43, 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=1667593539; x=1699129539; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=pUluqtLKcTiAPwte4FOMBejmD6oVtfPLcwOz3kyju7E=; b=QO4C/P7iBrwF3nGor9YcTEjq+NrKJuVRoXNiPVS6M3osTj+Bew++aIDt 0oI9drrsmvVzeTTaCXAqaItcYATBlLigLX+d2Xu9QykkK4o1YkZYIjd+k E++Xm0XB1EHp1BP2lg7LBvZ19zl0a6NBUpwe7NNWEThN5FXyzTerVtefi KGaTU2q2jJfy3z4N3rHqwTxAgIqI4jJKQVmH0hgYpacZwPzATgU6nTPub 7QUm2NxSVcG3ZU1kajS/J4APH4+GtH8x9C280CfcqerB6/j1fFiPi7dyw 225lGrpuzvmbm/jOoDHl0Ts3OC6tiPWyXXCW/dEVOT3Ee7MTdtUxDtPOd A==; X-IronPort-AV: E=McAfee;i="6500,9779,10521"; a="396363628" X-IronPort-AV: E=Sophos;i="5.96,138,1665471600"; d="scan'208";a="396363628" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Nov 2022 13:25:39 -0700 X-IronPort-AV: E=McAfee;i="6500,9779,10521"; a="777839160" X-IronPort-AV: E=Sophos;i="5.96,138,1665471600"; d="scan'208";a="777839160" Received: from mdkinney-mobl2.amr.corp.intel.com ([10.212.255.31]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Nov 2022 13:25:38 -0700 From: "Michael D Kinney" To: devel@edk2.groups.io Cc: Bob Feng , Liming Gao , Yuwei Chen Subject: [Patch V2 6/7] BaseTools/Plugin/HostBaseUnitTestRunner: Enable gtest xml output Date: Fri, 4 Nov 2022 13:25:27 -0700 Message-Id: <20221104202528.1157-7-michael.d.kinney@intel.com> X-Mailer: git-send-email 2.37.1.windows.1 In-Reply-To: <20221104202528.1157-1-michael.d.kinney@intel.com> References: <20221104202528.1157-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