AutoTest: Add report helper function

Adds a report() function which generates a simple string
holding the number of items per framework root node and
uses it inside the logging after a full parse.

Change-Id: Ib4be89de778aeab7e9c80b5c0522ee7f3f1bb587
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Christian Stenger
2023-08-31 09:59:49 +02:00
parent 25e1266c26
commit 792c74b47a
3 changed files with 69 additions and 0 deletions

View File

@@ -456,6 +456,13 @@ void TestCodeParser::onFinished(bool success)
emit parsingFinished();
qCDebug(LOG) << QDateTime::currentDateTime().toString("hh:mm:ss.zzz") << "ParsingFin";
qCDebug(LOG) << "Parsing took:" << m_parsingTimer.elapsed() << "ms";
if (LOG().isInfoEnabled()) {
qCInfo(LOG).noquote().nospace()
<< "Current test tree:" << TestTreeModel::instance()->report(true);
} else {
qCDebug(LOG).noquote().nospace()
<< "Current test tree:" << TestTreeModel::instance()->report(false);
}
}
m_dirty = false;
break;
@@ -497,6 +504,12 @@ void TestCodeParser::onPartialParsingFinished()
m_updateParsers.clear();
emit parsingFinished();
qCDebug(LOG) << QDateTime::currentDateTime().toString("hh:mm:ss.zzz") << "ParsingFin";
if (LOG().isDebugEnabled()) {
QMetaObject::invokeMethod(this, [] { // sweep() needs to be processed before logging
qCDebug(LOG).noquote().nospace()
<< "Current test tree:" << TestTreeModel::instance()->report(false);
}, Qt::QueuedConnection);
}
} else {
qCDebug(LOG) << "not emitting parsingFinished"
<< "(on PartialParsingFinished, singleshot scheduled)";