Try to guess run configuration if none is explicitly set

Additionally provide a setting to not display warnings regarding
using a guessed run configuration.

Change-Id: Ia7647f55e5085ffc84044281c5107770cd30d504
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
This commit is contained in:
Christian Stenger
2015-02-17 10:33:35 +01:00
parent b9a60137ad
commit b5341a9a03
8 changed files with 309 additions and 230 deletions

View File

@@ -30,7 +30,8 @@ TestConfiguration::TestConfiguration(const QString &testClass, const QStringList
m_testCases(testCases), m_testCases(testCases),
m_testCaseCount(testCaseCount), m_testCaseCount(testCaseCount),
m_unnamedOnly(false), m_unnamedOnly(false),
m_project(0) m_project(0),
m_guessedConfiguration(false)
{ {
if (testCases.size() != 0) { if (testCases.size() != 0) {
m_testCaseCount = testCases.size(); m_testCaseCount = testCases.size();
@@ -102,5 +103,10 @@ void TestConfiguration::setUnnamedOnly(bool unnamedOnly)
m_unnamedOnly = unnamedOnly; m_unnamedOnly = unnamedOnly;
} }
void TestConfiguration::setGuessedConfiguration(bool guessed)
{
m_guessedConfiguration = guessed;
}
} // namespace Internal } // namespace Internal
} // namespace Autotest } // namespace Autotest

View File

@@ -50,6 +50,7 @@ public:
void setEnvironment(const Utils::Environment &env); void setEnvironment(const Utils::Environment &env);
void setProject(ProjectExplorer::Project *project); void setProject(ProjectExplorer::Project *project);
void setUnnamedOnly(bool unnamedOnly); void setUnnamedOnly(bool unnamedOnly);
void setGuessedConfiguration(bool guessed);
QString testClass() const { return m_testClass; } QString testClass() const { return m_testClass; }
QStringList testCases() const { return m_testCases; } QStringList testCases() const { return m_testCases; }
@@ -62,7 +63,7 @@ public:
Utils::Environment environment() const { return m_environment; } Utils::Environment environment() const { return m_environment; }
ProjectExplorer::Project *project() const { return m_project; } ProjectExplorer::Project *project() const { return m_project; }
bool unnamedOnly() const { return m_unnamedOnly; } bool unnamedOnly() const { return m_unnamedOnly; }
bool guessedConfiguration() const { return m_guessedConfiguration; }
signals: signals:
@@ -80,6 +81,7 @@ private:
QString m_displayName; QString m_displayName;
Utils::Environment m_environment; Utils::Environment m_environment;
ProjectExplorer::Project *m_project; ProjectExplorer::Project *m_project;
bool m_guessedConfiguration;
}; };
} // namespace Internal } // namespace Internal

View File

