13d2e13290
Added tests for repeated skips and failures (from within void lambdas, to simulate skips and failures from within event handlers). These exhibit yet more ways to count more than one outcome for a test. The new QTest::failOnWarning() can also provoke more than one failure from a single test, and several existing selftests exhibited various ways for the Totals line's counts to add up to more than the number of actual tests run. Fixed counting so that only the first decisive incident is counted. Tests can still report later failure or skipping, but only the first is counted. Added a currentTestState in qtestlog.cpp, by which it keeps track of whether the test has resolved to a result, and clearCurrentTestState() by which other code can reset that at the end of each test. This brought to light various places where test-end clean-up was not being handled - due to failure or skipping in a *_data() method or init, or a skip in cleanup. Fixes: QTBUG-95661 Change-Id: I5d24a37a53d3db225fa602649d8aad8f5ed6c1ad Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
112 lines
4.6 KiB
XML
112 lines
4.6 KiB
XML
<?xml version="1.0" encoding="UTF-8" ?>
|
|
<testsuite name="tst_Warnings" timestamp="@TEST_START_TIME@" hostname="@HOSTNAME@" tests="15" failures="10" errors="0" skipped="0" time="@TEST_DURATION@">
|
|
<properties>
|
|
<property name="QTestVersion" value="@INSERT_QT_VERSION_HERE@"/>
|
|
<property name="QtVersion" value="@INSERT_QT_VERSION_HERE@"/>
|
|
<property name="QtBuild" value=""/>
|
|
</properties>
|
|
<testcase name="initTestCase" classname="tst_Warnings" time="@TEST_DURATION@"/>
|
|
<testcase name="testWarnings" classname="tst_Warnings" time="@TEST_DURATION@">
|
|
<system-out>
|
|
<![CDATA[Debug]]>
|
|
<![CDATA[Debug]]>
|
|
<![CDATA[Info]]>
|
|
<![CDATA[Info]]>
|
|
<![CDATA[Baba]]>
|
|
<![CDATA[Baba]]>
|
|
<![CDATA[Bubublabla]]>
|
|
</system-out>
|
|
<system-err>
|
|
<![CDATA[Warning]]>
|
|
<![CDATA[Warning]]>
|
|
<![CDATA[Babablabla]]>
|
|
</system-err>
|
|
</testcase>
|
|
<testcase name="testMissingWarnings" classname="tst_Warnings" time="@TEST_DURATION@">
|
|
<failure type="fail" message="Not all expected messages were received"/>
|
|
<system-out>
|
|
<![CDATA[Did not receive message: "Warning0"]]>
|
|
<![CDATA[Did not receive message: "Warning1"]]>
|
|
</system-out>
|
|
</testcase>
|
|
<testcase name="testMissingWarningsRegularExpression" classname="tst_Warnings" time="@TEST_DURATION@">
|
|
<failure type="fail" message="Not all expected messages were received"/>
|
|
<system-out>
|
|
<![CDATA[Did not receive any message matching: "Warning\s\d"]]>
|
|
</system-out>
|
|
</testcase>
|
|
<testcase name="testMissingWarningsWithData(first row)" classname="tst_Warnings" time="@TEST_DURATION@">
|
|
<failure type="fail" message="Not all expected messages were received"/>
|
|
<system-out>
|
|
<![CDATA[Did not receive message: "Warning0"]]>
|
|
<![CDATA[Did not receive message: "Warning1"]]>
|
|
</system-out>
|
|
</testcase>
|
|
<testcase name="testMissingWarningsWithData(second row)" classname="tst_Warnings" time="@TEST_DURATION@">
|
|
<failure type="fail" message="Not all expected messages were received"/>
|
|
<system-out>
|
|
<![CDATA[Did not receive message: "Warning0"]]>
|
|
<![CDATA[Did not receive message: "Warning1"]]>
|
|
</system-out>
|
|
</testcase>
|
|
<testcase name="testFailOnWarnings" classname="tst_Warnings" time="@TEST_DURATION@">
|
|
<failure type="fail" message="Received a warning that resulted in a failure:">
|
|
<![CDATA[Ran out of cabbage!]]>
|
|
</failure>
|
|
<system-out>
|
|
<![CDATA[Ran out of tortillas!]]>
|
|
<![CDATA[Ran out of oil!]]>
|
|
<![CDATA[Running low on toothpaste!]]>
|
|
<![CDATA[Running low on toothpaste!]]>
|
|
</system-out>
|
|
<system-err>
|
|
<![CDATA[Ran out of space!]]>
|
|
<![CDATA[nope]]>
|
|
<![CDATA[Running low on flour!]]>
|
|
</system-err>
|
|
</testcase>
|
|
<testcase name="testFailOnWarningsCleared" classname="tst_Warnings" time="@TEST_DURATION@">
|
|
<system-err>
|
|
<![CDATA[Ran out of muffins!]]>
|
|
</system-err>
|
|
</testcase>
|
|
<testcase name="testFailOnWarningsWithData(warning1)" classname="tst_Warnings" time="@TEST_DURATION@">
|
|
<failure type="fail" message="Received a warning that resulted in a failure:">
|
|
<![CDATA[warning1]]>
|
|
</failure>
|
|
<system-err>
|
|
<![CDATA[warning2]]>
|
|
<![CDATA[warning3]]>
|
|
</system-err>
|
|
</testcase>
|
|
<testcase name="testFailOnWarningsWithData(warning2)" classname="tst_Warnings" time="@TEST_DURATION@">
|
|
<failure type="fail" message="Received a warning that resulted in a failure:">
|
|
<![CDATA[warning2]]>
|
|
</failure>
|
|
<system-err>
|
|
<![CDATA[warning1]]>
|
|
<![CDATA[warning3]]>
|
|
</system-err>
|
|
</testcase>
|
|
<testcase name="testFailOnWarningsWithData(warning3)" classname="tst_Warnings" time="@TEST_DURATION@">
|
|
<failure type="fail" message="Received a warning that resulted in a failure:">
|
|
<![CDATA[warning3]]>
|
|
</failure>
|
|
<system-err>
|
|
<![CDATA[warning1]]>
|
|
<![CDATA[warning2]]>
|
|
</system-err>
|
|
</testcase>
|
|
<testcase name="testFailOnWarningsFailInHelper" classname="tst_Warnings" time="@TEST_DURATION@">
|
|
<failure type="fail" message="This failure message should be printed but not cause the test to abort"/>
|
|
</testcase>
|
|
<testcase name="testFailOnWarningsThenSkip" classname="tst_Warnings" time="@TEST_DURATION@">
|
|
<failure type="fail" message="Received a warning that resulted in a failure:">
|
|
<![CDATA[Ran out of cabbage!]]>
|
|
</failure>
|
|
<skipped message="My cabbage! :("/>
|
|
</testcase>
|
|
<testcase name="testFailOnWarningsAndIgnoreWarnings" classname="tst_Warnings" time="@TEST_DURATION@"/>
|
|
<testcase name="cleanupTestCase" classname="tst_Warnings" time="@TEST_DURATION@"/>
|
|
</testsuite>
|