forked from qt-creator/qt-creator
AutoTest: Pass context object to lambda connections
Remove some unneeded lambda () brackets. Glue lambda brackets with parameters brackets. Change-Id: I414f7dbbaf60b452cb71f77d53d972937f121a47 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -152,7 +152,7 @@ AutotestPluginPrivate::AutotestPluginPrivate()
|
|||||||
this, [this] { m_runconfigCache.clear(); });
|
this, [this] { m_runconfigCache.clear(); });
|
||||||
|
|
||||||
connect(sessionManager, &ProjectExplorer::SessionManager::aboutToRemoveProject,
|
connect(sessionManager, &ProjectExplorer::SessionManager::aboutToRemoveProject,
|
||||||
this, [] (ProjectExplorer::Project *project) {
|
this, [](ProjectExplorer::Project *project) {
|
||||||
const auto it = s_projectSettings.constFind(project);
|
const auto it = s_projectSettings.constFind(project);
|
||||||
if (it != s_projectSettings.constEnd()) {
|
if (it != s_projectSettings.constEnd()) {
|
||||||
delete it.value();
|
delete it.value();
|
||||||
|
@@ -37,8 +37,8 @@ QStringList filterInterfering(const QStringList &provided, QStringList *omitted)
|
|||||||
"--gtest_print_time="
|
"--gtest_print_time="
|
||||||
};
|
};
|
||||||
|
|
||||||
QStringList allowed = Utils::filtered(provided, [] (const QString &arg) {
|
QStringList allowed = Utils::filtered(provided, [](const QString &arg) {
|
||||||
return Utils::allOf(knownInterferingOptions, [&arg] (const QString &interfering) {
|
return Utils::allOf(knownInterferingOptions, [&arg](const QString &interfering) {
|
||||||
return !arg.startsWith(interfering);
|
return !arg.startsWith(interfering);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@@ -511,7 +511,7 @@ QSet<QString> internalTargets(const TestTreeItem &item)
|
|||||||
return cppMM->dependingInternalTargets(item.filePath());
|
return cppMM->dependingInternalTargets(item.filePath());
|
||||||
for (const CppEditor::ProjectPart::ConstPtr &projectPart : projectParts) {
|
for (const CppEditor::ProjectPart::ConstPtr &projectPart : projectParts) {
|
||||||
if (Utils::FilePath::fromString(projectPart->projectFile) == item.proFile()
|
if (Utils::FilePath::fromString(projectPart->projectFile) == item.proFile()
|
||||||
&& Utils::anyOf(projectPart->files, [&file] (const CppEditor::ProjectFile &pf) {
|
&& Utils::anyOf(projectPart->files, [&file](const CppEditor::ProjectFile &pf) {
|
||||||
return pf.path == file;
|
return pf.path == file;
|
||||||
})) {
|
})) {
|
||||||
result.insert(projectPart->buildSystemTarget);
|
result.insert(projectPart->buildSystemTarget);
|
||||||
|
@@ -86,8 +86,7 @@ ProjectTestSettingsWidget::ProjectTestSettingsWidget(ProjectExplorer::Project *p
|
|||||||
m_projectSettings->setRunAfterBuild(RunAfterBuildMode(index));
|
m_projectSettings->setRunAfterBuild(RunAfterBuildMode(index));
|
||||||
});
|
});
|
||||||
m_syncTimer.setSingleShot(true);
|
m_syncTimer.setSingleShot(true);
|
||||||
connect(&m_syncTimer, &QTimer::timeout,
|
connect(&m_syncTimer, &QTimer::timeout, this, [this] {
|
||||||
[this]() {
|
|
||||||
auto testTreeModel = TestTreeModel::instance();
|
auto testTreeModel = TestTreeModel::instance();
|
||||||
if (m_syncType & ITestBase::Framework)
|
if (m_syncType & ITestBase::Framework)
|
||||||
testTreeModel->synchronizeTestFrameworks();
|
testTreeModel->synchronizeTestFrameworks();
|
||||||
|
@@ -76,7 +76,7 @@ static bool qtTestLibDefined(const Utils::FilePath &fileName)
|
|||||||
const QList<CppEditor::ProjectPart::ConstPtr> parts =
|
const QList<CppEditor::ProjectPart::ConstPtr> parts =
|
||||||
CppEditor::CppModelManager::instance()->projectPart(fileName);
|
CppEditor::CppModelManager::instance()->projectPart(fileName);
|
||||||
if (parts.size() > 0) {
|
if (parts.size() > 0) {
|
||||||
return Utils::anyOf(parts.at(0)->projectMacros, [] (const ProjectExplorer::Macro ¯o) {
|
return Utils::anyOf(parts.at(0)->projectMacros, [](const ProjectExplorer::Macro ¯o) {
|
||||||
return macro.key == "QT_TESTLIB_LIB";
|
return macro.key == "QT_TESTLIB_LIB";
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -218,7 +218,7 @@ static bool containsFunction(const QMap<QString, QtTestCodeLocationAndType> &tes
|
|||||||
const QString &function)
|
const QString &function)
|
||||||
{
|
{
|
||||||
const QString search = "::" + function;
|
const QString search = "::" + function;
|
||||||
return Utils::anyOf(testFunctions.keys(), [&search] (const QString &key) {
|
return Utils::anyOf(testFunctions.keys(), [&search](const QString &key) {
|
||||||
return key.endsWith(search);
|
return key.endsWith(search);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@@ -83,20 +83,20 @@ static QString quickTestSrcDir(const CppEditor::CppModelManager *cppMM,
|
|||||||
const QList<CppEditor::ProjectPart::ConstPtr> parts = cppMM->projectPart(fileName);
|
const QList<CppEditor::ProjectPart::ConstPtr> parts = cppMM->projectPart(fileName);
|
||||||
if (parts.size() > 0) {
|
if (parts.size() > 0) {
|
||||||
const ProjectExplorer::Macros ¯os = parts.at(0)->projectMacros;
|
const ProjectExplorer::Macros ¯os = parts.at(0)->projectMacros;
|
||||||
auto found = std::find_if(
|
auto found = std::find_if(macros.cbegin(), macros.cend(),
|
||||||
macros.cbegin(),
|
[](const ProjectExplorer::Macro ¯o) {
|
||||||
macros.cend(),
|
return macro.key == "QUICK_TEST_SOURCE_DIR";
|
||||||
[] (const ProjectExplorer::Macro ¯o) { return macro.key == "QUICK_TEST_SOURCE_DIR"; });
|
});
|
||||||
if (found != macros.cend()) {
|
if (found != macros.cend()) {
|
||||||
QByteArray result = found->value;
|
QByteArray result = found->value;
|
||||||
if (result.startsWith('"'))
|
if (result.startsWith('"'))
|
||||||
result.remove(result.length() - 1, 1).remove(0, 1);
|
result.remove(result.length() - 1, 1).remove(0, 1);
|
||||||
if (result.startsWith("\\\""))
|
if (result.startsWith("\\\""))
|
||||||
result.remove(result.length() - 2, 2).remove(0, 2);
|
result.remove(result.length() - 2, 2).remove(0, 2);
|
||||||
return QLatin1String(result);
|
return QLatin1String(result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return QString();
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
QString QuickTestParser::quickTestName(const CPlusPlus::Document::Ptr &doc) const
|
QString QuickTestParser::quickTestName(const CPlusPlus::Document::Ptr &doc) const
|
||||||
@@ -326,7 +326,7 @@ QuickTestParser::QuickTestParser(ITestFramework *framework)
|
|||||||
: CppParser(framework)
|
: CppParser(framework)
|
||||||
{
|
{
|
||||||
connect(ProjectExplorer::SessionManager::instance(),
|
connect(ProjectExplorer::SessionManager::instance(),
|
||||||
&ProjectExplorer::SessionManager::startupProjectChanged, [this] {
|
&ProjectExplorer::SessionManager::startupProjectChanged, this, [this] {
|
||||||
const QStringList &dirs = m_directoryWatcher.directories();
|
const QStringList &dirs = m_directoryWatcher.directories();
|
||||||
if (!dirs.isEmpty())
|
if (!dirs.isEmpty())
|
||||||
m_directoryWatcher.removePaths(dirs);
|
m_directoryWatcher.removePaths(dirs);
|
||||||
|
@@ -27,7 +27,7 @@ TestQmlVisitor::TestQmlVisitor(QmlJS::Document::Ptr doc, const QmlJS::Snapshot &
|
|||||||
static bool documentImportsQtTest(const QmlJS::Document *doc)
|
static bool documentImportsQtTest(const QmlJS::Document *doc)
|
||||||
{
|
{
|
||||||
if (const QmlJS::Bind *bind = doc->bind()) {
|
if (const QmlJS::Bind *bind = doc->bind()) {
|
||||||
return Utils::anyOf(bind->imports(), [] (const QmlJS::ImportInfo &info) {
|
return Utils::anyOf(bind->imports(), [](const QmlJS::ImportInfo &info) {
|
||||||
return info.isValid() && info.name() == "QtTest";
|
return info.isValid() && info.name() == "QtTest";
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@@ -46,7 +46,7 @@ TestCodeParser::TestCodeParser()
|
|||||||
connect(&m_futureWatcher, &QFutureWatcher<TestParseResultPtr>::finished,
|
connect(&m_futureWatcher, &QFutureWatcher<TestParseResultPtr>::finished,
|
||||||
this, &TestCodeParser::onFinished);
|
this, &TestCodeParser::onFinished);
|
||||||
connect(&m_futureWatcher, &QFutureWatcher<TestParseResultPtr>::resultReadyAt,
|
connect(&m_futureWatcher, &QFutureWatcher<TestParseResultPtr>::resultReadyAt,
|
||||||
this, [this] (int index) {
|
this, [this](int index) {
|
||||||
emit testParseResultReady(m_futureWatcher.resultAt(index));
|
emit testParseResultReady(m_futureWatcher.resultAt(index));
|
||||||
});
|
});
|
||||||
connect(this, &TestCodeParser::parsingFinished, this, &TestCodeParser::releaseParserInternals);
|
connect(this, &TestCodeParser::parsingFinished, this, &TestCodeParser::releaseParserInternals);
|
||||||
@@ -112,7 +112,7 @@ void TestCodeParser::emitUpdateTestTree(ITestParser *parser)
|
|||||||
|
|
||||||
qCDebug(LOG) << "adding singleShot";
|
qCDebug(LOG) << "adding singleShot";
|
||||||
m_singleShotScheduled = true;
|
m_singleShotScheduled = true;
|
||||||
QTimer::singleShot(1000, this, [this]() { updateTestTree(m_updateParsers); });
|
QTimer::singleShot(1000, this, [this] { updateTestTree(m_updateParsers); });
|
||||||
}
|
}
|
||||||
|
|
||||||
void TestCodeParser::updateTestTree(const QSet<ITestParser *> &parsers)
|
void TestCodeParser::updateTestTree(const QSet<ITestParser *> &parsers)
|
||||||
@@ -310,7 +310,7 @@ void TestCodeParser::scanForTests(const Utils::FilePaths &fileList,
|
|||||||
TestTreeModel::instance()->updateCheckStateCache();
|
TestTreeModel::instance()->updateCheckStateCache();
|
||||||
if (isFullParse) {
|
if (isFullParse) {
|
||||||
// remove qml files as they will be found automatically by the referencing cpp file
|
// remove qml files as they will be found automatically by the referencing cpp file
|
||||||
list = Utils::filtered(list, [] (const Utils::FilePath &fn) {
|
list = Utils::filtered(list, [](const Utils::FilePath &fn) {
|
||||||
return !fn.endsWith(".qml");
|
return !fn.endsWith(".qml");
|
||||||
});
|
});
|
||||||
if (!parsers.isEmpty()) {
|
if (!parsers.isEmpty()) {
|
||||||
|
@@ -84,8 +84,7 @@ TestNavigationWidget::TestNavigationWidget(QWidget *parent) :
|
|||||||
this, &TestNavigationWidget::onParsingFinished);
|
this, &TestNavigationWidget::onParsingFinished);
|
||||||
connect(m_model->parser(), &TestCodeParser::parsingFailed,
|
connect(m_model->parser(), &TestCodeParser::parsingFailed,
|
||||||
this, &TestNavigationWidget::onParsingFinished);
|
this, &TestNavigationWidget::onParsingFinished);
|
||||||
connect(m_model, &TestTreeModel::updatedActiveFrameworks,
|
connect(m_model, &TestTreeModel::updatedActiveFrameworks, this, [this](int numberOfActive) {
|
||||||
this, [this] (int numberOfActive) {
|
|
||||||
m_missingFrameworksWidget->setVisible(numberOfActive == 0);
|
m_missingFrameworksWidget->setVisible(numberOfActive == 0);
|
||||||
});
|
});
|
||||||
ProjectExplorer::SessionManager *sm = ProjectExplorer::SessionManager::instance();
|
ProjectExplorer::SessionManager *sm = ProjectExplorer::SessionManager::instance();
|
||||||
@@ -122,14 +121,12 @@ void TestNavigationWidget::contextMenuEvent(QContextMenuEvent *event)
|
|||||||
if (item->canProvideTestConfiguration()) {
|
if (item->canProvideTestConfiguration()) {
|
||||||
runThisTest = new QAction(Tr::tr("Run This Test"), &menu);
|
runThisTest = new QAction(Tr::tr("Run This Test"), &menu);
|
||||||
runThisTest->setEnabled(enabled);
|
runThisTest->setEnabled(enabled);
|
||||||
connect(runThisTest, &QAction::triggered,
|
connect(runThisTest, &QAction::triggered, this, [this] {
|
||||||
this, [this] () {
|
|
||||||
onRunThisTestTriggered(TestRunMode::Run);
|
onRunThisTestTriggered(TestRunMode::Run);
|
||||||
});
|
});
|
||||||
runWithoutDeploy = new QAction(Tr::tr("Run Without Deployment"), &menu);
|
runWithoutDeploy = new QAction(Tr::tr("Run Without Deployment"), &menu);
|
||||||
runWithoutDeploy->setEnabled(enabled);
|
runWithoutDeploy->setEnabled(enabled);
|
||||||
connect(runWithoutDeploy, &QAction::triggered,
|
connect(runWithoutDeploy, &QAction::triggered, this, [this] {
|
||||||
this, [this] () {
|
|
||||||
onRunThisTestTriggered(TestRunMode::RunWithoutDeploy);
|
onRunThisTestTriggered(TestRunMode::RunWithoutDeploy);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -139,14 +136,12 @@ void TestNavigationWidget::contextMenuEvent(QContextMenuEvent *event)
|
|||||||
if (ttitem && ttitem->canProvideDebugConfiguration()) {
|
if (ttitem && ttitem->canProvideDebugConfiguration()) {
|
||||||
debugThisTest = new QAction(Tr::tr("Debug This Test"), &menu);
|
debugThisTest = new QAction(Tr::tr("Debug This Test"), &menu);
|
||||||
debugThisTest->setEnabled(enabled);
|
debugThisTest->setEnabled(enabled);
|
||||||
connect(debugThisTest, &QAction::triggered,
|
connect(debugThisTest, &QAction::triggered, this, [this] {
|
||||||
this, [this] () {
|
|
||||||
onRunThisTestTriggered(TestRunMode::Debug);
|
onRunThisTestTriggered(TestRunMode::Debug);
|
||||||
});
|
});
|
||||||
debugWithoutDeploy = new QAction(Tr::tr("Debug Without Deployment"), &menu);
|
debugWithoutDeploy = new QAction(Tr::tr("Debug Without Deployment"), &menu);
|
||||||
debugWithoutDeploy->setEnabled(enabled);
|
debugWithoutDeploy->setEnabled(enabled);
|
||||||
connect(debugWithoutDeploy, &QAction::triggered,
|
connect(debugWithoutDeploy, &QAction::triggered, this, [this] {
|
||||||
this, [this] () {
|
|
||||||
onRunThisTestTriggered(TestRunMode::DebugWithoutDeploy);
|
onRunThisTestTriggered(TestRunMode::DebugWithoutDeploy);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -216,13 +211,13 @@ QList<QToolButton *> TestNavigationWidget::createToolButtons()
|
|||||||
collapse->setIcon(Utils::Icons::COLLAPSE_TOOLBAR.icon());
|
collapse->setIcon(Utils::Icons::COLLAPSE_TOOLBAR.icon());
|
||||||
collapse->setToolTip(Tr::tr("Collapse All"));
|
collapse->setToolTip(Tr::tr("Collapse All"));
|
||||||
|
|
||||||
connect(expand, &QToolButton::clicked, m_view, [this]() {
|
connect(expand, &QToolButton::clicked, m_view, [this] {
|
||||||
m_view->blockSignals(true);
|
m_view->blockSignals(true);
|
||||||
m_view->expandAll();
|
m_view->expandAll();
|
||||||
m_view->blockSignals(false);
|
m_view->blockSignals(false);
|
||||||
updateExpandedStateCache();
|
updateExpandedStateCache();
|
||||||
});
|
});
|
||||||
connect(collapse, &QToolButton::clicked, m_view, [this]() {
|
connect(collapse, &QToolButton::clicked, m_view, [this] {
|
||||||
m_view->blockSignals(true);
|
m_view->blockSignals(true);
|
||||||
m_view->collapseAll();
|
m_view->collapseAll();
|
||||||
m_view->blockSignals(false);
|
m_view->blockSignals(false);
|
||||||
|
@@ -135,10 +135,10 @@ TestResultsPane::TestResultsPane(QObject *parent) :
|
|||||||
trd, &TestResultDelegate::currentChanged);
|
trd, &TestResultDelegate::currentChanged);
|
||||||
connect(m_treeView, &Utils::TreeView::customContextMenuRequested,
|
connect(m_treeView, &Utils::TreeView::customContextMenuRequested,
|
||||||
this, &TestResultsPane::onCustomContextMenuRequested);
|
this, &TestResultsPane::onCustomContextMenuRequested);
|
||||||
connect(m_treeView, &ResultsTreeView::copyShortcutTriggered, [this] () {
|
connect(m_treeView, &ResultsTreeView::copyShortcutTriggered, this, [this] {
|
||||||
onCopyItemTriggered(getTestResult(m_treeView->currentIndex()));
|
onCopyItemTriggered(getTestResult(m_treeView->currentIndex()));
|
||||||
});
|
});
|
||||||
connect(m_model, &TestResultModel::requestExpansion, [this] (const QModelIndex &idx) {
|
connect(m_model, &TestResultModel::requestExpansion, this, [this](const QModelIndex &idx) {
|
||||||
m_treeView->expand(m_filterModel->mapFromSource(idx));
|
m_treeView->expand(m_filterModel->mapFromSource(idx));
|
||||||
});
|
});
|
||||||
connect(TestRunner::instance(), &TestRunner::testRunStarted,
|
connect(TestRunner::instance(), &TestRunner::testRunStarted,
|
||||||
@@ -159,7 +159,7 @@ void TestResultsPane::createToolButtons()
|
|||||||
m_expandCollapse->setToolTip(Tr::tr("Expand All"));
|
m_expandCollapse->setToolTip(Tr::tr("Expand All"));
|
||||||
m_expandCollapse->setCheckable(true);
|
m_expandCollapse->setCheckable(true);
|
||||||
m_expandCollapse->setChecked(false);
|
m_expandCollapse->setChecked(false);
|
||||||
connect(m_expandCollapse, &QToolButton::clicked, [this] (bool checked) {
|
connect(m_expandCollapse, &QToolButton::clicked, this, [this](bool checked) {
|
||||||
if (checked)
|
if (checked)
|
||||||
m_treeView->expandAll();
|
m_treeView->expandAll();
|
||||||
else
|
else
|
||||||
@@ -505,10 +505,10 @@ void TestResultsPane::initializeFilterMenu()
|
|||||||
m_filterMenu->addSeparator();
|
m_filterMenu->addSeparator();
|
||||||
QAction *action = new QAction(Tr::tr("Check All Filters"), m_filterMenu);
|
QAction *action = new QAction(Tr::tr("Check All Filters"), m_filterMenu);
|
||||||
m_filterMenu->addAction(action);
|
m_filterMenu->addAction(action);
|
||||||
connect(action, &QAction::triggered, this, [this]() { TestResultsPane::checkAllFilter(true); });
|
connect(action, &QAction::triggered, this, [this] { TestResultsPane::checkAllFilter(true); });
|
||||||
action = new QAction(Tr::tr("Uncheck All Filters"), m_filterMenu);
|
action = new QAction(Tr::tr("Uncheck All Filters"), m_filterMenu);
|
||||||
m_filterMenu->addAction(action);
|
m_filterMenu->addAction(action);
|
||||||
connect(action, &QAction::triggered, this, [this]() { TestResultsPane::checkAllFilter(false); });
|
connect(action, &QAction::triggered, this, [this] { TestResultsPane::checkAllFilter(false); });
|
||||||
}
|
}
|
||||||
|
|
||||||
void TestResultsPane::updateSummaryLabel()
|
void TestResultsPane::updateSummaryLabel()
|
||||||
@@ -617,7 +617,7 @@ void TestResultsPane::onCustomContextMenuRequested(const QPoint &pos)
|
|||||||
QAction *action = new QAction(Tr::tr("Copy"), &menu);
|
QAction *action = new QAction(Tr::tr("Copy"), &menu);
|
||||||
action->setShortcut(QKeySequence(QKeySequence::Copy));
|
action->setShortcut(QKeySequence(QKeySequence::Copy));
|
||||||
action->setEnabled(resultsAvailable && clicked);
|
action->setEnabled(resultsAvailable && clicked);
|
||||||
connect(action, &QAction::triggered, [this, clicked] () {
|
connect(action, &QAction::triggered, this, [this, clicked] {
|
||||||
onCopyItemTriggered(clicked);
|
onCopyItemTriggered(clicked);
|
||||||
});
|
});
|
||||||
menu.addAction(action);
|
menu.addAction(action);
|
||||||
|
@@ -71,15 +71,14 @@ TestRunner::TestRunner()
|
|||||||
s_instance = this;
|
s_instance = this;
|
||||||
|
|
||||||
m_cancelTimer.setSingleShot(true);
|
m_cancelTimer.setSingleShot(true);
|
||||||
connect(&m_cancelTimer, &QTimer::timeout, this, [this]() { cancelCurrent(Timeout); });
|
connect(&m_cancelTimer, &QTimer::timeout, this, [this] { cancelCurrent(Timeout); });
|
||||||
connect(&m_futureWatcher, &QFutureWatcher<TestResultPtr>::resultReadyAt,
|
connect(&m_futureWatcher, &QFutureWatcher<TestResultPtr>::resultReadyAt,
|
||||||
this, [this](int index) { emit testResultReady(m_futureWatcher.resultAt(index)); });
|
this, [this](int index) { emit testResultReady(m_futureWatcher.resultAt(index)); });
|
||||||
connect(&m_futureWatcher, &QFutureWatcher<TestResultPtr>::finished,
|
connect(&m_futureWatcher, &QFutureWatcher<TestResultPtr>::finished,
|
||||||
this, &TestRunner::onFinished);
|
this, &TestRunner::onFinished);
|
||||||
connect(this, &TestRunner::requestStopTestRun,
|
connect(this, &TestRunner::requestStopTestRun,
|
||||||
&m_futureWatcher, &QFutureWatcher<TestResultPtr>::cancel);
|
&m_futureWatcher, &QFutureWatcher<TestResultPtr>::cancel);
|
||||||
connect(&m_futureWatcher, &QFutureWatcher<TestResultPtr>::canceled,
|
connect(&m_futureWatcher, &QFutureWatcher<TestResultPtr>::canceled, this, [this] {
|
||||||
this, [this]() {
|
|
||||||
cancelCurrent(UserCanceled);
|
cancelCurrent(UserCanceled);
|
||||||
reportResult(ResultType::MessageFatal, Tr::tr("Test run canceled by user."));
|
reportResult(ResultType::MessageFatal, Tr::tr("Test run canceled by user."));
|
||||||
});
|
});
|
||||||
@@ -386,7 +385,7 @@ void TestRunner::prepareToRunTests(TestRunMode mode)
|
|||||||
}
|
}
|
||||||
|
|
||||||
m_targetConnect = connect(project, &Project::activeTargetChanged,
|
m_targetConnect = connect(project, &Project::activeTargetChanged,
|
||||||
[this]() { cancelCurrent(KitChanged); });
|
this, [this] { cancelCurrent(KitChanged); });
|
||||||
|
|
||||||
if (projectExplorerSettings.buildBeforeDeploy == ProjectExplorer::Internal::BuildBeforeRunMode::Off
|
if (projectExplorerSettings.buildBeforeDeploy == ProjectExplorer::Internal::BuildBeforeRunMode::Off
|
||||||
|| mode == TestRunMode::DebugWithoutDeploy
|
|| mode == TestRunMode::DebugWithoutDeploy
|
||||||
@@ -423,14 +422,14 @@ static RunConfiguration *getRunConfiguration(const QString &buildTargetKey)
|
|||||||
|
|
||||||
RunConfiguration *runConfig = nullptr;
|
RunConfiguration *runConfig = nullptr;
|
||||||
const QList<RunConfiguration *> runConfigurations
|
const QList<RunConfiguration *> runConfigurations
|
||||||
= Utils::filtered(target->runConfigurations(), [] (const RunConfiguration *rc) {
|
= Utils::filtered(target->runConfigurations(), [](const RunConfiguration *rc) {
|
||||||
return !rc->runnable().command.isEmpty();
|
return !rc->runnable().command.isEmpty();
|
||||||
});
|
});
|
||||||
|
|
||||||
const ChoicePair oldChoice = AutotestPlugin::cachedChoiceFor(buildTargetKey);
|
const ChoicePair oldChoice = AutotestPlugin::cachedChoiceFor(buildTargetKey);
|
||||||
if (!oldChoice.executable.isEmpty()) {
|
if (!oldChoice.executable.isEmpty()) {
|
||||||
runConfig = Utils::findOrDefault(runConfigurations,
|
runConfig = Utils::findOrDefault(runConfigurations,
|
||||||
[&oldChoice] (const RunConfiguration *rc) {
|
[&oldChoice](const RunConfiguration *rc) {
|
||||||
return oldChoice.matches(rc);
|
return oldChoice.matches(rc);
|
||||||
});
|
});
|
||||||
if (runConfig)
|
if (runConfig)
|
||||||
@@ -447,7 +446,7 @@ static RunConfiguration *getRunConfiguration(const QString &buildTargetKey)
|
|||||||
return nullptr;
|
return nullptr;
|
||||||
// run configuration has been selected - fill config based on this one..
|
// run configuration has been selected - fill config based on this one..
|
||||||
const FilePath exe = FilePath::fromString(dialog.executable());
|
const FilePath exe = FilePath::fromString(dialog.executable());
|
||||||
runConfig = Utils::findOr(runConfigurations, nullptr, [&dName, &exe] (const RunConfiguration *rc) {
|
runConfig = Utils::findOr(runConfigurations, nullptr, [&dName, &exe](const RunConfiguration *rc) {
|
||||||
if (rc->displayName() != dName)
|
if (rc->displayName() != dName)
|
||||||
return false;
|
return false;
|
||||||
return rc->runnable().command.executable() == exe;
|
return rc->runnable().command.executable() == exe;
|
||||||
@@ -701,7 +700,7 @@ void TestRunner::runOrDebugTests()
|
|||||||
if (executablesEmpty()) {
|
if (executablesEmpty()) {
|
||||||
m_skipTargetsCheck = true;
|
m_skipTargetsCheck = true;
|
||||||
Target * target = SessionManager::startupTarget();
|
Target * target = SessionManager::startupTarget();
|
||||||
QTimer::singleShot(5000, this, [this, target = QPointer<Target>(target)]() {
|
QTimer::singleShot(5000, this, [this, target = QPointer<Target>(target)] {
|
||||||
if (target) {
|
if (target) {
|
||||||
disconnect(target, &Target::buildSystemUpdated,
|
disconnect(target, &Target::buildSystemUpdated,
|
||||||
this, &TestRunner::onBuildSystemUpdated);
|
this, &TestRunner::onBuildSystemUpdated);
|
||||||
|
@@ -366,7 +366,7 @@ void TestSettingsPage::apply()
|
|||||||
return;
|
return;
|
||||||
const TestSettings newSettings = m_widget->settings();
|
const TestSettings newSettings = m_widget->settings();
|
||||||
const QList<Utils::Id> changedIds = Utils::filtered(newSettings.frameworksGrouping.keys(),
|
const QList<Utils::Id> changedIds = Utils::filtered(newSettings.frameworksGrouping.keys(),
|
||||||
[newSettings, this] (const Utils::Id &id) {
|
[newSettings, this](const Utils::Id &id) {
|
||||||
return newSettings.frameworksGrouping[id] != m_settings->frameworksGrouping[id];
|
return newSettings.frameworksGrouping[id] != m_settings->frameworksGrouping[id];
|
||||||
});
|
});
|
||||||
*m_settings = newSettings;
|
*m_settings = newSettings;
|
||||||
|
@@ -70,7 +70,7 @@ void TestTreeModel::setupParsingConnections()
|
|||||||
m_parser->setState(TestCodeParser::Idle);
|
m_parser->setState(TestCodeParser::Idle);
|
||||||
|
|
||||||
SessionManager *sm = SessionManager::instance();
|
SessionManager *sm = SessionManager::instance();
|
||||||
connect(sm, &SessionManager::startupProjectChanged, [this, sm](Project *project) {
|
connect(sm, &SessionManager::startupProjectChanged, this, [this, sm](Project *project) {
|
||||||
synchronizeTestFrameworks(); // we might have project settings
|
synchronizeTestFrameworks(); // we might have project settings
|
||||||
m_parser->onStartupProjectChanged(project);
|
m_parser->onStartupProjectChanged(project);
|
||||||
removeAllTestToolItems();
|
removeAllTestToolItems();
|
||||||
@@ -568,7 +568,7 @@ void TestTreeModel::insertItemInParent(TestTreeItem *item, TestTreeItem *root, b
|
|||||||
{
|
{
|
||||||
TestTreeItem *parentNode = root;
|
TestTreeItem *parentNode = root;
|
||||||
if (groupingEnabled && item->isGroupable()) {
|
if (groupingEnabled && item->isGroupable()) {
|
||||||
parentNode = root->findFirstLevelChildItem([item] (const TestTreeItem *it) {
|
parentNode = root->findFirstLevelChildItem([item](const TestTreeItem *it) {
|
||||||
return it->isGroupNodeFor(item);
|
return it->isGroupNodeFor(item);
|
||||||
});
|
});
|
||||||
if (!parentNode) {
|
if (!parentNode) {
|
||||||
|
Reference in New Issue
Block a user