forked from qt-creator/qt-creator
Process: Refactor timeout handling
Rename ProcessResult::Hang into Canceled. Change the behavior of the Process: Whenever the terminate() or kill() is called, including indirect calls through stop() or runBlocking()'s timeout, mark the process result as Canceled. In this way the Process running by a call to start() may also finish with Canceled state. Before it was only happening for processes started via runBlocking(). Adapt the runBlockingStdOut_data() test accordingly. Get rid of ProcessInterface::m_canceledByUser field. Use ProcessResult::Canceled state instead. Fix existing 3 usages of m_canceledByUser field. Use standarized exitMessage() method for them. Add automatic measurement of process execution. Introduce processDuration() getter. Use it for reporting exitMessage() instead of timeoutS(). Change-Id: I1a68559ce844caef863a97a6b0577b0238011f70 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
@@ -184,6 +184,7 @@ public:
|
||||
static QString exitMessage(const CommandLine &command, ProcessResult result, int exitCode,
|
||||
int timeoutInSeconds);
|
||||
QString exitMessage() const;
|
||||
std::chrono::milliseconds processDuration() const;
|
||||
|
||||
QString toStandaloneCommandLine() const;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user