forked from qt-creator/qt-creator
AutoTest: Clear up and generalize
Instead of transforming forth and back the output try to handle the output once correctly and pass it line-wise around. This also ensures that we always get a single line when appending the output which will be necessary later on. Change-Id: I3e9c6db5f81172997dfe566eee9a86bfe2f17a1f Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -46,6 +46,7 @@
|
||||
#include <projectexplorer/buildmanager.h>
|
||||
#include <projectexplorer/projectexplorer.h>
|
||||
#include <texteditor/texteditor.h>
|
||||
#include <utils/qtcassert.h>
|
||||
#include <utils/theme/theme.h>
|
||||
#include <utils/utilsicons.h>
|
||||
|
||||
@@ -238,9 +239,14 @@ void TestResultsPane::addTestResult(const TestResultPtr &result)
|
||||
navigateStateChanged();
|
||||
}
|
||||
|
||||
void TestResultsPane::addOutput(const QByteArray &output)
|
||||
void TestResultsPane::addOutputLine(const QByteArray &outputLine)
|
||||
{
|
||||
m_textOutput->appendPlainText(QString::fromUtf8(TestOutputReader::chopLineBreak(output)));
|
||||
if (!QTC_GUARD(!outputLine.contains('\n'))) {
|
||||
for (auto line : outputLine.split('\n'))
|
||||
addOutputLine(line);
|
||||
return;
|
||||
}
|
||||
m_textOutput->appendPlainText(QString::fromUtf8(outputLine));
|
||||
}
|
||||
|
||||
QWidget *TestResultsPane::outputWidget(QWidget *parent)
|
||||
|
||||
Reference in New Issue
Block a user