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

Method createTestSuites

plugins/cmake/testing/ctestutils.cpp:48–76  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

46}
47
48std::vector<std::unique_ptr<CTestSuite>>
49CTestUtils::createTestSuites(const QVector<CMakeTest>& testSuites,
50 const QHash<KDevelop::Path, QVector<CMakeTarget>>& targets, KDevelop::IProject* project)
51{
52 std::vector<std::unique_ptr<CTestSuite>> suites;
53 suites.reserve(testSuites.size());
54 for (const CMakeTest& test : testSuites) {
55 KDevelop::Path executablePath;
56 CMakeTarget target;
57
58 if (QDir::isAbsolutePath(test.executable)) {
59 executablePath = KDevelop::Path(test.executable);
60 target = targetByExe(targets, executablePath);
61 } else {
62 target = targetByName(targets, test.executable);
63 if (target.artifacts.isEmpty()) {
64 continue;
65 }
66 executablePath = target.artifacts.first();
67 }
68
69 qCDebug(CMAKE_TESTING) << "looking for tests in test" << test.name << "target" << target.name << "with sources"
70 << target.sources;
71
72 suites.push_back(std::make_unique<CTestSuite>(test.name, executablePath, target.sources.toList(), project,
73 test.arguments, test.properties));
74 }
75 return suites;
76}

Callers

nothing calls this directly

Calls 10

targetByExeFunction · 0.85
targetByNameFunction · 0.85
isAbsolutePathFunction · 0.50
PathClass · 0.50
reserveMethod · 0.45
sizeMethod · 0.45
isEmptyMethod · 0.45
firstMethod · 0.45
push_backMethod · 0.45
toListMethod · 0.45

Tested by

no test coverage detected