| 97 | } |
| 98 | |
| 99 | void 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 | |
| 123 | void TestCMakeManager::testTargetIncludeDirectories() |
| 124 | { |
nothing calls this directly
no test coverage detected