testlib: Gracefully handle messages outside of test function in JUnit reporter
Fixes: QTBUG-96543 Task-number: COIN-755 Pick-to: 6.2 Change-Id: I2334597319f3595f37f48c9811f667e57b99df28 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
This commit is contained in:
parent
040258b260
commit
8aa1fc6f12
@ -308,6 +308,9 @@ void QJUnitTestLogger::addMessage(MessageTypes type, const QString &message, con
|
||||
}
|
||||
}();
|
||||
|
||||
if (!systemLogElement)
|
||||
return; // FIXME: Handle messages outside of test functions
|
||||
|
||||
auto textNode = new QTestElement(QTest::LET_Text);
|
||||
textNode->addAttribute(QTest::AI_Value, message.toUtf8().constData());
|
||||
systemLogElement->addChild(textNode);
|
||||
|
Loading…
Reference in New Issue
Block a user