diff options
| author | Edward Welbourne <edward.welbourne@qt.io> | 2021-09-23 15:59:32 +0200 |
|---|---|---|
| committer | Edward Welbourne <edward.welbourne@qt.io> | 2021-12-09 20:54:26 +0100 |
| commit | 77a93e6df331e5ed22aef4335d8de38abe2ca586 (patch) | |
| tree | ace152ec3685282a07f890e4c95aac057693b5e5 /src/testlib/qtaptestlogger.cpp | |
| parent | 1c24b4b8d9fe16eaa4bc1598df117593d814bf50 (diff) | |
Make Skip an incident in test logging
Skip ends the test (albeit inconclusively). Rearrange the enums in
the abstract logger, move code to handle skip between relevant
function and tidy up various things that became simpler as a result.
Also reorder the message enum, and its switches, to separate testlib's
internals from the usual Qt messages, and put each group in ascending
order of severity.
Task-number: QTBUG-96844
Change-Id: I2c7a634b9f849830d64eafa750155e66e244b729
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/testlib/qtaptestlogger.cpp')
| -rw-r--r-- | src/testlib/qtaptestlogger.cpp | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/src/testlib/qtaptestlogger.cpp b/src/testlib/qtaptestlogger.cpp index 8f254a431f6..840624fa3b2 100644 --- a/src/testlib/qtaptestlogger.cpp +++ b/src/testlib/qtaptestlogger.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2018 The Qt Company Ltd. +** Copyright (C) 2021 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtTest module of the Qt Toolkit. @@ -121,7 +121,8 @@ void QTapTestLogger::addIncident(IncidentTypes type, const char *description, return; } - bool ok = type == Pass || type == XPass || type == BlacklistedPass || type == BlacklistedXPass; + bool ok = type == Pass || type == BlacklistedPass || type == Skip + || type == XPass || type == BlacklistedXPass; QTestCharBuffer directive; if (type == XFail || type == XPass || type == BlacklistedFail || type == BlacklistedPass @@ -129,6 +130,8 @@ void QTapTestLogger::addIncident(IncidentTypes type, const char *description, // We treat expected or blacklisted failures/passes as TODO-failures/passes, // which should be treated as soft issues by consumers. Not all do though :/ QTest::qt_asprintf(&directive, " # TODO %s", description); + } else if (type == Skip) { + QTest::qt_asprintf(&directive, " # SKIP %s", description); } int testNumber = QTestLog::totalCount(); @@ -246,13 +249,7 @@ void QTapTestLogger::addMessage(MessageTypes type, const QString &message, { Q_UNUSED(file); Q_UNUSED(line); - - if (type == Skip) { - QTestCharBuffer directive; - QTest::qt_asprintf(&directive, " # SKIP %s", message.toUtf8().constData()); - outputTestLine(/* ok = */ true, QTestLog::totalCount(), directive); - return; - } + Q_UNUSED(type); QTestCharBuffer diagnostics; QTest::qt_asprintf(&diagnostics, "# %s\n", qPrintable(message)); |
