AutoTest: Introduce ITestTool

Preparation for separating handling of code based and
build system based tests.

Task-number: QTCREATORBUG-23332
Change-Id: I490af5f3157fd4a8cd07d976cdfd9e4503ade97b
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Christian Stenger
2020-10-19 13:56:19 +02:00
parent e95041c054
commit 73613d8549
23 changed files with 134 additions and 71 deletions

View File

@@ -27,9 +27,11 @@
#include "autotesticons.h"
#include "autotestplugin.h"
#include "itestframework.h"
#include "testeditormark.h"
#include "testresultdelegate.h"
#include "testresultmodel.h"
#include "testresultmodel.h"
#include "testrunner.h"
#include "testsettings.h"
#include "testtreemodel.h"
@@ -631,9 +633,14 @@ void TestResultsPane::onCustomContextMenuRequested(const QPoint &pos)
menu.addAction(action);
action = new QAction(tr("Debug This Test"), &menu);
// FIXME limit to Test Frameworks
auto testTreeItem = static_cast<const TestTreeItem *>(correlatingItem);
action->setEnabled(testTreeItem && testTreeItem->canProvideDebugConfiguration());
bool debugEnabled = false;
if (correlatingItem) {
if (correlatingItem->testBase()->asFramework()) {
auto testTreeItem = static_cast<const TestTreeItem *>(correlatingItem);
debugEnabled = testTreeItem && testTreeItem->canProvideDebugConfiguration();
}
}
action->setEnabled(debugEnabled);
connect(action, &QAction::triggered, this, [this, clicked] {
onRunThisTestTriggered(TestRunMode::Debug, clicked);
});