MCPcopy Create free account
hub / github.com/KDE/kdevelop / testTargetIncludePaths

Method testTargetIncludePaths

plugins/cmake/tests/test_cmakemanager.cpp:99–121  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

97}
98
99void TestCMakeManager::testTargetIncludePaths()
100{
101 IProject* project = loadProject(QStringLiteral("target_includes"));
102
103 Path mainCpp(project->path(), QStringLiteral("main.cpp"));
104 QVERIFY(QFile::exists(mainCpp.toLocalFile()));
105 const QList<ProjectBaseItem*> items = project->itemsForPath(IndexedString(mainCpp.pathOrUrl()));
106 QCOMPARE(items.size(), 2); // once the plain file, once the target
107
108 bool foundInTarget = false;
109 for (ProjectBaseItem* mainCppItem : items) {
110 ProjectBaseItem* mainContainer = mainCppItem->parent();
111
112 Path::List includeDirs = project->buildSystemManager()->includeDirectories(mainCppItem);
113
114 if (mainContainer->target()) {
115 foundInTarget = true;
116 Path targetIncludesDir(project->path(), QStringLiteral("includes/"));
117 QVERIFY(includeDirs.contains(targetIncludesDir));
118 }
119 }
120 QVERIFY(foundInTarget);
121}
122
123void TestCMakeManager::testTargetIncludeDirectories()
124{

Callers

nothing calls this directly

Calls 12

toLocalFileMethod · 0.80
pathOrUrlMethod · 0.80
buildSystemManagerMethod · 0.80
loadProjectFunction · 0.70
IndexedStringClass · 0.50
pathMethod · 0.45
itemsForPathMethod · 0.45
sizeMethod · 0.45
parentMethod · 0.45
includeDirectoriesMethod · 0.45
targetMethod · 0.45
containsMethod · 0.45

Tested by

no test coverage detected