Reviewed-by: Bob Feng <[email protected]> -----Original Message----- From: Kinney, Michael D <[email protected]> Sent: Friday, November 4, 2022 11:31 AM To: [email protected] Cc: Feng, Bob C <[email protected]>; Gao, Liming <[email protected]>; Chen, Christine <[email protected]> Subject: [Patch 6/7] BaseTools/Plugin/HostBaseUnitTestRunner: Enable gtest xml output
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 <[email protected]> Cc: Liming Gao <[email protected]> Cc: Yuwei Chen <[email protected]> Signed-off-by: Michael D Kinney <[email protected]> --- .../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.p +++ y @@ -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 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#95954): https://edk2.groups.io/g/devel/message/95954 Mute This Topic: https://groups.io/mt/94799430/21656 Group Owner: [email protected] Unsubscribe: https://edk2.groups.io/g/devel/unsub [[email protected]] -=-=-=-=-=-=-=-=-=-=-=-
