testlib: Don't report additional 'pass' test point for blacklisted XFail

Regression after 9906cc57ed.

Pick-to: 6.2
Change-Id: I5566f70c66d248426c7a41b6de1cfb92f104cc64
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
This commit is contained in:
Tor Arne Vestbø 2021-07-29 19:31:35 +02:00
parent fb16a66b71
commit c95d7741b7
2 changed files with 4 additions and 5 deletions

View File

@ -115,7 +115,7 @@ void QTapTestLogger::outputTestLine(bool ok, int testNumber, QTestCharBuffer &di
void QTapTestLogger::addIncident(IncidentTypes type, const char *description,
const char *file, int line)
{
if (m_wasExpectedFail && type == Pass) {
if (m_wasExpectedFail && (type == Pass || type == BlacklistedPass)) {
// XFail comes with a corresponding Pass incident, but we only want
// to emit a single test point for it, so skip the this pass.
return;
@ -132,7 +132,7 @@ void QTapTestLogger::addIncident(IncidentTypes type, const char *description,
}
int testNumber = QTestLog::totalCount();
if (type == XFail) {
if (type == XFail || type == BlacklistedXFail) {
// The global test counter hasn't been updated yet for XFail
testNumber += 1;
}
@ -238,7 +238,7 @@ void QTapTestLogger::addIncident(IncidentTypes type, const char *description,
outputString(YAML_INDENT "...\n");
}
m_wasExpectedFail = type == XFail;
m_wasExpectedFail = (type == XFail || type == BlacklistedXFail);
}
void QTapTestLogger::addMessage(MessageTypes type, const QString &message,

View File

@ -15,14 +15,13 @@ not ok 4 - fail() # TODO 'false' returned FALSE. (This test should BFAIL)
file: qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp
line: 0
...
not ok 5 - xfail() # TODO This test should BXFAIL then BPASS
not ok 6 - xfail() # TODO This test should BXFAIL then BPASS
---
# This test should BXFAIL then BPASS
at: tst_Blacklisted::xfail() (qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp:0)
file: qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp
line: 0
...
ok 6 - xfail() # TODO
ok 7 - xpass() # TODO 'true' returned TRUE unexpectedly. (This test should BXPASS)
# This is a warning that should not appear in silent test output
# This is an internal testlib warning that should not appear in silent test output