From 23e48fe207d62b16ca5cef701536ce34f3c9681d Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Wed, 7 Mar 2018 14:56:07 +0100 Subject: [PATCH] AutoTest: Fix marking for removal If marking a test case for removal by file it could be possible that children of this test case are not marked because of being located inside a different file. When performing sweep the test case and the not marked children would be gone as the test case is marked and so sweep would not look into the children. This currently can only happen for gtest based test cases as registering the tests is different and the test case stores here the path of the first found test set. Change-Id: I712054534307ee2839894c5148ae04b86b9df967 Reviewed-by: David Schulz --- src/plugins/autotest/testtreeitem.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/plugins/autotest/testtreeitem.cpp b/src/plugins/autotest/testtreeitem.cpp index a597a2de7ad..362465e923b 100644 --- a/src/plugins/autotest/testtreeitem.cpp +++ b/src/plugins/autotest/testtreeitem.cpp @@ -196,12 +196,13 @@ void TestTreeItem::markForRemovalRecursively(bool mark) void TestTreeItem::markForRemovalRecursively(const QString &filePath) { - if (m_filePath == filePath) - markForRemoval(true); + bool mark = m_filePath == filePath; for (int row = 0, count = childCount(); row < count; ++row) { TestTreeItem *child = childItem(row); child->markForRemovalRecursively(filePath); + mark &= child->markedForRemoval(); } + markForRemoval(mark); } TestTreeItem *TestTreeItem::parentItem() const