Set process state to NotRunning after FailedToStart error

Remove the process in process launcher after error has appeared.
Remove unneeded stopStopProcedure as we are disconnecting from
process' signals inside removeProcess().
In order to behave as much similar to what QProcess does,
provide a test that:
- ensures the FailedToStart error is synchronously emitted
  when waitForStarted is being executed
- ensures that process state is reset to NotRunning after
  FailedToStart error
- 2nd call to start/waitForStarted doesn't block on
  waitForStarted

Change-Id: I139354421d037739f1cc1a2685b66f1e5b6170c8
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
Jarek Kobus
2021-08-30 16:29:08 +02:00
parent 73874980ef
commit 15c183fce6
3 changed files with 34 additions and 11 deletions

View File

@@ -213,6 +213,7 @@ bool CallerHandle::shouldFlushFor(SignalType signalType) const
void CallerHandle::handleError(const ErrorSignal *launcherSignal)
{
QTC_ASSERT(isCalledFromCallersThread(), return);
m_processState = QProcess::NotRunning;
m_error = launcherSignal->error();
m_errorString = launcherSignal->errorString();
emit errorOccurred(m_error);