diff options
author | Christian Stenger <christian.stenger@qt.io> | 2017-07-04 13:22:18 +0200 |
---|---|---|
committer | Christian Stenger <christian.stenger@qt.io> | 2017-08-08 04:55:16 +0000 |
commit | 58aef639594de8f7e0593fa48fc41a2a04a69544 (patch) | |
tree | 0167e463ca94e18145e99a35e8926650b815f08b | |
parent | f8caf4f3679f38288c32f637bde6ab4f754cca57 (diff) | |
download | qt-creator-58aef639594de8f7e0593fa48fc41a2a04a69544.tar.gz |
AutoTest: Fix handling of running selected Quick Tests
Unnamed Quick Tests cannot get explicitly selected.
They also should not get executed implicitly if we try
to execute a named Quick Test of the same project, but
only if "Run All" is triggered.
Task-number: QTCREATORBUG-18501
Change-Id: I5cddbca5bffd2d5f82e121e0455226e4b388a293
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
-rw-r--r-- | src/plugins/autotest/quick/quicktesttreeitem.cpp | 34 |
1 files changed, 3 insertions, 31 deletions
diff --git a/src/plugins/autotest/quick/quicktesttreeitem.cpp b/src/plugins/autotest/quick/quicktesttreeitem.cpp index 8edff98f4a..9ebcdd48c6 100644 --- a/src/plugins/autotest/quick/quicktesttreeitem.cpp +++ b/src/plugins/autotest/quick/quicktesttreeitem.cpp @@ -193,31 +193,10 @@ QList<TestConfiguration *> QuickTestTreeItem::getSelectedTestConfigurations() co QuickTestConfiguration *tc = nullptr; QHash<QString, QuickTestConfiguration *> foundProFiles; - // unnamed Quick Tests must be handled first - if (TestTreeItem *unnamed = unnamedQuickTests()) { - for (int childRow = 0, ccount = unnamed->childCount(); childRow < ccount; ++ childRow) { - const TestTreeItem *grandChild = unnamed->childItem(childRow); - const QString &proFile = grandChild->proFile(); - if (foundProFiles.contains(proFile)) { - QTC_ASSERT(tc, - qWarning() << "Illegal state (unnamed Quick Test listed as named)"; - return QList<TestConfiguration *>()); - foundProFiles[proFile]->setTestCaseCount(tc->testCaseCount() + 1); - } else { - tc = new QuickTestConfiguration; - tc->setTestCaseCount(1); - tc->setUnnamedOnly(true); - tc->setProjectFile(proFile); - tc->setProject(project); - tc->setInternalTargets(grandChild->internalTargets()); - foundProFiles.insert(proFile, tc); - } - } - } for (int row = 0, count = childCount(); row < count; ++row) { const TestTreeItem *child = childItem(row); - // unnamed Quick Tests have been handled separately already + // unnamed Quick Tests cannot get selected explicitly if (child->name().isEmpty()) continue; @@ -239,15 +218,8 @@ QList<TestConfiguration *> QuickTestTreeItem::getSelectedTestConfigurations() co if (foundProFiles.contains(child->proFile())) { tc = foundProFiles[child->proFile()]; QStringList oldFunctions(tc->testCases()); - // if oldFunctions.size() is 0 this test configuration is used for at least one - // unnamed test case - if (oldFunctions.size() == 0) { - tc->setTestCaseCount(tc->testCaseCount() + testFunctions.size()); - tc->setUnnamedOnly(false); - } else { - oldFunctions << testFunctions; - tc->setTestCases(oldFunctions); - } + oldFunctions << testFunctions; + tc->setTestCases(oldFunctions); } else { tc = new QuickTestConfiguration; tc->setTestCases(testFunctions); |