testlib: Skip test function if init() fails.
authorJason McDonald <jason.mcdonald@nokia.com>
Thu, 16 Feb 2012 06:00:41 +0000 (16:00 +1000)
committerQt by Nokia <qt-info@nokia.com>
Fri, 17 Feb 2012 04:24:46 +0000 (05:24 +0100)
commit64642a4d9768b767c51c7f92dec94f655ba60195
tree15a950162fbfef346cc02c430966920c337f21b4
parent4121f9df29c85d45e0fe128d237c0009cded7574
testlib: Skip test function if init() fails.

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>
src/testlib/qtestcase.cpp
tests/auto/testlib/selftests/counting/tst_counting.cpp
tests/auto/testlib/selftests/expected_counting.lightxml
tests/auto/testlib/selftests/expected_counting.txt
tests/auto/testlib/selftests/expected_counting.xml
tests/auto/testlib/selftests/expected_counting.xunitxml