summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Stenger <christian.stenger@theqtcompany.com>2015-01-07 09:33:57 +0100
committerChristian Stenger <christian.stenger@theqtcompany.com>2015-01-09 08:24:45 +0200
commit35939ac40275621240bb4d708802a934b3bd4c65 (patch)
tree94a1499298e3e720385a6eae4f2aa907a5228573
parentba8979d0660dbff201fac6ccc79d2741108608d1 (diff)
downloadqt-creator-35939ac40275621240bb4d708802a934b3bd4c65.tar.gz
Avoid executing unnamed Quick Tests if no related main is executed anyway
Change-Id: I521065577c195713bc252e6762a88011996f045c Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
-rw-r--r--plugins/autotest/testconfiguration.cpp6
-rw-r--r--plugins/autotest/testconfiguration.h3
-rw-r--r--plugins/autotest/testtreemodel.cpp5
3 files changed, 13 insertions, 1 deletions
diff --git a/plugins/autotest/testconfiguration.cpp b/plugins/autotest/testconfiguration.cpp
index 73cdbdb918..9589d68c02 100644
--- a/plugins/autotest/testconfiguration.cpp
+++ b/plugins/autotest/testconfiguration.cpp
@@ -29,6 +29,7 @@ TestConfiguration::TestConfiguration(const QString &testClass, const QStringList
m_testClass(testClass),
m_testCases(testCases),
m_testCaseCount(testCaseCount),
+ m_unnamedOnly(false),
m_project(0)
{
if (testCases.size() != 0) {
@@ -96,5 +97,10 @@ void TestConfiguration::setProject(ProjectExplorer::Project *project)
m_project = project;
}
+void TestConfiguration::setUnnamedOnly(bool unnamedOnly)
+{
+ m_unnamedOnly = unnamedOnly;
+}
+
} // namespace Internal
} // namespace Autotest
diff --git a/plugins/autotest/testconfiguration.h b/plugins/autotest/testconfiguration.h
index 54be3697aa..8d9235b512 100644
--- a/plugins/autotest/testconfiguration.h
+++ b/plugins/autotest/testconfiguration.h
@@ -49,6 +49,7 @@ public:
void setDisplayName(const QString &displayName);
void setEnvironment(const Utils::Environment &env);
void setProject(ProjectExplorer::Project *project);
+ void setUnnamedOnly(bool unnamedOnly);
QString testClass() const { return m_testClass; }
QStringList testCases() const { return m_testCases; }
@@ -60,6 +61,7 @@ public:
QString displayName() const { return m_displayName; }
Utils::Environment environment() const { return m_environment; }
ProjectExplorer::Project *project() const { return m_project; }
+ bool unnamedOnly() const { return m_unnamedOnly; }
signals:
@@ -70,6 +72,7 @@ private:
QString m_testClass;
QStringList m_testCases;
int m_testCaseCount;
+ bool m_unnamedOnly;
QString m_proFile;
QString m_targetFile;
QString m_targetName;
diff --git a/plugins/autotest/testtreemodel.cpp b/plugins/autotest/testtreemodel.cpp
index 8425c27c1d..7060203a41 100644
--- a/plugins/autotest/testtreemodel.cpp
+++ b/plugins/autotest/testtreemodel.cpp
@@ -465,6 +465,7 @@ QList<TestConfiguration *> TestTreeModel::getSelectedTests() const
} else {
TestConfiguration *tc = new TestConfiguration(QString(), QStringList());
tc->setTestCaseCount(1);
+ tc->setUnnamedOnly(true);
addProjectInformation(tc, mainFile);
foundMains.insert(mainFile, tc);
}
@@ -499,6 +500,7 @@ QList<TestConfiguration *> TestTreeModel::getSelectedTests() const
// unnamed test case
if (oldFunctions.size() == 0) {
tc->setTestCaseCount(tc->testCaseCount() + testFunctions.size());
+ tc->setUnnamedOnly(false);
} else {
oldFunctions << testFunctions;
tc->setTestCases(oldFunctions);
@@ -513,7 +515,8 @@ QList<TestConfiguration *> TestTreeModel::getSelectedTests() const
}
foreach (TestConfiguration *config, foundMains.values())
- result << config;
+ if (!config->unnamedOnly())
+ result << config;
return result;
}