syncthingtray/testhelper/tests/manualtesting.cpp

30 lines
795 B
C++
Raw Normal View History

#include "../syncthingtestinstance.h"
#include <c++utilities/tests/testutils.h>
#include <iostream>
using namespace std;
2019-06-10 22:48:26 +02:00
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());
2019-07-07 12:14:23 +02:00
syncthingProcess.setProcessChannelMode(QProcess::ForwardedChannels);
QObject::connect(&syncthingProcess, static_cast<void (QProcess::*)(int, QProcess::ExitStatus)>(&QProcess::finished), &QCoreApplication::exit);
testInstance.start();
const int res = testInstance.application().exec();
testInstance.stop();
return res;
}