Details
-
Bug
-
Resolution: Done
-
P2: Important
-
4.6.0
-
None
-
GNU/Linux 64 bits using Qt compiled from Git sources (I have used both git://gitorious.org/qt/qt.git and git://gitorious.org/+kde-developers/qt/kde-qt.git repositories to check this, refreshing the build after changing between them).
-
cf2996cceb1ee07d8969867981c8caeabf2d35c3, e1a8f3afc834ff3a148ca330ba5338f60e64e276
Description
In Qt 4.5, the xml output of QTest contained a <DataTag><![CDATA[name of test data]]></DataTag> element child of Message element when data driven testing was used. For example:
<TestFunction name="debug"> <Message type="qdebug" file="" line="0"> <DataTag><![CDATA[row1]]></DataTag> <Description><![CDATA[Some message ]]></Description> </Message> <Incident type="pass" file="" line="0" /> </TestFunction> <TestFunction name="skipSingle"> <Message type="skip" file="/path/to/dataDrivenTest.cpp" line="32"> <DataTag><![CDATA[row1]]></DataTag> <Description><![CDATA[Skip single message]]></Description> </Message> <Incident type="pass" file="" line="0" /> </TestFunction> <TestFunction name="skipAll"> <Message type="skip" file="/path/to/dataDrivenTest.cpp" line="41"> <DataTag><![CDATA[row1]]></DataTag> <Description><![CDATA[Skip all message]]></Description> </Message> </TestFunction> <TestFunction name="assert"> <Message type="qfatal" file="" line="0"> <DataTag><![CDATA[row1]]></DataTag> <Description><![CDATA[ASSERT: "pass" in file /path/to/dataDrivenTest.cpp, line 51]]></Description> </Message> <Incident type="fail" file="Unknown file" line="0"> <DataTag><![CDATA[row1]]></DataTag> <Description><![CDATA[Received a fatal error.]]></Description> </Incident> </TestFunction>
However, in Qt 4.6, the xml output no longer contains a DataTag element under Message in data driven testing. For example:
<TestFunction name="debug"> <Message type="qdebug" file="" line="0"> <Description><![CDATA[Some message ]]></Description> </Message> </TestFunction> <TestFunction name="skipSingle"> <Message type="skip" file="/path/to/dataDrivenTest.cpp" line="32"> <Description><![CDATA[Skip single message]]></Description> </Message> </TestFunction> <TestFunction name="skipAll"> <Message type="skip" file="/path/to/dataDrivenTest.cpp" line="41"> <Description><![CDATA[Skip all message]]></Description> </Message> </TestFunction> <TestFunction name="assert"> <Message type="qfatal" file="" line="0"> <Description><![CDATA[ASSERT: "pass" in file /path/to/dataDrivenTest.cpp, line 51]]></Description> </Message> <Incident type="fail" file="Unknown file" line="0"> <DataTag><![CDATA[row1]]></DataTag> <Description><![CDATA[Received a fatal error.]]></Description> </Incident> </TestFunction>
(note that this output also lacks an Incident element for the first TestFunction, but this was already reported in bug 6278)
If, in Qt 4.6, instead of only "-xml" the command line options used are "-xml -flush", the output is the expected (that is, containing a DataTag element child of Message element, as it did in Qt 4.5).
So the bug only appears in Qt 4.6 when "-xml" option alone is used. Options "-xml -flush" don't exhibit the problem. I have attached a .cpp file that contains the code used to trigger the outputs given as examples.