Commit 35939ac4 authored by Christian Stenger's avatar Christian Stenger
Browse files

Avoid executing unnamed Quick Tests if no related main is executed anyway



Change-Id: I521065577c195713bc252e6762a88011996f045c
Reviewed-by: default avatarTim Jenssen <tim.jenssen@theqtcompany.com>
parent ba8979d0
......@@ -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
......@@ -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;
......
......@@ -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,6 +515,7 @@ QList<TestConfiguration *> TestTreeModel::getSelectedTests() const
}
foreach (TestConfiguration *config, foundMains.values())
if (!config->unnamedOnly())
result << config;
return result;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment