fa8cffa4c9
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>
97 lines
3.8 KiB
Plaintext
97 lines
3.8 KiB
Plaintext
TAP version 13
|
|
# tst_ExpectFail
|
|
ok 1 - initTestCase()
|
|
# begin
|
|
not ok 2 - xfailAndContinue() # TODO This should xfail
|
|
---
|
|
at: tst_ExpectFail::xfailAndContinue() (qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp:0)
|
|
file: qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp
|
|
line: 0
|
|
...
|
|
# after
|
|
# begin
|
|
not ok 3 - xfailAndAbort() # TODO This should xfail
|
|
---
|
|
at: tst_ExpectFail::xfailAndAbort() (qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp:0)
|
|
file: qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp
|
|
line: 0
|
|
...
|
|
not ok 4 - xfailTwice()
|
|
---
|
|
# Already expecting a fail
|
|
at: tst_ExpectFail::xfailTwice() (qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp:0)
|
|
file: qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp
|
|
line: 0
|
|
...
|
|
not ok 5 - xfailWithQString() # TODO A string
|
|
---
|
|
at: tst_ExpectFail::xfailWithQString() (qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp:0)
|
|
file: qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp
|
|
line: 0
|
|
...
|
|
not ok 5 - xfailWithQString() # TODO Bug 5 (The message)
|
|
---
|
|
at: tst_ExpectFail::xfailWithQString() (qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp:0)
|
|
file: qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp
|
|
line: 0
|
|
...
|
|
ok 6 - xfailDataDrivenWithQVerify(Pass 1)
|
|
ok 7 - xfailDataDrivenWithQVerify(Pass 2)
|
|
not ok 8 - xfailDataDrivenWithQVerify(Abort) # TODO This test should xfail
|
|
---
|
|
at: tst_ExpectFail::xfailDataDrivenWithQVerify() (qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp:0)
|
|
file: qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp
|
|
line: 0
|
|
...
|
|
not ok 9 - xfailDataDrivenWithQVerify(Continue) # TODO This test should xfail
|
|
---
|
|
at: tst_ExpectFail::xfailDataDrivenWithQVerify() (qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp:0)
|
|
file: qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp
|
|
line: 0
|
|
...
|
|
ok 10 - xfailDataDrivenWithQCompare(Pass 1)
|
|
ok 11 - xfailDataDrivenWithQCompare(Pass 2)
|
|
not ok 12 - xfailDataDrivenWithQCompare(Abort) # TODO This test should xfail
|
|
---
|
|
at: tst_ExpectFail::xfailDataDrivenWithQCompare() (qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp:0)
|
|
file: qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp
|
|
line: 0
|
|
...
|
|
not ok 13 - xfailDataDrivenWithQCompare(Continue) # TODO This test should xfail
|
|
---
|
|
at: tst_ExpectFail::xfailDataDrivenWithQCompare() (qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp:0)
|
|
file: qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp
|
|
line: 0
|
|
...
|
|
ok 14 - xfailOnWrongRow(right row)
|
|
not ok 15 - xfailOnAnyRow(first row) # TODO This test should xfail
|
|
---
|
|
at: tst_ExpectFail::xfailOnAnyRow() (qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp:0)
|
|
file: qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp
|
|
line: 0
|
|
...
|
|
not ok 16 - xfailOnAnyRow(second row) # TODO This test should xfail
|
|
---
|
|
at: tst_ExpectFail::xfailOnAnyRow() (qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp:0)
|
|
file: qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp
|
|
line: 0
|
|
...
|
|
not ok 17 - xfailWithoutVerify(first row)
|
|
---
|
|
# QEXPECT_FAIL was called without any subsequent verification statements
|
|
...
|
|
not ok 18 - xfailWithoutVerify(second row)
|
|
---
|
|
# QEXPECT_FAIL was called without any subsequent verification statements
|
|
...
|
|
ok 19 - xpass() # TODO 'true' returned TRUE unexpectedly. ()
|
|
ok 20 - xpassDataDrivenWithQVerify(XPass) # TODO 'true' returned TRUE unexpectedly. ()
|
|
ok 21 - xpassDataDrivenWithQVerify(Pass)
|
|
ok 22 - xpassDataDrivenWithQCompare(XPass) # TODO QCOMPARE(1, 1) returned TRUE unexpectedly.
|
|
ok 23 - xpassDataDrivenWithQCompare(Pass)
|
|
ok 24 - cleanupTestCase()
|
|
1..24
|
|
# tests 24
|
|
# pass 18
|
|
# fail 6
|