| 27 | static char *dummy2; |
| 28 | |
| 29 | SyncthingTestInstance::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. |
nothing calls this directly
no test coverage detected