@@ -185,12 +185,17 @@ void performTestRun(QFutureInterface<void> &futureInterface,
void TestRunner::runTests() void TestRunner::runTests()
{ {
const QSharedPointer<TestSettings> settings = AutotestPlugin::instance()->settings();
const int timeout = settings->timeout;
const QString metricsOption = TestSettings::metricsTypeToOption(settings->metrics);
const bool displayRunConfigWarnings = !settings->omitRunConfigWarn;
// clear old log and output pane // clear old log and output pane
TestResultsPane::instance()->clearContents(); TestResultsPane::instance()->clearContents();
// handle faulty test configurations // handle faulty test configurations
QList<TestConfiguration *> toBeRemoved; QList<TestConfiguration *> toBeRemoved;
foreach (TestConfiguration *config, m_selectedTests) foreach (TestConfiguration *config, m_selectedTests) {
if (!config->project()) { if (!config->project()) {
toBeRemoved.append(config); toBeRemoved.append(config);
TestResultsPane::instance()->addTestResult(FaultyTestResult(Result::MESSAGE_WARN, TestResultsPane::instance()->addTestResult(FaultyTestResult(Result::MESSAGE_WARN,
@@ -198,6 +203,12 @@ void TestRunner::runTests()
"This might be the case for a faulty environment or similar." "This might be the case for a faulty environment or similar."
).arg(config->displayName()))); ).arg(config->displayName())));
} }
if (displayRunConfigWarnings && config->guessedConfiguration()) {
TestResultsPane::instance()->addTestResult(FaultyTestResult(Result::MESSAGE_WARN,
tr("*** Project's run configuration was guessed for '%1' ***\n"
"This might cause trouble during execution.").arg(config->displayName())));
}
}
foreach (TestConfiguration *config, toBeRemoved) { foreach (TestConfiguration *config, toBeRemoved) {
m_selectedTests.removeOne(config); m_selectedTests.removeOne(config);
delete config; delete config;
@@ -243,10 +254,6 @@ void TestRunner::runTests()
TestResultsPane::instance(), &TestResultsPane::addTestResult, TestResultsPane::instance(), &TestResultsPane::addTestResult,
Qt::QueuedConnection); Qt::QueuedConnection);
const QSharedPointer<TestSettings> settings = AutotestPlugin::instance()->settings();
const int timeout = settings->timeout;
const QString metricsOption = TestSettings::metricsTypeToOption(settings->metrics);
emit testRunStarted(); emit testRunStarted();
QFuture<void> future = QtConcurrent::run(&performTestRun, m_selectedTests, timeout, metricsOption, this); QFuture<void> future = QtConcurrent::run(&performTestRun, m_selectedTests, timeout, metricsOption, this);

View File

@@ -27,10 +27,11 @@ static const char group[] = "Autotest";
static const char timeoutKey[] = "Timeout"; static const char timeoutKey[] = "Timeout";
static const char metricsKey[] = "Metrics"; static const char metricsKey[] = "Metrics";
static const char omitInternalKey[] = "OmitInternal"; static const char omitInternalKey[] = "OmitInternal";
static const char omitRunConfigWarnKey[] = "OmitRCWarnings";
static const int defaultTimeout = 60000; static const int defaultTimeout = 60000;
TestSettings::TestSettings() TestSettings::TestSettings()
: timeout(defaultTimeout), metrics(Walltime), omitInternalMssg(true) : timeout(defaultTimeout), metrics(Walltime), omitInternalMssg(true), omitRunConfigWarn(false)
{ {
} }
@@ -40,6 +41,7 @@ void TestSettings::toSettings(QSettings *s) const
s->setValue(QLatin1String(timeoutKey), timeout); s->setValue(QLatin1String(timeoutKey), timeout);
s->setValue(QLatin1String(metricsKey), metrics); s->setValue(QLatin1String(metricsKey), metrics);
s->setValue(QLatin1String(omitInternalKey), omitInternalMssg); s->setValue(QLatin1String(omitInternalKey), omitInternalMssg);
s->setValue(QLatin1String(omitRunConfigWarnKey), omitRunConfigWarn);
s->endGroup(); s->endGroup();
} }
@@ -67,12 +69,14 @@ void TestSettings::fromSettings(const QSettings *s)
timeout = s->value(root + QLatin1String(timeoutKey), defaultTimeout).toInt(); timeout = s->value(root + QLatin1String(timeoutKey), defaultTimeout).toInt();
metrics = intToMetrics(s->value(root + QLatin1String(metricsKey), Walltime).toInt()); metrics = intToMetrics(s->value(root + QLatin1String(metricsKey), Walltime).toInt());
omitInternalMssg = s->value(root + QLatin1String(omitInternalKey), true).toBool(); omitInternalMssg = s->value(root + QLatin1String(omitInternalKey), true).toBool();
omitRunConfigWarn = s->value(root + QLatin1String(omitRunConfigWarnKey), false).toBool();
} }
bool TestSettings::equals(const TestSettings &rhs) const bool TestSettings::equals(const TestSettings &rhs) const
{ {
return timeout == rhs.timeout && metrics == rhs.metrics return timeout == rhs.timeout && metrics == rhs.metrics
&& omitInternalMssg == rhs.omitInternalMssg; && omitInternalMssg == rhs.omitInternalMssg
&& omitRunConfigWarn == rhs.omitRunConfigWarn;
} }
QString TestSettings::metricsTypeToOption(const MetricsType type) QString TestSettings::metricsTypeToOption(const MetricsType type)

