From 466fb7ea530b67ded1af2895b22e782afd809c74 Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Mon, 20 Nov 2017 09:28:19 +0100 Subject: [PATCH] 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 --- src/plugins/autotest/quick/quicktesttreeitem.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/plugins/autotest/quick/quicktesttreeitem.cpp b/src/plugins/autotest/quick/quicktesttreeitem.cpp index 953f31e6618..29f6aa4a7cc 100644 --- a/src/plugins/autotest/quick/quicktesttreeitem.cpp +++ b/src/plugins/autotest/quick/quicktesttreeitem.cpp @@ -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());