qt5base-lts/tests/auto/testlib/selftests/expected_verbose2.xunitxml
Jason McDonald d81b065bb3 testlib: Improve verbose and XPASS output
Previously, verbose (-v2) and XPASS test output showed all QCOMPAREs as
"COMPARE()", making it impossible to see what was compared and difficult
to match the output to the source of a test containing many calls to
QCOMPARE.

This commit changes testlib's internal compare_helper API so that string
representations of the compared expressions are always passed to
QTestResult::compare() when available, and can thus be shown in the
verbose and XPASS output.  The XPASS output has also been changed to
state explicitly that the comparison succeeded unexpectedly, bringing it
in line with the XPASS output resulting from a call to QVERIFY.

This commit also changes all calls to compare_helper() to call the
eight-argument version of the function, which simplifies much of the
calling code.  The now obsolete four-argument version of
compare_helper() has been changed to output a warning that it is
obsolete.  It will be removed once other modules have had some time to
catch up.

The improved XPASS and verbose output is demonstrated by the expectfail
and verbose2 selftests.

Change-Id: I8baa46d5dd30e6c43b26f366c34dc5b64aab5f7c
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-03-08 05:31:40 +01:00

102 lines
4.4 KiB
XML

<?xml version="1.0" encoding="UTF-8" ?>
<testsuite errors="28" 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">
<!-- tag="row 1" message="QVERIFY(true)" type="info" -->
<!-- tag="row 1" message="QCOMPARE(2 + 1, 3)" type="info" -->
<!-- tag="row 2" message="QVERIFY(true)" type="info" -->
<!-- tag="row 2" message="QCOMPARE(2 + 1, 3)" type="info" -->
</testcase>
<testcase result="pass" name="testPassSkip">
<!-- tag="row 1" message="QVERIFY(true)" type="info" -->
<!-- tag="row 1" message="QCOMPARE(2 + 1, 3)" type="info" -->
<!-- tag="row 2" message="Skipping" type="skip" -->
</testcase>
<testcase result="fail" name="testPassFail">
<!-- tag="row 1" message="QVERIFY(true)" type="info" -->
<!-- tag="row 1" message="QCOMPARE(2 + 1, 3)" type="info" -->
<!-- tag="row 2" message="QVERIFY(false)" type="info" -->
<failure tag="row 2" message="&apos;false&apos; returned FALSE. ()" result="fail"/>
</testcase>
<testcase result="pass" name="testSkipPass">
<!-- tag="row 1" message="Skipping" type="skip" -->
<!-- tag="row 2" message="QVERIFY(true)" type="info" -->
<!-- tag="row 2" message="QCOMPARE(2 + 1, 3)" type="info" -->
</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" -->
<!-- tag="row 2" message="QVERIFY(false)" type="info" -->
<failure tag="row 2" message="&apos;false&apos; returned FALSE. ()" result="fail"/>
</testcase>
<testcase result="fail" name="testFailPass">
<!-- tag="row 1" message="QVERIFY(false)" type="info" -->
<failure tag="row 1" message="&apos;false&apos; returned FALSE. ()" result="fail"/>
<!-- tag="row 2" message="QVERIFY(true)" type="info" -->
<!-- tag="row 2" message="QCOMPARE(2 + 1, 3)" type="info" -->
</testcase>
<testcase result="fail" name="testFailSkip">
<!-- tag="row 1" message="QVERIFY(false)" type="info" -->
<failure tag="row 1" message="&apos;false&apos; returned FALSE. ()" result="fail"/>
<!-- tag="row 2" message="Skipping" type="skip" -->
</testcase>
<testcase result="fail" name="testFailFail">
<!-- tag="row 1" message="QVERIFY(false)" type="info" -->
<failure tag="row 1" message="&apos;false&apos; returned FALSE. ()" result="fail"/>
<!-- tag="row 2" message="QVERIFY(false)" type="info" -->
<failure tag="row 2" message="&apos;false&apos; 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[QVERIFY(true)]]>
<![CDATA[QCOMPARE(2 + 1, 3)]]>
<![CDATA[QVERIFY(true)]]>
<![CDATA[QCOMPARE(2 + 1, 3)]]>
<![CDATA[QVERIFY(true)]]>
<![CDATA[QCOMPARE(2 + 1, 3)]]>
<![CDATA[Skipping]]>
<![CDATA[QVERIFY(true)]]>
<![CDATA[QCOMPARE(2 + 1, 3)]]>
<![CDATA[QVERIFY(false)]]>
<![CDATA[Skipping]]>
<![CDATA[QVERIFY(true)]]>
<![CDATA[QCOMPARE(2 + 1, 3)]]>
<![CDATA[Skipping]]>
<![CDATA[Skipping]]>
<![CDATA[Skipping]]>
<![CDATA[QVERIFY(false)]]>
<![CDATA[QVERIFY(false)]]>
<![CDATA[QVERIFY(true)]]>
<![CDATA[QCOMPARE(2 + 1, 3)]]>
<![CDATA[QVERIFY(false)]]>
<![CDATA[Skipping]]>
<![CDATA[QVERIFY(false)]]>
<![CDATA[QVERIFY(false)]]>
<![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>