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

Method testIncludePaths

plugins/cmake/tests/test_cmakemanager.cpp:60–81  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

58}
59
60void TestCMakeManager::testIncludePaths()
61{
62 IProject* project = loadProject(QStringLiteral("single_subdirectory"));
63 Path sourceDir = project->path();
64
65 Path fooCpp(sourceDir, QStringLiteral("subdir/foo.cpp"));
66 QVERIFY(QFile::exists(fooCpp.toLocalFile()));
67 QList< ProjectBaseItem* > items = project->itemsForPath(IndexedString(fooCpp.pathOrUrl()));
68 ProjectBaseItem* fooCppItem = items.first();
69
70 Path::List includeDirs = project->buildSystemManager()->includeDirectories(fooCppItem);
71 QVERIFY(includeDirs.size() >= 3);
72
73 Path buildDir(project->buildSystemManager()->buildDirectory(fooCppItem));
74 QVERIFY(includeDirs.contains(buildDir));
75
76 Path subBuildDir(buildDir, QStringLiteral("subdir/"));
77 QVERIFY(includeDirs.contains(subBuildDir));
78
79 Path subDir(sourceDir, QStringLiteral("subdir/"));
80 QVERIFY(includeDirs.contains(subDir));
81}
82
83void TestCMakeManager::testRelativePaths()
84{

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
firstMethod · 0.45
includeDirectoriesMethod · 0.45
sizeMethod · 0.45
buildDirectoryMethod · 0.45
containsMethod · 0.45

Tested by

no test coverage detected