AutoTest: Test execution from result output pane

Enable test execution via context menu in the result output pane.
At the moment only gtest is supported.

Task-number: QTCREATORBUG-16695
Change-Id: Ib39164c3cb44d249647b11e25dc51c9ac5db89c5
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
Claus Steuer
2017-09-09 16:46:43 +02:00
parent 8b80442131
commit 4c04cff7c1
11 changed files with 153 additions and 102 deletions

View File

@@ -31,6 +31,7 @@
#include "testrunconfiguration.h"
#include "testsettings.h"
#include "testoutputreader.h"
#include "testtreeitem.h"
#include <coreplugin/icore.h>
#include <coreplugin/progressmanager/futureprogress.h>
@@ -106,6 +107,28 @@ void TestRunner::setSelectedTests(const QList<TestConfiguration *> &selected)
m_selectedTests = selected;
}
void TestRunner::runTest(TestRunMode mode, const TestTreeItem *item)
{
TestConfiguration *configuration;
switch (mode) {
case TestRunMode::Run:
case TestRunMode::RunWithoutDeploy:
configuration = item->testConfiguration();
break;
case TestRunMode::Debug:
case TestRunMode::DebugWithoutDeploy:
configuration = item->debugConfiguration();
break;
default:
configuration = nullptr;
}
if (configuration) {
setSelectedTests({configuration});
prepareToRunTests(mode);
}
}
static QString processInformation(const QProcess &proc)
{
QString information("\nCommand line: " + proc.program() + ' ' + proc.arguments().join(' '));