forked from qt-creator/qt-creator
		
	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:
		@@ -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(' '));
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user