| 329 | } |
| 330 | |
| 331 | void TestCMakeManager::testExecutableOutputPath() |
| 332 | { |
| 333 | const auto prevSuitesCount = ICore::self()->testController()->testSuites().count(); |
| 334 | qRegisterMetaType<KDevelop::ITestSuite*>("KDevelop::ITestSuite*"); |
| 335 | QSignalSpy spy(ICore::self()->testController(), &ITestController::testSuiteAdded); |
| 336 | |
| 337 | IProject* project = loadProject(QStringLiteral("randomexe")); |
| 338 | const auto targets = project->projectItem()->targetList(); |
| 339 | QCOMPARE(targets.count(), 1); |
| 340 | |
| 341 | const auto target = targets.first()->executable(); |
| 342 | QVERIFY(target); |
| 343 | const KDevelop::Path exePath(target->executable()->builtUrl()); |
| 344 | QString executableSuffix; |
| 345 | #ifdef Q_OS_WIN |
| 346 | executableSuffix = ".exe"; |
| 347 | #endif |
| 348 | QCOMPARE(exePath, |
| 349 | Path(project->buildSystemManager()->buildDirectory(project->projectItem()), |
| 350 | "randomplace/mytest" + executableSuffix)); |
| 351 | |
| 352 | QVERIFY(spy.count() || spy.wait(100000)); |
| 353 | |
| 354 | auto suites = ICore::self()->testController()->testSuites(); |
| 355 | QCOMPARE(suites.count(), prevSuitesCount + 1); |
| 356 | const CTestSuite* suite = static_cast<CTestSuite*>(ICore::self()->testController()->findTestSuite(project, "mytest")); |
| 357 | QCOMPARE(suite->executable(), exePath); |
| 358 | } |
| 359 | |
| 360 | #include "moc_test_cmakemanager.cpp" |
nothing calls this directly
no test coverage detected