Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-6320

DataTag element isn't added as child of Message element in -xml output when data driven testing is used

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.0.0
    • 4.6.0
    • Testing: qtestlib
    • None
    • 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.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            jasmcdon Jason McDonald (Closed Nokia Identity. Please assign to "macadder" instead) (Inactive)
            danxuliu Daniel Calviño Sánchez
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes