QTestResult: Don't pass a nullptr file to addFailure()

addBFail() asserts on the file being non-null. The convention seems to
be "Unknown File" for cases where we cannot determine the file.

Change-Id: I3a4d0130352d77d75f264fad6f3bd47c6700ef4c
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
This commit is contained in:
Ulf Hermann 2020-09-30 10:07:14 +02:00
parent 2044992eed
commit c25687fa0b
7 changed files with 84 additions and 58 deletions

View File

@ -134,13 +134,15 @@ static void clearExpectFail()
void QTestResult::finishedCurrentTestData()
{
if (QTest::expectFailMode)
addFailure("QEXPECT_FAIL was called without any subsequent verification statements", nullptr, 0);
if (QTest::expectFailMode) {
addFailure("QEXPECT_FAIL was called without any subsequent verification statements",
"Unknown File", 0);
}
clearExpectFail();
if (!QTest::failed && QTestLog::unhandledIgnoreMessages()) {
QTestLog::printUnhandledIgnoreMessages();
addFailure("Not all expected messages were received", nullptr, 0);
addFailure("Not all expected messages were received", "Unknown File", 0);
}
QTestLog::clearIgnoreMessages();
}

View File

@ -4,85 +4,91 @@ 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)
at: tst_ExpectFail::xfailAndContinue() (qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp:65)
file: qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp
line: 0
line: 65
...
# after
# begin
not ok 3 - xfailAndAbort() # TODO This should xfail
---
at: tst_ExpectFail::xfailAndAbort() (qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp:0)
at: tst_ExpectFail::xfailAndAbort() (qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp:73)
file: qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp
line: 0
line: 73
...
not ok 4 - xfailTwice()
---
# Already expecting a fail
at: tst_ExpectFail::xfailTwice() (qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp:0)
at: tst_ExpectFail::xfailTwice() (qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp:83)
file: qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp
line: 0
line: 83
...
not ok 5 - xfailWithQString() # TODO A string
---
at: tst_ExpectFail::xfailWithQString() (qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp:0)
at: tst_ExpectFail::xfailWithQString() (qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp:92)
file: qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp
line: 0
line: 92
...
not ok 5 - xfailWithQString() # TODO Bug 5 (The message)
---
at: tst_ExpectFail::xfailWithQString() (qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp:0)
at: tst_ExpectFail::xfailWithQString() (qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp:97)
file: qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp
line: 0
line: 97
...
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)
at: tst_ExpectFail::xfailDataDrivenWithQVerify() (qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp:126)
file: qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp
line: 0
line: 126
...
not ok 9 - xfailDataDrivenWithQVerify(Continue) # TODO This test should xfail
---
at: tst_ExpectFail::xfailDataDrivenWithQVerify() (qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp:0)
at: tst_ExpectFail::xfailDataDrivenWithQVerify() (qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp:126)
file: qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp
line: 0
line: 126
...
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)
at: tst_ExpectFail::xfailDataDrivenWithQCompare() (qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp:160)
file: qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp
line: 0
line: 160
...
not ok 13 - xfailDataDrivenWithQCompare(Continue) # TODO This test should xfail
---
at: tst_ExpectFail::xfailDataDrivenWithQCompare() (qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp:0)
at: tst_ExpectFail::xfailDataDrivenWithQCompare() (qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp:160)
file: qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp
line: 0
line: 160
...
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)
at: tst_ExpectFail::xfailOnAnyRow() (qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp:195)
file: qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp
line: 0
line: 195
...
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)
at: tst_ExpectFail::xfailOnAnyRow() (qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp:195)
file: qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp
line: 0
line: 195
...
not ok 17 - xfailWithoutVerify(first row)
---
# QEXPECT_FAIL was called without any subsequent verification statements
at: tst_ExpectFail::xfailWithoutVerify() (Unknown File:0)
file: Unknown File
line: 0
...
not ok 18 - xfailWithoutVerify(second row)
---
# QEXPECT_FAIL was called without any subsequent verification statements
at: tst_ExpectFail::xfailWithoutVerify() (Unknown File:0)
file: Unknown File
line: 0
...
ok 19 - xpass() # TODO 'true' returned TRUE unexpectedly. ()
ok 20 - xpassDataDrivenWithQVerify(XPass) # TODO 'true' returned TRUE unexpectedly. ()

View File

@ -2,61 +2,61 @@
##teamcity[testStarted name='initTestCase()' flowId='tst_ExpectFail']
##teamcity[testFinished name='initTestCase()' flowId='tst_ExpectFail']
##teamcity[testStarted name='xfailAndContinue()' flowId='tst_ExpectFail']
##teamcity[testStdOut name='xfailAndContinue()' out='QDEBUG: begin|nXFAIL |[Loc: qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(0)|]: This should xfail|nQDEBUG: after' flowId='tst_ExpectFail']
##teamcity[testStdOut name='xfailAndContinue()' out='QDEBUG: begin|nXFAIL |[Loc: qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(65)|]: This should xfail|nQDEBUG: after' flowId='tst_ExpectFail']
##teamcity[testFinished name='xfailAndContinue()' flowId='tst_ExpectFail']
##teamcity[testStarted name='xfailAndAbort()' flowId='tst_ExpectFail']
##teamcity[testStdOut name='xfailAndAbort()' out='QDEBUG: begin|nXFAIL |[Loc: qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(0)|]: This should xfail' flowId='tst_ExpectFail']
##teamcity[testStdOut name='xfailAndAbort()' out='QDEBUG: begin|nXFAIL |[Loc: qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(73)|]: This should xfail' flowId='tst_ExpectFail']
##teamcity[testFinished name='xfailAndAbort()' flowId='tst_ExpectFail']
##teamcity[testStarted name='xfailTwice()' flowId='tst_ExpectFail']
##teamcity[testFailed name='xfailTwice()' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(0)|]' details='Already expecting a fail' flowId='tst_ExpectFail']
##teamcity[testFailed name='xfailTwice()' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(83)|]' details='Already expecting a fail' flowId='tst_ExpectFail']
##teamcity[testFinished name='xfailTwice()' flowId='tst_ExpectFail']
##teamcity[testStarted name='xfailWithQString()' flowId='tst_ExpectFail']
##teamcity[testStdOut name='xfailWithQString()' out='XFAIL |[Loc: qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(0)|]: A string|nXFAIL |[Loc: qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(0)|]: Bug 5 (The message)' flowId='tst_ExpectFail']
##teamcity[testStdOut name='xfailWithQString()' out='XFAIL |[Loc: qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(92)|]: A string|nXFAIL |[Loc: qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(97)|]: Bug 5 (The message)' flowId='tst_ExpectFail']
##teamcity[testFinished name='xfailWithQString()' flowId='tst_ExpectFail']
##teamcity[testStarted name='xfailDataDrivenWithQVerify(Pass 1)' flowId='tst_ExpectFail']
##teamcity[testFinished name='xfailDataDrivenWithQVerify(Pass 1)' flowId='tst_ExpectFail']
##teamcity[testStarted name='xfailDataDrivenWithQVerify(Pass 2)' flowId='tst_ExpectFail']
##teamcity[testFinished name='xfailDataDrivenWithQVerify(Pass 2)' flowId='tst_ExpectFail']
##teamcity[testStarted name='xfailDataDrivenWithQVerify(Abort)' flowId='tst_ExpectFail']
##teamcity[testStdOut name='xfailDataDrivenWithQVerify(Abort)' out='XFAIL |[Loc: qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(0)|]: This test should xfail' flowId='tst_ExpectFail']
##teamcity[testStdOut name='xfailDataDrivenWithQVerify(Abort)' out='XFAIL |[Loc: qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(126)|]: This test should xfail' flowId='tst_ExpectFail']
##teamcity[testFinished name='xfailDataDrivenWithQVerify(Abort)' flowId='tst_ExpectFail']
##teamcity[testStarted name='xfailDataDrivenWithQVerify(Continue)' flowId='tst_ExpectFail']
##teamcity[testStdOut name='xfailDataDrivenWithQVerify(Continue)' out='XFAIL |[Loc: qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(0)|]: This test should xfail' flowId='tst_ExpectFail']
##teamcity[testStdOut name='xfailDataDrivenWithQVerify(Continue)' out='XFAIL |[Loc: qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(126)|]: This test should xfail' flowId='tst_ExpectFail']
##teamcity[testFinished name='xfailDataDrivenWithQVerify(Continue)' flowId='tst_ExpectFail']
##teamcity[testStarted name='xfailDataDrivenWithQCompare(Pass 1)' flowId='tst_ExpectFail']
##teamcity[testFinished name='xfailDataDrivenWithQCompare(Pass 1)' flowId='tst_ExpectFail']
##teamcity[testStarted name='xfailDataDrivenWithQCompare(Pass 2)' flowId='tst_ExpectFail']
##teamcity[testFinished name='xfailDataDrivenWithQCompare(Pass 2)' flowId='tst_ExpectFail']
##teamcity[testStarted name='xfailDataDrivenWithQCompare(Abort)' flowId='tst_ExpectFail']
##teamcity[testStdOut name='xfailDataDrivenWithQCompare(Abort)' out='XFAIL |[Loc: qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(0)|]: This test should xfail' flowId='tst_ExpectFail']
##teamcity[testStdOut name='xfailDataDrivenWithQCompare(Abort)' out='XFAIL |[Loc: qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(160)|]: This test should xfail' flowId='tst_ExpectFail']
##teamcity[testFinished name='xfailDataDrivenWithQCompare(Abort)' flowId='tst_ExpectFail']
##teamcity[testStarted name='xfailDataDrivenWithQCompare(Continue)' flowId='tst_ExpectFail']
##teamcity[testStdOut name='xfailDataDrivenWithQCompare(Continue)' out='XFAIL |[Loc: qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(0)|]: This test should xfail' flowId='tst_ExpectFail']
##teamcity[testStdOut name='xfailDataDrivenWithQCompare(Continue)' out='XFAIL |[Loc: qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(160)|]: This test should xfail' flowId='tst_ExpectFail']
##teamcity[testFinished name='xfailDataDrivenWithQCompare(Continue)' flowId='tst_ExpectFail']
##teamcity[testStarted name='xfailOnWrongRow(right row)' flowId='tst_ExpectFail']
##teamcity[testFinished name='xfailOnWrongRow(right row)' flowId='tst_ExpectFail']
##teamcity[testStarted name='xfailOnAnyRow(first row)' flowId='tst_ExpectFail']
##teamcity[testStdOut name='xfailOnAnyRow(first row)' out='XFAIL |[Loc: qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(0)|]: This test should xfail' flowId='tst_ExpectFail']
##teamcity[testStdOut name='xfailOnAnyRow(first row)' out='XFAIL |[Loc: qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(195)|]: This test should xfail' flowId='tst_ExpectFail']
##teamcity[testFinished name='xfailOnAnyRow(first row)' flowId='tst_ExpectFail']
##teamcity[testStarted name='xfailOnAnyRow(second row)' flowId='tst_ExpectFail']
##teamcity[testStdOut name='xfailOnAnyRow(second row)' out='XFAIL |[Loc: qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(0)|]: This test should xfail' flowId='tst_ExpectFail']
##teamcity[testStdOut name='xfailOnAnyRow(second row)' out='XFAIL |[Loc: qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(195)|]: This test should xfail' flowId='tst_ExpectFail']
##teamcity[testFinished name='xfailOnAnyRow(second row)' flowId='tst_ExpectFail']
##teamcity[testStarted name='xfailWithoutVerify(first row)' flowId='tst_ExpectFail']
##teamcity[testFailed name='xfailWithoutVerify(first row)' message='Failure!' details='QEXPECT_FAIL was called without any subsequent verification statements' flowId='tst_ExpectFail']
##teamcity[testFailed name='xfailWithoutVerify(first row)' message='Failure! |[Loc: Unknown File(0)|]' details='QEXPECT_FAIL was called without any subsequent verification statements' flowId='tst_ExpectFail']
##teamcity[testFinished name='xfailWithoutVerify(first row)' flowId='tst_ExpectFail']
##teamcity[testStarted name='xfailWithoutVerify(second row)' flowId='tst_ExpectFail']
##teamcity[testFailed name='xfailWithoutVerify(second row)' message='Failure!' details='QEXPECT_FAIL was called without any subsequent verification statements' flowId='tst_ExpectFail']
##teamcity[testFailed name='xfailWithoutVerify(second row)' message='Failure! |[Loc: Unknown File(0)|]' details='QEXPECT_FAIL was called without any subsequent verification statements' flowId='tst_ExpectFail']
##teamcity[testFinished name='xfailWithoutVerify(second row)' flowId='tst_ExpectFail']
##teamcity[testStarted name='xpass()' flowId='tst_ExpectFail']
##teamcity[testFailed name='xpass()' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(0)|]' details='|'true|' returned TRUE unexpectedly. ()' flowId='tst_ExpectFail']
##teamcity[testFailed name='xpass()' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(215)|]' details='|'true|' returned TRUE unexpectedly. ()' flowId='tst_ExpectFail']
##teamcity[testFinished name='xpass()' flowId='tst_ExpectFail']
##teamcity[testStarted name='xpassDataDrivenWithQVerify(XPass)' flowId='tst_ExpectFail']
##teamcity[testFailed name='xpassDataDrivenWithQVerify(XPass)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(0)|]' details='|'true|' returned TRUE unexpectedly. ()' flowId='tst_ExpectFail']
##teamcity[testFailed name='xpassDataDrivenWithQVerify(XPass)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(237)|]' details='|'true|' returned TRUE unexpectedly. ()' flowId='tst_ExpectFail']
##teamcity[testFinished name='xpassDataDrivenWithQVerify(XPass)' flowId='tst_ExpectFail']
##teamcity[testStarted name='xpassDataDrivenWithQVerify(Pass)' flowId='tst_ExpectFail']
##teamcity[testFinished name='xpassDataDrivenWithQVerify(Pass)' flowId='tst_ExpectFail']
##teamcity[testStarted name='xpassDataDrivenWithQCompare(XPass)' flowId='tst_ExpectFail']
##teamcity[testFailed name='xpassDataDrivenWithQCompare(XPass)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(0)|]' details='QCOMPARE(1, 1) returned TRUE unexpectedly.' flowId='tst_ExpectFail']
##teamcity[testFailed name='xpassDataDrivenWithQCompare(XPass)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(258)|]' details='QCOMPARE(1, 1) returned TRUE unexpectedly.' flowId='tst_ExpectFail']
##teamcity[testFinished name='xpassDataDrivenWithQCompare(XPass)' flowId='tst_ExpectFail']
##teamcity[testStarted name='xpassDataDrivenWithQCompare(Pass)' flowId='tst_ExpectFail']
##teamcity[testFinished name='xpassDataDrivenWithQCompare(Pass)' flowId='tst_ExpectFail']

View File

@ -3,52 +3,54 @@ Config: Using QtTest library
PASS : tst_ExpectFail::initTestCase()
QDEBUG : tst_ExpectFail::xfailAndContinue() begin
XFAIL : tst_ExpectFail::xfailAndContinue() This should xfail
Loc: [qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(0)]
Loc: [qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(65)]
QDEBUG : tst_ExpectFail::xfailAndContinue() after
PASS : tst_ExpectFail::xfailAndContinue()
QDEBUG : tst_ExpectFail::xfailAndAbort() begin
XFAIL : tst_ExpectFail::xfailAndAbort() This should xfail
Loc: [qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(0)]
Loc: [qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(73)]
PASS : tst_ExpectFail::xfailAndAbort()
FAIL! : tst_ExpectFail::xfailTwice() Already expecting a fail
Loc: [qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(0)]
Loc: [qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(83)]
XFAIL : tst_ExpectFail::xfailWithQString() A string
Loc: [qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(0)]
Loc: [qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(92)]
XFAIL : tst_ExpectFail::xfailWithQString() Bug 5 (The message)
Loc: [qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(0)]
Loc: [qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(97)]
PASS : tst_ExpectFail::xfailWithQString()
PASS : tst_ExpectFail::xfailDataDrivenWithQVerify(Pass 1)
PASS : tst_ExpectFail::xfailDataDrivenWithQVerify(Pass 2)
XFAIL : tst_ExpectFail::xfailDataDrivenWithQVerify(Abort) This test should xfail
Loc: [qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(0)]
Loc: [qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(126)]
PASS : tst_ExpectFail::xfailDataDrivenWithQVerify(Abort)
XFAIL : tst_ExpectFail::xfailDataDrivenWithQVerify(Continue) This test should xfail
Loc: [qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(0)]
Loc: [qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(126)]
PASS : tst_ExpectFail::xfailDataDrivenWithQVerify(Continue)
PASS : tst_ExpectFail::xfailDataDrivenWithQCompare(Pass 1)
PASS : tst_ExpectFail::xfailDataDrivenWithQCompare(Pass 2)
XFAIL : tst_ExpectFail::xfailDataDrivenWithQCompare(Abort) This test should xfail
Loc: [qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(0)]
Loc: [qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(160)]
PASS : tst_ExpectFail::xfailDataDrivenWithQCompare(Abort)
XFAIL : tst_ExpectFail::xfailDataDrivenWithQCompare(Continue) This test should xfail
Loc: [qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(0)]
Loc: [qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(160)]
PASS : tst_ExpectFail::xfailDataDrivenWithQCompare(Continue)
PASS : tst_ExpectFail::xfailOnWrongRow(right row)
XFAIL : tst_ExpectFail::xfailOnAnyRow(first row) This test should xfail
Loc: [qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(0)]
Loc: [qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(195)]
PASS : tst_ExpectFail::xfailOnAnyRow(first row)
XFAIL : tst_ExpectFail::xfailOnAnyRow(second row) This test should xfail
Loc: [qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(0)]
Loc: [qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(195)]
PASS : tst_ExpectFail::xfailOnAnyRow(second row)
FAIL! : tst_ExpectFail::xfailWithoutVerify(first row) QEXPECT_FAIL was called without any subsequent verification statements
Loc: [Unknown File(0)]
FAIL! : tst_ExpectFail::xfailWithoutVerify(second row) QEXPECT_FAIL was called without any subsequent verification statements
Loc: [Unknown File(0)]
XPASS : tst_ExpectFail::xpass() 'true' returned TRUE unexpectedly. ()
Loc: [qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(0)]
Loc: [qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(215)]
XPASS : tst_ExpectFail::xpassDataDrivenWithQVerify(XPass) 'true' returned TRUE unexpectedly. ()
Loc: [qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(0)]
Loc: [qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(237)]
PASS : tst_ExpectFail::xpassDataDrivenWithQVerify(Pass)
XPASS : tst_ExpectFail::xpassDataDrivenWithQCompare(XPass) QCOMPARE(1, 1) returned TRUE unexpectedly.
Loc: [qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(0)]
Loc: [qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(258)]
PASS : tst_ExpectFail::xpassDataDrivenWithQCompare(Pass)
PASS : tst_ExpectFail::cleanupTestCase()
Totals: 18 passed, 6 failed, 0 skipped, 0 blacklisted, 0ms

View File

@ -17,23 +17,35 @@ ok 2 - testWarnings()
not ok 3 - testMissingWarnings()
---
# Not all expected messages were received
at: tst_Warnings::testMissingWarnings() (Unknown File:0)
file: Unknown File
line: 0
...
# Did not receive any message matching: "Warning\s\d"
not ok 4 - testMissingWarningsRegularExpression()
---
# Not all expected messages were received
at: tst_Warnings::testMissingWarningsRegularExpression() (Unknown File:0)
file: Unknown File
line: 0
...
# Did not receive message: "Warning0"
# Did not receive message: "Warning1"
not ok 5 - testMissingWarningsWithData(first row)
---
# Not all expected messages were received
at: tst_Warnings::testMissingWarningsWithData() (Unknown File:0)
file: Unknown File
line: 0
...
# Did not receive message: "Warning0"
# Did not receive message: "Warning1"
not ok 6 - testMissingWarningsWithData(second row)
---
# Not all expected messages were received
at: tst_Warnings::testMissingWarningsWithData() (Unknown File:0)
file: Unknown File
line: 0
...
ok 7 - cleanupTestCase()
1..7

View File

@ -5,19 +5,19 @@
##teamcity[testStdOut name='testWarnings()' out='QWARN: Warning|nQWARN: Warning|nQDEBUG: Debug|nQDEBUG: Debug|nQINFO: Info|nQINFO: Info|nQDEBUG: Baba|nQDEBUG: Baba|nQDEBUG: Bubublabla|nQWARN: Babablabla' flowId='tst_Warnings']
##teamcity[testFinished name='testWarnings()' flowId='tst_Warnings']
##teamcity[testStarted name='testMissingWarnings()' flowId='tst_Warnings']
##teamcity[testFailed name='testMissingWarnings()' message='Failure!' details='Not all expected messages were received' flowId='tst_Warnings']
##teamcity[testFailed name='testMissingWarnings()' message='Failure! |[Loc: Unknown File(0)|]' details='Not all expected messages were received' flowId='tst_Warnings']
##teamcity[testStdOut name='testMissingWarnings()' out='INFO: Did not receive message: "Warning0"|nINFO: Did not receive message: "Warning1"' flowId='tst_Warnings']
##teamcity[testFinished name='testMissingWarnings()' flowId='tst_Warnings']
##teamcity[testStarted name='testMissingWarningsRegularExpression()' flowId='tst_Warnings']
##teamcity[testFailed name='testMissingWarningsRegularExpression()' message='Failure!' details='Not all expected messages were received' flowId='tst_Warnings']
##teamcity[testFailed name='testMissingWarningsRegularExpression()' message='Failure! |[Loc: Unknown File(0)|]' details='Not all expected messages were received' flowId='tst_Warnings']
##teamcity[testStdOut name='testMissingWarningsRegularExpression()' out='INFO: Did not receive any message matching: "Warning\s\d"' flowId='tst_Warnings']
##teamcity[testFinished name='testMissingWarningsRegularExpression()' flowId='tst_Warnings']
##teamcity[testStarted name='testMissingWarningsWithData(first row)' flowId='tst_Warnings']
##teamcity[testFailed name='testMissingWarningsWithData(first row)' message='Failure!' details='Not all expected messages were received' flowId='tst_Warnings']
##teamcity[testFailed name='testMissingWarningsWithData(first row)' message='Failure! |[Loc: Unknown File(0)|]' details='Not all expected messages were received' flowId='tst_Warnings']
##teamcity[testStdOut name='testMissingWarningsWithData(first row)' out='INFO: Did not receive message: "Warning0"|nINFO: Did not receive message: "Warning1"' flowId='tst_Warnings']
##teamcity[testFinished name='testMissingWarningsWithData(first row)' flowId='tst_Warnings']
##teamcity[testStarted name='testMissingWarningsWithData(second row)' flowId='tst_Warnings']
##teamcity[testFailed name='testMissingWarningsWithData(second row)' message='Failure!' details='Not all expected messages were received' flowId='tst_Warnings']
##teamcity[testFailed name='testMissingWarningsWithData(second row)' message='Failure! |[Loc: Unknown File(0)|]' details='Not all expected messages were received' flowId='tst_Warnings']
##teamcity[testStdOut name='testMissingWarningsWithData(second row)' out='INFO: Did not receive message: "Warning0"|nINFO: Did not receive message: "Warning1"' flowId='tst_Warnings']
##teamcity[testFinished name='testMissingWarningsWithData(second row)' flowId='tst_Warnings']
##teamcity[testStarted name='cleanupTestCase()' flowId='tst_Warnings']

