forked from qt-creator/qt-creator
Merge remote-tracking branch 'origin/4.12'
Conflicts: src/plugins/qmldesigner/components/curveeditor/detail/graphicsview.cpp Change-Id: I2a0ccb84560174c5170d5baaff526c0e095f0ba0
This commit is contained in:
@@ -44,6 +44,7 @@
|
||||
|
||||
#include <projectexplorer/buildconfiguration.h>
|
||||
#include <projectexplorer/buildmanager.h>
|
||||
#include <projectexplorer/buildsystem.h>
|
||||
#include <projectexplorer/project.h>
|
||||
#include <projectexplorer/projectexplorer.h>
|
||||
#include <projectexplorer/projectexplorersettings.h>
|
||||
@@ -64,6 +65,7 @@
|
||||
#include <QFutureInterface>
|
||||
#include <QLabel>
|
||||
#include <QLoggingCategory>
|
||||
#include <QPointer>
|
||||
#include <QProcess>
|
||||
#include <QPushButton>
|
||||
#include <QTimer>
|
||||
@@ -317,6 +319,7 @@ void TestRunner::resetInternalPointers()
|
||||
void TestRunner::prepareToRunTests(TestRunMode mode)
|
||||
{
|
||||
QTC_ASSERT(!m_executingTests, return);
|
||||
m_skipTargetsCheck = false;
|
||||
m_runMode = mode;
|
||||
ProjectExplorer::Internal::ProjectExplorerSettings projectExplorerSettings =
|
||||
ProjectExplorerPlugin::projectExplorerSettings();
|
||||
@@ -448,6 +451,17 @@ int TestRunner::precheckTestConfigurations()
|
||||
return testCaseCount;
|
||||
}
|
||||
|
||||
void TestRunner::onBuildSystemUpdated()
|
||||
{
|
||||
Target *target = SessionManager::startupTarget();
|
||||
if (QTC_GUARD(target))
|
||||
disconnect(target, &Target::buildSystemUpdated, this, &TestRunner::onBuildSystemUpdated);
|
||||
if (!m_skipTargetsCheck) {
|
||||
m_skipTargetsCheck = true;
|
||||
runOrDebugTests();
|
||||
}
|
||||
}
|
||||
|
||||
void TestRunner::runTests()
|
||||
{
|
||||
QList<TestConfiguration *> toBeRemoved;
|
||||
@@ -619,8 +633,34 @@ void TestRunner::debugTests()
|
||||
AutotestPlugin::popupResultsPane();
|
||||
}
|
||||
|
||||
static bool executablesEmpty()
|
||||
{
|
||||
Target *target = SessionManager::startupTarget();
|
||||
const QList<RunConfiguration *> configs = target->runConfigurations();
|
||||
QTC_ASSERT(!configs.isEmpty(), return false);
|
||||
if (auto execAspect = configs.first()->aspect<ExecutableAspect>())
|
||||
return execAspect->executable().isEmpty();
|
||||
return false;
|
||||
}
|
||||
|
||||
void TestRunner::runOrDebugTests()
|
||||
{
|
||||
if (!m_skipTargetsCheck) {
|
||||
if (executablesEmpty()) {
|
||||
m_skipTargetsCheck = true;
|
||||
Target * target = SessionManager::startupTarget();
|
||||
QTimer::singleShot(5000, this, [this, target = QPointer<Target>(target)]() {
|
||||
if (target) {
|
||||
disconnect(target, &Target::buildSystemUpdated,
|
||||
this, &TestRunner::onBuildSystemUpdated);
|
||||
}
|
||||
runOrDebugTests();
|
||||
});
|
||||
connect(target, &Target::buildSystemUpdated, this, &TestRunner::onBuildSystemUpdated);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
switch (m_runMode) {
|
||||
case TestRunMode::Run:
|
||||
case TestRunMode::RunWithoutDeploy:
|
||||
|
||||
Reference in New Issue
Block a user