qt5base-lts/tests/auto/testlib/selftests/expected_silent.xml
Tor Arne Vestbø fa8cffa4c9 testlib: Pass on file location on failure, but don't assume we have one
We try our best to pass on the file location of a failure, including for
fatal errors, but the reporting or logging machinery should not assume
there is one.

By passing on nullptr for the file location we allow the logging backends
to decide how to handle the situation, e.g. by not emitting extra fields
for failure location.

This effectively reverts c25687fa0b,
in favor of relying on the backends to cope with null filename,
which they already did.

As qFatal uses QMessageLogger, which by default disables file/line
information in release builds, we need to explicitly enable this in
our self-tests, to get uniform test results. Similarly, we disable
file/line info from testlib itself, as reporting Qt internal file
and line information for user diagnostics is less useful. The odd
one out there is qtestdata.cpp, which still ends up in test output
due to using QTEST_ASSERT instead of qFatal for its diagnostics.
Cleaning up that, and unifying how we report testlib issues to the
user, is left for another day.

Pick-to: 6.2
Change-Id: Ib9451b8eed86fe3ade4a4dcaf0037e1a3450321c
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-08-04 17:31:51 +00:00

70 lines
3.0 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<TestCase name="tst_Silent">
<Environment>
<QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion>
<QtBuild/>
<QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion>
</Environment>
<TestFunction name="initTestCase">
<Incident type="pass" file="" line="0" />
<Duration msecs="0"/>
</TestFunction>
<TestFunction name="pass">
<Incident type="pass" file="" line="0" />
<Duration msecs="0"/>
</TestFunction>
<TestFunction name="skip">
<Message type="skip" file="qtbase/tests/auto/testlib/selftests/silent/tst_silent.cpp" line="0">
<Description><![CDATA[This test should skip]]></Description>
</Message>
<Duration msecs="0"/>
</TestFunction>
<TestFunction name="fail">
<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/silent/tst_silent.cpp" line="0">
<Description><![CDATA['false' returned FALSE. (This test should fail)]]></Description>
</Incident>
<Duration msecs="0"/>
</TestFunction>
<TestFunction name="xfail">
<Incident type="xfail" file="qtbase/tests/auto/testlib/selftests/silent/tst_silent.cpp" line="0">
<Description><![CDATA[This test should XFAIL]]></Description>
</Incident>
<Incident type="pass" file="" line="0" />
<Duration msecs="0"/>
</TestFunction>
<TestFunction name="xpass">
<Incident type="xpass" file="qtbase/tests/auto/testlib/selftests/silent/tst_silent.cpp" line="0">
<Description><![CDATA['true' returned TRUE unexpectedly. (This test should XPASS)]]></Description>
</Incident>
<Duration msecs="0"/>
</TestFunction>
<TestFunction name="messages">
<Message type="qwarn" file="" line="0">
<Description><![CDATA[This is a warning that should not appear in silent test output]]></Description>
</Message>
<Message type="warn" file="qtbase/tests/auto/testlib/selftests/silent/tst_silent.cpp" line="0">
<Description><![CDATA[This is an internal testlib warning that should not appear in silent test output]]></Description>
</Message>
<Message type="qdebug" file="" line="0">
<Description><![CDATA[This is a debug message that should not appear in silent test output]]></Description>
</Message>
<Message type="system" file="" line="0">
<Description><![CDATA[This is a critical message that should not appear in silent test output]]></Description>
</Message>
<Message type="qinfo" file="" line="0">
<Description><![CDATA[This is an info message that should not appear in silent test output]]></Description>
</Message>
<Message type="info" file="qtbase/tests/auto/testlib/selftests/silent/tst_silent.cpp" line="0">
<Description><![CDATA[This is an internal testlib info message that should not appear in silent test output]]></Description>
</Message>
<Message type="qfatal" file="" line="0">
<Description><![CDATA[This is a fatal error message that should still appear in silent test output]]></Description>
</Message>
<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/silent/tst_silent.cpp" line="0">
<Description><![CDATA[Received a fatal error.]]></Description>
</Incident>
<Duration msecs="0"/>
</TestFunction>
<Duration msecs="0"/>
</TestCase>