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

Method testExecutableOutputPath

plugins/cmake/tests/test_cmakemanager.cpp:331–358  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

329}
330
331void 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"

Callers

nothing calls this directly

Calls 14

testControllerMethod · 0.80
targetListMethod · 0.80
buildSystemManagerMethod · 0.80
waitMethod · 0.80
findTestSuiteMethod · 0.80
loadProjectFunction · 0.70
PathClass · 0.50
countMethod · 0.45
testSuitesMethod · 0.45
projectItemMethod · 0.45
executableMethod · 0.45
firstMethod · 0.45

Tested by

no test coverage detected