| 46 | } |
| 47 | |
| 48 | std::vector<std::unique_ptr<CTestSuite>> |
| 49 | CTestUtils::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 | } |
nothing calls this directly
no test coverage detected