Changeset View
Changeset View
Standalone View
Standalone View
plugins/cmake/tests/test_cmakemanager.cpp
Show First 20 Lines • Show All 373 Lines • ▼ Show 20 Line(s) | 373 | { | |||
---|---|---|---|---|---|
374 | const auto prevSuitesCount = ICore::self()->testController()->testSuites().count(); | 374 | const auto prevSuitesCount = ICore::self()->testController()->testSuites().count(); | ||
375 | qRegisterMetaType<KDevelop::ITestSuite*>("KDevelop::ITestSuite*"); | 375 | qRegisterMetaType<KDevelop::ITestSuite*>("KDevelop::ITestSuite*"); | ||
376 | QSignalSpy spy(ICore::self()->testController(), &ITestController::testSuiteAdded); | 376 | QSignalSpy spy(ICore::self()->testController(), &ITestController::testSuiteAdded); | ||
377 | 377 | | |||
378 | IProject* project = loadProject(QStringLiteral("randomexe")); | 378 | IProject* project = loadProject(QStringLiteral("randomexe")); | ||
379 | const auto targets = project->projectItem()->targetList(); | 379 | const auto targets = project->projectItem()->targetList(); | ||
380 | QCOMPARE(targets.count(), 1); | 380 | QCOMPARE(targets.count(), 1); | ||
381 | 381 | | |||
382 | const auto target = targets.constFirst()->executable(); | 382 | const auto target = targets.first()->executable(); | ||
383 | QVERIFY(target); | 383 | QVERIFY(target); | ||
384 | const KDevelop::Path exePath(target->executable()->builtUrl()); | 384 | const KDevelop::Path exePath(target->executable()->builtUrl()); | ||
385 | QCOMPARE(exePath, KDevelop::Path(project->buildSystemManager()->buildDirectory(project->projectItem()), QLatin1String("randomplace/mytest"))); | 385 | QCOMPARE(exePath, KDevelop::Path(project->buildSystemManager()->buildDirectory(project->projectItem()), QLatin1String("randomplace/mytest"))); | ||
386 | 386 | | |||
387 | QVERIFY(spy.count() || spy.wait(100000)); | 387 | QVERIFY(spy.count() || spy.wait(100000)); | ||
388 | 388 | | |||
389 | auto suites = ICore::self()->testController()->testSuites(); | 389 | auto suites = ICore::self()->testController()->testSuites(); | ||
390 | QCOMPARE(suites.count(), prevSuitesCount + 1); | 390 | QCOMPARE(suites.count(), prevSuitesCount + 1); | ||
391 | const CTestSuite* suite = static_cast<CTestSuite*>(ICore::self()->testController()->findTestSuite(project, "mytest")); | 391 | const CTestSuite* suite = static_cast<CTestSuite*>(ICore::self()->testController()->findTestSuite(project, "mytest")); | ||
392 | QCOMPARE(suite->executable(), exePath); | 392 | QCOMPARE(suite->executable(), exePath); | ||
393 | } | 393 | } |