Martchus
9ce9b11ba4
* Use a process group / job object via Boost.Process to be able to terminate sub processes as well * Do not try to stop the process gracefully under Windows by posting WM_CLOSE because this has no effect on Syncthing anyways * See https://github.com/Martchus/syncthingtray/issues/94
31 lines
833 B
C++
31 lines
833 B
C++
#include "../syncthingtestinstance.h"
|
|
|
|
#include <c++utilities/tests/testutils.h>
|
|
|
|
#include <iostream>
|
|
|
|
using namespace std;
|
|
using namespace CppUtilities;
|
|
|
|
/*!
|
|
* \brief Launches a Syncthing test instance for manual testing.
|
|
*/
|
|
int main(int argc, char **argv)
|
|
{
|
|
TestApplication testApp(argc, argv);
|
|
if (!testApp) {
|
|
return -1;
|
|
}
|
|
|
|
SyncthingTestInstance testInstance;
|
|
auto &syncthingProcess(testInstance.syncthingProcess());
|
|
//syncthingProcess.setProcessChannelMode(QProcess::ForwardedChannels);
|
|
QObject::connect(&syncthingProcess, static_cast<void (Data::SyncthingProcess::*)(int, QProcess::ExitStatus)>(&Data::SyncthingProcess::finished),
|
|
&QCoreApplication::exit);
|
|
testInstance.start();
|
|
|
|
const int res = testInstance.application().exec();
|
|
testInstance.stop();
|
|
return res;
|
|
}
|