我们的自动化测试框架是基于gtest的框架的,目前在向Wince移植的时候,对gtest的输出重定向那块出了问题,由于gtest在Wince上不支持 testing::internal::CaptureStdout(); 函数,导致我们无法获得输出信息,以至于无法解析运行结果。
后来的思路是想如果gtest的输出可以输出到文件里,那么我们直接解析文件就好了,经过查找发现gtest 可以输出到xml文件里,如下所示:
<?xml version="1.0" encoding="UTF-8"?>
<testsuites tests="2" failures="1" disabled="0" errors="0" time="0.067" name="AllTests">
<testsuite name="FooTest" tests="2" failures="1" disabled="0" errors="0" time="0.028">
<testcase name="HandleZeroInput" status="run" time="0.01" classname="FooTest">
<failure message="Value of: 4
Expected: 3
 3 is not equal 4" type=""><![CDATA[.\testGtest.cpp:39
Value of: 4
Expected: 3
3 is not equal 4]]></failure>
</testcase>
<testcase name="HandleZeroInput1" status="notrun" time="0" classname