forked from qt-creator/qt-creator
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 <david.schulz@qt.io>
This commit is contained in:
@@ -196,12 +196,13 @@ void TestTreeItem::markForRemovalRecursively(bool mark)
|
|||||||
|
|
||||||
void TestTreeItem::markForRemovalRecursively(const QString &filePath)
|
void TestTreeItem::markForRemovalRecursively(const QString &filePath)
|
||||||
{
|
{
|
||||||
if (m_filePath == filePath)
|
bool mark = m_filePath == filePath;
|
||||||
markForRemoval(true);
|
|
||||||
for (int row = 0, count = childCount(); row < count; ++row) {
|
for (int row = 0, count = childCount(); row < count; ++row) {
|
||||||
TestTreeItem *child = childItem(row);
|
TestTreeItem *child = childItem(row);
|
||||||
child->markForRemovalRecursively(filePath);
|
child->markForRemovalRecursively(filePath);
|
||||||
|
mark &= child->markedForRemoval();
|
||||||
}
|
}
|
||||||
|
markForRemoval(mark);
|
||||||
}
|
}
|
||||||
|
|
||||||
TestTreeItem *TestTreeItem::parentItem() const
|
TestTreeItem *TestTreeItem::parentItem() const
|
||||||
|
Reference in New Issue
Block a user