Add convenience functions for creating ProjectExplorer::HeaderPaths

Change-Id: I7b1f63caca6b70ba4ec1b1870b83cbf20aa6564a
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
Christian Kandeler
2021-08-24 15:30:04 +02:00
parent 5805208cec
commit 25ff15a1fb
22 changed files with 116 additions and 122 deletions

View File

@@ -294,7 +294,7 @@ void QuickFixOperationTest::run(const QList<QuickFixTestDocument::Ptr> &testDocu
int operationIndex)
{
ProjectExplorer::HeaderPaths headerPaths;
headerPaths.push_back({headerPath, ProjectExplorer::HeaderPathType::User});
headerPaths.push_back(ProjectExplorer::HeaderPath::makeUser(headerPath));
QuickFixOperationTest(testDocuments, factory, headerPaths, operationIndex);
}
@@ -5792,12 +5792,10 @@ void QuickfixTest::testAddIncludeForUndefinedIdentifierNoDoubleQtHeaderInclude()
original = expected = "@QDir dir;\n";
testDocuments << QuickFixTestDocument::create(base + "/fileWantsToUseQDir.cpp", original, expected);
ProjectExplorer::HeaderPaths headerPaths{{TestIncludePaths::globalQtCoreIncludePath(),
ProjectExplorer::HeaderPathType::User}};
AddIncludeForUndefinedIdentifier factory;
const QStringList expectedOperations = QStringList("Add #include <QDir>");
QuickFixOfferedOperationsTest(testDocuments, &factory, headerPaths, expectedOperations);
QuickFixOfferedOperationsTest(testDocuments, &factory, ProjectExplorer::toUserHeaderPaths(
QStringList{TestIncludePaths::globalQtCoreIncludePath()}), expectedOperations);
}
void QuickfixTest::testAddForwardDeclForUndefinedIdentifier_data()