MCPcopy Create free account
hub / github.com/Martchus/syncthingtray / SyncthingTestInstance

Method SyncthingTestInstance

testhelper/syncthingtestinstance.cpp:29–44  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

27static char *dummy2;
28
29SyncthingTestInstance::SyncthingTestInstance()
30 : m_apiKey(QStringLiteral("syncthingtestinstance"))
31 , m_app(dummy1, &dummy2)
32 , m_interleavedOutput(false)
33 , m_processSupposedToRun(false)
34{
35 if (const auto error = m_dataDir.errorString(); !error.isEmpty()) {
36 throw std::runtime_error("Unable to create temporary directory: " + error.toStdString());
37 }
38 qputenv(PROJECT_VARNAME_UPPER "_LOCAL_DATA_DIR", m_dataDir.path().toUtf8());
39
40 QObject::connect(&m_syncthingProcess, &Data::SyncthingProcess::errorOccurred, &m_syncthingProcess,
41 std::bind(&SyncthingTestInstance::handleError, this, _1), Qt::QueuedConnection);
42 QObject::connect(&m_syncthingProcess, &Data::SyncthingProcess::finished, &m_syncthingProcess,
43 std::bind(&SyncthingTestInstance::handleFinished, this, _1, _2), Qt::QueuedConnection);
44}
45
46/*!
47 * \brief Starts the Syncthing test instance.

Callers

nothing calls this directly

Calls 2

errorStringMethod · 0.80
pathMethod · 0.80

Tested by

no test coverage detected