64642a4d97
Prior to this commit, the following statement in the qtestlib documentation was untrue: "If init() fails, the following testfunction will not be executed, the test will proceed to the next testfunction." If init() called QSKIP, the test function would be skipped, but if init() reported a failure, the test function would still be executed (even though doing so could be unsafe). This commit makes testlib skip a test function if init() reports a failure and enhances the selftests to cover skips and fails in both init() and cleanup(). Task-number: QTBUG-20371 Change-Id: Id1cc8464ae0b8c257ae1b74dbe9189a501f5366b Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
65 lines
2.8 KiB
XML
65 lines
2.8 KiB
XML
<?xml version="1.0" encoding="UTF-8" ?>
|
|
<testsuite errors="10" failures="8" tests="15" name="tst_Counting">
|
|
<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="testPassPass"/>
|
|
<testcase result="pass" name="testPassSkip">
|
|
<!-- tag="row 2" message="Skipping" type="skip" -->
|
|
</testcase>
|
|
<testcase result="fail" name="testPassFail">
|
|
<failure tag="row 2" message="'false' returned FALSE. ()" result="fail"/>
|
|
</testcase>
|
|
<testcase result="pass" name="testSkipPass">
|
|
<!-- tag="row 1" message="Skipping" type="skip" -->
|
|
</testcase>
|
|
<testcase name="testSkipSkip">
|
|
<!-- tag="row 1" message="Skipping" type="skip" -->
|
|
<!-- tag="row 2" message="Skipping" type="skip" -->
|
|
</testcase>
|
|
<testcase result="fail" name="testSkipFail">
|
|
<!-- tag="row 1" message="Skipping" type="skip" -->
|
|
<failure tag="row 2" message="'false' returned FALSE. ()" result="fail"/>
|
|
</testcase>
|
|
<testcase result="fail" name="testFailPass">
|
|
<failure tag="row 1" message="'false' returned FALSE. ()" result="fail"/>
|
|
</testcase>
|
|
<testcase result="fail" name="testFailSkip">
|
|
<failure tag="row 1" message="'false' returned FALSE. ()" result="fail"/>
|
|
<!-- tag="row 2" message="Skipping" type="skip" -->
|
|
</testcase>
|
|
<testcase result="fail" name="testFailFail">
|
|
<failure tag="row 1" message="'false' returned FALSE. ()" result="fail"/>
|
|
<failure tag="row 2" message="'false' returned FALSE. ()" result="fail"/>
|
|
</testcase>
|
|
<testcase result="fail" name="testFailInInit">
|
|
<failure tag="fail" message="Fail in init()" result="fail"/>
|
|
</testcase>
|
|
<testcase result="fail" name="testFailInCleanup">
|
|
<!-- tag="fail" message="This test function should execute and then QFAIL in cleanup() " type="qdebug" -->
|
|
<failure tag="fail" message="Fail in cleanup()" result="fail"/>
|
|
</testcase>
|
|
<testcase result="pass" name="testSkipInInit">
|
|
<!-- tag="skip" message="Skip in init()" type="skip" -->
|
|
</testcase>
|
|
<testcase result="pass" name="testSkipInCleanup">
|
|
<!-- tag="skip" message="This test function should execute and then QSKIP in cleanup() " type="qdebug" -->
|
|
<!-- tag="skip" message="Skip in cleanup()" type="skip" -->
|
|
</testcase>
|
|
<testcase result="pass" name="cleanupTestCase"/>
|
|
<system-err>
|
|
<![CDATA[Skipping]]>
|
|
<![CDATA[Skipping]]>
|
|
<![CDATA[Skipping]]>
|
|
<![CDATA[Skipping]]>
|
|
<![CDATA[Skipping]]>
|
|
<![CDATA[Skipping]]>
|
|
<![CDATA[This test function should execute and then QFAIL in cleanup() ]]>
|
|
<![CDATA[Skip in init()]]>
|
|
<![CDATA[This test function should execute and then QSKIP in cleanup() ]]>
|
|
<![CDATA[Skip in cleanup()]]>
|
|
</system-err>
|
|
</testsuite>
|