MCPcopy Create free account
hub / github.com/KDAB/GammaRay / initTestCase

Method initTestCase

tests/clientconnectiontest.cpp:50–81  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

48
49private 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 {

Callers

nothing calls this directly

Calls 12

findBestMatchingABIFunction · 0.85
setUiModeMethod · 0.80
setProbeSettingMethod · 0.80
setProbeABIMethod · 0.80
abiForProcessMethod · 0.80
initFunction · 0.70
startMethod · 0.45
setPidMethod · 0.45
pidMethod · 0.45
isValidMethod · 0.45
sizeMethod · 0.45
serverAddressMethod · 0.45

Tested by

no test coverage detected