View File

@@ -47,6 +47,7 @@ struct TestSettings
int timeout; int timeout;
MetricsType metrics; MetricsType metrics;
bool omitInternalMssg; bool omitInternalMssg;
bool omitRunConfigWarn;
}; };
inline bool operator==(const TestSettings &s1, const TestSettings &s2) { return s1.equals(s2); } inline bool operator==(const TestSettings &s1, const TestSettings &s2) { return s1.equals(s2); }

View File

@@ -39,6 +39,7 @@ void TestSettingsWidget::setSettings(const TestSettings &settings)
{ {
m_ui.timeoutSpin->setValue(settings.timeout / 1000); // we store milliseconds m_ui.timeoutSpin->setValue(settings.timeout / 1000); // we store milliseconds
m_ui.omitInternalMsgCB->setChecked(settings.omitInternalMssg); m_ui.omitInternalMsgCB->setChecked(settings.omitInternalMssg);
m_ui.omitRunConfigWarnCB->setChecked(settings.omitRunConfigWarn);
switch (settings.metrics) { switch (settings.metrics) {
case MetricsType::Walltime: case MetricsType::Walltime:
@@ -66,6 +67,7 @@ TestSettings TestSettingsWidget::settings() const
TestSettings result; TestSettings result;
result.timeout = m_ui.timeoutSpin->value() * 1000; // we display seconds result.timeout = m_ui.timeoutSpin->value() * 1000; // we display seconds
result.omitInternalMssg = m_ui.omitInternalMsgCB->isChecked(); result.omitInternalMssg = m_ui.omitInternalMsgCB->isChecked();
result.omitRunConfigWarn = m_ui.omitRunConfigWarnCB->isChecked();
if (m_ui.walltimeRB->isChecked()) if (m_ui.walltimeRB->isChecked())
result.metrics = MetricsType::Walltime; result.metrics = MetricsType::Walltime;

View File

@@ -6,252 +6,276 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>462</width> <width>463</width>
<height>292</height> <height>338</height>
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
<string>Form</string> <string>Form</string>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_3"> <widget class="QWidget" name="">
<item> <property name="geometry">
<layout class="QHBoxLayout" name="horizontalLayout_3"> <rect>
<item> <x>9</x>
<layout class="QVBoxLayout" name="verticalLayout_2"> <y>10</y>
<item> <width>435</width>
<layout class="QHBoxLayout" name="horizontalLayout"> <height>307</height>
<item> </rect>
<widget class="QLabel" name="label"> </property>
<property name="toolTip"> <layout class="QVBoxLayout" name="verticalLayout_4">
<string>Timeout used when executing test cases. This will apply for each test case on its own, not the whole project.</string> <item>
</property> <layout class="QHBoxLayout" name="horizontalLayout_3">
<property name="text"> <item>
<string>Timeout:</string> <layout class="QVBoxLayout" name="verticalLayout_2">
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="timeoutSpin">
<property name="toolTip">
<string>Timeout used when executing test cases. This will apply for each test case on its own, not the whole project.</string>
</property>
<property name="suffix">
<string> s</string>
</property>
<property name="minimum">
<number>5</number>
</property>
<property name="maximum">
<number>36000</number>
</property>
<property name="value">
<number>60</number>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
<item>
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QCheckBox" name="omitInternalMsgCB">
<property name="toolTip">
<string>If checked Internal Messages won't be shown by default. (You can still enable them on the test results filter)</string>
</property>
<property name="text">
<string>Omit Internal Messages</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
<widget class="QGroupBox" name="groupBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="title">
<string>Benchmark Metrics</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item> <item>
<layout class="QVBoxLayout" name="verticalLayout"> <layout class="QHBoxLayout" name="horizontalLayout">
<item> <item>
<widget class="QRadioButton" name="walltimeRB"> <widget class="QLabel" name="label">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip"> <property name="toolTip">
<string>Use Walltime metrics for executing benchmarks. (default)</string> <string>Timeout used when executing test cases. This will apply for each test case on its own, not the whole project.</string>
</property> </property>
<property name="text"> <property name="text">
<string>Walltime</string> <string>Timeout:</string>
</property>
<property name="checked">
<bool>true</bool>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QRadioButton" name="tickcounterRB"> <widget class="QSpinBox" name="timeoutSpin">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip"> <property name="toolTip">
<string>Use tick counter for executing benchmarks.</string> <string>Timeout used when executing test cases. This will apply for each test case on its own, not the whole project.</string>
</property> </property>
<property name="text"> <property name="suffix">
<string>Tickcounter</string> <string> s</string>
</property> </property>
</widget> <property name="minimum">
</item> <number>5</number>
<item>
<widget class="QRadioButton" name="eventCounterRB">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property> </property>
<property name="toolTip"> <property name="maximum">
<string>Use event counter when executing benchmarks.</string> <number>36000</number>
</property> </property>
<property name="text"> <property name="value">
<string>Eventcounter</string> <number>60</number>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="callgrindRB">
<property name="enabled">
<bool>false</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Use callgrind when executing benchmark. (valgrind must be installed)</string>
</property>
<property name="text">
<string>Callgrind</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="perfRB">
<property name="enabled">
<bool>false</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Use perf when executing benchmarks. (perf must be installed)</string>
</property>
<property name="text">
<string>Perf</string>
</property> </property>
</widget> </widget>
</item> </item>
</layout> </layout>
</item> </item>
</layout> </layout>
</widget> </item>
</item> <item>
<item> <spacer name="horizontalSpacer_3">
<spacer name="horizontalSpacer_2"> <property name="orientation">
<property name="orientation"> <enum>Qt::Horizontal</enum>
<enum>Qt::Horizontal</enum> </property>
</property> <property name="sizeType">
<property name="sizeHint" stdset="0"> <enum>QSizePolicy::Fixed</enum>
<size> </property>
<width>40</width> <property name="sizeHint" stdset="0">
<height>20</height> <size>
</size> <width>40</width>
</property> <height>20</height>
</spacer> </size>
</item> </property>
</layout> </spacer>
</item> </item>
<item> <item>
<spacer name="verticalSpacer_2"> <layout class="QVBoxLayout" name="verticalLayout_3">
<property name="orientation"> <item>
<enum>Qt::Vertical</enum> <widget class="QCheckBox" name="omitInternalMsgCB">
</property> <property name="toolTip">
<property name="sizeHint" stdset="0"> <string>If checked Internal Messages won't be shown by default. (You can still enable them on the test results filter)</string>
<size> </property>
<width>20</width> <property name="text">
<height>40</height> <string>Omit Internal Messages</string>
</size> </property>
</property> <property name="checked">
</spacer> <bool>true</bool>
</item> </property>
</layout> </widget>
</item>
<item>
<widget class="QCheckBox" name="omitRunConfigWarnCB">
<property name="toolTip">
<string>If checked Warnings regarding a guessed Run Configuration won't be shown.</string>
</property>
<property name="text">
<string>Omit Run Configuration Warnings</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
<widget class="QGroupBox" name="groupBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="title">
<string>Benchmark Metrics</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QRadioButton" name="walltimeRB">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Use Walltime metrics for executing benchmarks. (default)</string>
</property>
<property name="text">
<string>Walltime</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="tickcounterRB">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Use tick counter for executing benchmarks.</string>
</property>
<property name="text">
<string>Tickcounter</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="eventCounterRB">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Use event counter when executing benchmarks.</string>
</property>
<property name="text">
<string>Eventcounter</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="callgrindRB">
<property name="enabled">
<bool>false</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Use callgrind when executing benchmark. (valgrind must be installed)</string>
</property>
<property name="text">
<string>Callgrind</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="perfRB">
<property name="enabled">
<bool>false</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Use perf when executing benchmarks. (perf must be installed)</string>
</property>
<property name="text">
<string>Perf</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</widget> </widget>
<resources/> <resources/>
<connections/> <connections/>

View File

@@ -27,6 +27,7 @@
#include <projectexplorer/environmentaspect.h> #include <projectexplorer/environmentaspect.h>
#include <projectexplorer/localapplicationrunconfiguration.h> #include <projectexplorer/localapplicationrunconfiguration.h>
#include <projectexplorer/project.h> #include <projectexplorer/project.h>
#include <projectexplorer/projectnodes.h>
#include <projectexplorer/runconfiguration.h> #include <projectexplorer/runconfiguration.h>
#include <projectexplorer/session.h> #include <projectexplorer/session.h>
#include <projectexplorer/target.h> #include <projectexplorer/target.h>
@@ -385,8 +386,10 @@ static void addProjectInformation(TestConfiguration *config, const QString &file
QString workDir; QString workDir;
QString proFile; QString proFile;
QString displayName; QString displayName;
ProjectExplorer::Project *targetProject = 0;
Utils::Environment env; Utils::Environment env;
bool hasDesktopTarget = false; bool hasDesktopTarget = false;
bool guessedRunConfiguration = false;
CppTools::CppModelManager *cppMM = CppTools::CppModelManager::instance(); CppTools::CppModelManager *cppMM = CppTools::CppModelManager::instance();
QList<CppTools::ProjectPart::Ptr> projParts = cppMM->projectInfo(project).projectParts(); QList<CppTools::ProjectPart::Ptr> projParts = cppMM->projectInfo(project).projectParts();
@@ -396,6 +399,7 @@ static void addProjectInformation(TestConfiguration *config, const QString &file
if (currentFile.path == filePath) { if (currentFile.path == filePath) {
proFile = part->projectFile; proFile = part->projectFile;
displayName = part->displayName; displayName = part->displayName;
targetProject = part->project;
break; break;
} }
} }
@@ -429,6 +433,34 @@ static void addProjectInformation(TestConfiguration *config, const QString &file
break; break;
} }
} }
// if we could not figure out the run configuration
// try to use the run configuration of the parent project
if (!hasDesktopTarget && targetProject && !targetFile.isEmpty()) {
QList<ProjectExplorer::RunConfiguration *> rcs = target->runConfigurations();
foreach (ProjectExplorer::RunConfiguration *rc, rcs) {
ProjectExplorer::LocalApplicationRunConfiguration *localRunConfiguration
= qobject_cast<ProjectExplorer::LocalApplicationRunConfiguration *>(rc);
if (localRunConfiguration) {
if (ProjectExplorer::ProjectNode *localRootProjectNode = targetProject->rootProjectNode()) {
QList<ProjectExplorer::FileNode *> localFileNodes = localRootProjectNode->fileNodes();
if (localFileNodes.size()) {
if (localFileNodes.at(0)->path()
== targetProject->projectFilePath()) {
hasDesktopTarget = true;
workDir = Utils::FileUtils::normalizePathName(
localRunConfiguration->workingDirectory());
ProjectExplorer::EnvironmentAspect *environmentAspect
= localRunConfiguration->extraAspect<ProjectExplorer::EnvironmentAspect>();
env = environmentAspect->environment();
guessedRunConfiguration = true;
break;
}
}
}
}
}
}
} }
} }
@@ -440,6 +472,7 @@ static void addProjectInformation(TestConfiguration *config, const QString &file
config->setEnvironment(env); config->setEnvironment(env);
config->setProject(project); config->setProject(project);
config->setDisplayName(displayName); config->setDisplayName(displayName);
config->setGuessedConfiguration(guessedRunConfiguration);
} else { } else {
config->setProFile(proFile); config->setProFile(proFile);
config->setDisplayName(displayName); config->setDisplayName(displayName);