diff options
-rw-r--r-- | plugins/autotest/testconfiguration.cpp | 6 | ||||
-rw-r--r-- | plugins/autotest/testconfiguration.h | 3 | ||||
-rw-r--r-- | plugins/autotest/testtreemodel.cpp | 5 |
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; } |