forked from qt-creator/qt-creator
AutoTest: Simplify QuickTestTreeItem::markForRemovalRecursively()
Change-Id: I3ab1876aa2d4dc04b9b5d53f373751e0f5241e75 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -430,15 +430,10 @@ QSet<QString> QuickTestTreeItem::internalTargets() const
|
|||||||
|
|
||||||
void QuickTestTreeItem::markForRemovalRecursively(const QString &filePath)
|
void QuickTestTreeItem::markForRemovalRecursively(const QString &filePath)
|
||||||
{
|
{
|
||||||
static const Core::Id id = Core::Id(Constants::FRAMEWORK_PREFIX).withSuffix(
|
auto parser = dynamic_cast<QuickTestParser *>(framework()->testParser());
|
||||||
QuickTest::Constants::FRAMEWORK_NAME);
|
|
||||||
TestTreeItem::markForRemovalRecursively(filePath);
|
|
||||||
ITestFramework *framework = TestFrameworkManager::frameworkForId(id);
|
|
||||||
QTC_ASSERT(framework, return);
|
|
||||||
auto parser = dynamic_cast<QuickTestParser *>(framework->testParser());
|
|
||||||
const QString proFile = parser->projectFileForMainCppFile(filePath);
|
const QString proFile = parser->projectFileForMainCppFile(filePath);
|
||||||
if (!proFile.isEmpty()) {
|
if (!proFile.isEmpty()) {
|
||||||
TestTreeItem *root = framework->rootNode();
|
TestTreeItem *root = framework()->rootNode();
|
||||||
root->forAllChildren([proFile](TestTreeItem *it) {
|
root->forAllChildren([proFile](TestTreeItem *it) {
|
||||||
if (it->proFile() == proFile)
|
if (it->proFile() == proFile)
|
||||||
it->markForRemoval(true);
|
it->markForRemoval(true);
|
||||||
|
Reference in New Issue
Block a user