diff --git a/src/testlib/qtaptestlogger.cpp b/src/testlib/qtaptestlogger.cpp index 5b5a3c4875..8f254a431f 100644 --- a/src/testlib/qtaptestlogger.cpp +++ b/src/testlib/qtaptestlogger.cpp @@ -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, diff --git a/tests/auto/testlib/selftests/expected_blacklisted.tap b/tests/auto/testlib/selftests/expected_blacklisted.tap index 2c96bec472..9d589a6552 100644 --- a/tests/auto/testlib/selftests/expected_blacklisted.tap +++ b/tests/auto/testlib/selftests/expected_blacklisted.tap @@ -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