qt5base-lts/tests/auto/testlib/selftests/expected_warnings.xunitxml
Jason McDonald 26c41ed918 testlib: Clear ignored messages after every data row
Previously, ignored messages were only cleared at the end of each test
function, i.e. after all data rows were finished. This meant that if a
data row in a data-driven test function didn't cause all of the expected
messages to be generated, the remaining messages would be carried over
to the next data row.  This would result in errors about missing
messages being associated with the last data row rather than with the
correct data row.

This commit makes testlib check for missing ignored messages after
running each data row rather than only doing so after the last data
row.

This commit also adds a regression test to demonstrate that ignored
messages can no longer be carried over from one data row to another.

Change-Id: Ibee51aa6e96866fbcbcb4acee1a8340a86a6a4ba
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-02-08 03:13:23 +01:00

45 lines
2.0 KiB
XML

<?xml version="1.0" encoding="UTF-8" ?>
<testsuite errors="12" failures="3" tests="5" name="tst_Warnings">
<properties>
<property value="@INSERT_QT_VERSION_HERE@" name="QTestVersion"/>
<property value="@INSERT_QT_VERSION_HERE@" name="QtVersion"/>
</properties>
<testcase result="pass" name="initTestCase"/>
<testcase result="pass" name="testWarnings">
<!-- message="Warning" type="qwarn" -->
<!-- message="Warning" type="qwarn" -->
<!-- message="Debug" type="qdebug" -->
<!-- message="Debug" type="qdebug" -->
<!-- message="Baba" type="qdebug" -->
<!-- message="Baba" type="qdebug" -->
</testcase>
<testcase result="fail" name="testMissingWarnings">
<!-- message="Did not receive message: &quot;Warning0&quot;" type="info" -->
<!-- message="Did not receive message: &quot;Warning1&quot;" type="info" -->
<failure message="Not all expected messages were received" result="fail"/>
</testcase>
<testcase result="fail" name="testMissingWarningsWithData">
<!-- tag="first row" message="Did not receive message: &quot;Warning0&quot;" type="info" -->
<!-- tag="first row" message="Did not receive message: &quot;Warning1&quot;" type="info" -->
<failure tag="first row" message="Not all expected messages were received" result="fail"/>
<!-- tag="second row" message="Did not receive message: &quot;Warning0&quot;" type="info" -->
<!-- tag="second row" message="Did not receive message: &quot;Warning1&quot;" type="info" -->
<failure tag="second row" message="Not all expected messages were received" result="fail"/>
</testcase>
<testcase result="pass" name="cleanupTestCase"/>
<system-err>
<![CDATA[Warning]]>
<![CDATA[Warning]]>
<![CDATA[Debug]]>
<![CDATA[Debug]]>
<![CDATA[Baba]]>
<![CDATA[Baba]]>
<![CDATA[Did not receive message: "Warning0"]]>
<![CDATA[Did not receive message: "Warning1"]]>
<![CDATA[Did not receive message: "Warning0"]]>
<![CDATA[Did not receive message: "Warning1"]]>
<![CDATA[Did not receive message: "Warning0"]]>
<![CDATA[Did not receive message: "Warning1"]]>
</system-err>
</testsuite>