View File

@ -15,14 +15,18 @@ PASS : tst_Warnings::testWarnings()
INFO : tst_Warnings::testMissingWarnings() Did not receive message: "Warning0"
INFO : tst_Warnings::testMissingWarnings() Did not receive message: "Warning1"
FAIL! : tst_Warnings::testMissingWarnings() Not all expected messages were received
Loc: [Unknown File(0)]
INFO : tst_Warnings::testMissingWarningsRegularExpression() Did not receive any message matching: "Warning\s\d"
FAIL! : tst_Warnings::testMissingWarningsRegularExpression() Not all expected messages were received
Loc: [Unknown File(0)]
INFO : tst_Warnings::testMissingWarningsWithData(first row) Did not receive message: "Warning0"
INFO : tst_Warnings::testMissingWarningsWithData(first row) Did not receive message: "Warning1"
FAIL! : tst_Warnings::testMissingWarningsWithData(first row) Not all expected messages were received
Loc: [Unknown File(0)]
INFO : tst_Warnings::testMissingWarningsWithData(second row) Did not receive message: "Warning0"
INFO : tst_Warnings::testMissingWarningsWithData(second row) Did not receive message: "Warning1"
FAIL! : tst_Warnings::testMissingWarningsWithData(second row) Not all expected messages were received
Loc: [Unknown File(0)]
PASS : tst_Warnings::cleanupTestCase()
Totals: 3 passed, 4 failed, 0 skipped, 0 blacklisted, 0ms
********* Finished testing of tst_Warnings *********