AutoTest: Fix running Quick Tests with special functions

If special functions (init, initTestCase, cleanup, cleanupTestCase)
are present for a Quick Test they must get ignored when trying to
run a single test as they cannot get explicitly addressed.

Task-number: QTCREATORBUG-19311
Change-Id: Ie91928271928cf581bfef0b5e3463e027af985fd
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Christian Stenger
2017-11-20 09:28:19 +01:00
parent fae4f2c9b5
commit 466fb7ea53

View File

@@ -123,8 +123,12 @@ TestConfiguration *QuickTestTreeItem::testConfiguration() const
switch (type()) {
case TestCase: {
QStringList testFunctions;
for (int row = 0, count = childCount(); row < count; ++row)
testFunctions << name() + "::" + childItem(row)->name();
for (int row = 0, count = childCount(); row < count; ++row) {
const TestTreeItem *child = childItem(row);
if (child->type() == TestTreeItem::TestSpecialFunction)
continue;
testFunctions << name() + "::" + child->name();
}
config = new QuickTestConfiguration;
config->setTestCases(testFunctions);
config->setProjectFile(proFile());