qt5base-lts/tests/auto/testlib/selftests/expected_junit.junitxml
Tor Arne Vestbø bef57b317f testlib: Deprecate QWARN() in favor of qWarning()
The QtTest best practices documentations recommends using output
mechanisms such as qDebug() and qWarning() for diagnostic messages,
and this is also what most of our own tests do.

The QWARN() macro and corresponding internal QTest::qWarn() function
was added when QtTest was first implemented, but was likely meant as
an internal implementation detail, like its cousin QTestLog::info(),
which does not have any corresponding macro.

This theory is backed by our own QtTest self-test (tst_silent)
describing the output from QWARN() as "an internal testlib warning".

The only difference between QWARN() and qWarning(), besides the much
richer feature set of the latter, is that qWarning() will not pass
on file and line number information in release mode, but QWARN() will.
This is an acceptable loss of functionality, considering that the user
can override this behavior by defining QT_MESSAGELOGCONTEXT.

[ChangeLog][QtTest] QWARN() has been deprecated in favor of qWarning()

Pick-to: 6.2
Change-Id: I5a2431ce48c47392244560dd520953b9fc735c85
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-08-04 19:31:51 +02:00

44 lines
1.9 KiB
XML

<?xml version="1.0" encoding="UTF-8" ?>
<testsuite name="tst_JUnit" timestamp="@TEST_START_TIME@" tests="9" failures="3" errors="5" 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" result="pass" time="@TEST_DURATION@"/>
<testcase name="testFunc1" result="pass" time="@TEST_DURATION@">
<!-- type="qwarn" message="just a qWarning() !" -->
</testcase>
<testcase name="testFunc2" result="fail" time="@TEST_DURATION@">
<!-- type="qdebug" message="a qDebug() call with comment&#x002D;ending stuff &#x002D;&#x002D;&gt;" -->
<failure result="fail" message="Compared values are not the same
Actual (2): 2
Expected (3): 3"/>
</testcase>
<testcase name="testFunc3" time="@TEST_DURATION@">
<!-- type="skip" message="skipping this function!" -->
</testcase>
<testcase name="testFunc4" result="fail" time="@TEST_DURATION@">
<failure result="fail" message="a forced failure!"/>
</testcase>
<testcase name="testFunc5" result="xfail" time="@TEST_DURATION@">
<!-- type="info" message="this failure is expected" -->
</testcase>
<testcase name="testFunc6" result="xfail" time="@TEST_DURATION@">
<!-- type="info" message="this failure is also expected" -->
</testcase>
<testcase name="testFunc7" result="xpass" time="@TEST_DURATION@">
<failure result="xpass" message="&apos;true&apos; returned TRUE unexpectedly. ()"/>
</testcase>
<testcase name="cleanupTestCase" result="pass" time="@TEST_DURATION@"/>
<system-out>
<![CDATA[a qDebug() call with comment-ending stuff -->]]>
<![CDATA[skipping this function!]]>
<![CDATA[this failure is expected]]>
<![CDATA[this failure is also expected]]>
</system-out>
<system-err>
<![CDATA[just a qWarning() !]]>
</system-err>
</testsuite>