forked from qt-creator/qt-creator
AutoTest: Allow colored commandline output
Some test frameworks allow to print their output colorful to further indicate meanings of messages or test results. Provide a highlighter for the textual output of the results and enable this functionality for GTest and Boost UTF. Keep at least a small backdoor for overwriting this by the user. Fixes: QTCREATORBUG-22297 Change-Id: Iddd2b734416de807635d90c6519553081f7372f2 Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -34,6 +34,7 @@
|
||||
#include "testcodeparser.h"
|
||||
#include "testeditormark.h"
|
||||
#include "testoutputreader.h"
|
||||
#include "outputhighlighter.h"
|
||||
|
||||
#include <aggregation/aggregate.h>
|
||||
#include <coreplugin/actionmanager/actionmanager.h>
|
||||
@@ -135,6 +136,7 @@ TestResultsPane::TestResultsPane(QObject *parent) :
|
||||
m_textOutput->setFont(font);
|
||||
m_textOutput->setWordWrapMode(QTextOption::WordWrap);
|
||||
m_textOutput->setReadOnly(true);
|
||||
new OutputHighlighter(m_textOutput->document());
|
||||
m_outputWidget->addWidget(m_textOutput);
|
||||
|
||||
auto agg = new Aggregation::Aggregate;
|
||||
@@ -707,5 +709,12 @@ void TestResultsPane::showTestResult(const QModelIndex &index)
|
||||
}
|
||||
}
|
||||
|
||||
OutputChannel TestResultsPane::channelForBlockNumber(int blockNumber) const
|
||||
{
|
||||
QTC_ASSERT(blockNumber > -1 && blockNumber < m_outputChannels.size(),
|
||||
return OutputChannel::StdOut);
|
||||
return m_outputChannels.at(blockNumber);
|
||||
}
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace Autotest
|
||||
|
||||
Reference in New Issue
Block a user