| 48 | |
| 49 | private slots: |
| 50 | void initTestCase() |
| 51 | { |
| 52 | ClientConnectionManager::init(); |
| 53 | |
| 54 | m_process.setProcessChannelMode(QProcess::ForwardedChannels); |
| 55 | m_process.start(QLatin1String(TESTBIN_DIR "/minimalwidgetapplication"), QStringList {}); |
| 56 | QVERIFY(m_process.waitForStarted()); |
| 57 | |
| 58 | QTest::qWait(1000); // give the target some time to actually load the QtCore DLL, otherwise ABI detection fails |
| 59 | |
| 60 | { |
| 61 | LaunchOptions options; |
| 62 | options.setUiMode(LaunchOptions::NoUi); |
| 63 | options.setProbeSetting(QStringLiteral("ServerAddress"), GAMMARAY_DEFAULT_LOCAL_TCP_URL); |
| 64 | options.setPid(m_process.processId()); |
| 65 | |
| 66 | ProbeABIDetector detector; |
| 67 | options.setProbeABI(ProbeFinder::findBestMatchingABI(detector.abiForProcess(options.pid()))); |
| 68 | Launcher launcher(options); |
| 69 | |
| 70 | QSignalSpy spy(&launcher, &Launcher::attached); |
| 71 | QVERIFY(spy.isValid()); |
| 72 | QVERIFY(launcher.start()); |
| 73 | |
| 74 | spy.wait(30000); |
| 75 | QCOMPARE(spy.size(), 1); |
| 76 | |
| 77 | m_serverUrl = launcher.serverAddress(); |
| 78 | QVERIFY(m_serverUrl.isValid()); |
| 79 | QVERIFY(m_serverUrl.port() != -1); |
| 80 | } |
| 81 | } |
| 82 | |
| 83 | void testMultipleConnection() |
| 84 | { |
nothing calls this directly
no test coverage detected