summaryrefslogtreecommitdiffstats
path: root/tests/auto/testlib/selftests/expected_blacklisted.tap
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@qt.io>2021-07-28 11:44:01 +0200
committerTor Arne Vestbø <tor.arne.vestbo@qt.io>2021-08-04 17:31:51 +0000
commitfa8cffa4c97d2e46de9af6f5e91af9212e372204 (patch)
tree1affb73d7b113acec05f4d92375b3be3aaca6d17 /tests/auto/testlib/selftests/expected_blacklisted.tap
parentbef57b317f2efc0e73f2275d594be9d69f5a75d0 (diff)
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 c25687fa0b6e4be043e1f8c92c093d8b06ca06c4, 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>
Diffstat (limited to 'tests/auto/testlib/selftests/expected_blacklisted.tap')
-rw-r--r--tests/auto/testlib/selftests/expected_blacklisted.tap4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/auto/testlib/selftests/expected_blacklisted.tap b/tests/auto/testlib/selftests/expected_blacklisted.tap
index 8107939e6d..2c96bec472 100644
--- a/tests/auto/testlib/selftests/expected_blacklisted.tap
+++ b/tests/auto/testlib/selftests/expected_blacklisted.tap
@@ -34,8 +34,8 @@ ok 7 - xpass() # TODO 'true' returned TRUE unexpectedly. (This test should BXPAS
not ok 8 - messages() # TODO Received a fatal error.
---
# Received a fatal error.
- at: tst_Blacklisted::messages() (Unknown file:0)
- file: Unknown file
+ at: tst_Blacklisted::messages() (qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp:0)
+ file: qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp
line: 0
...
1..8