From fa2e0b13d03b2f3da577fe501730e1bd48e8acad Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Sat, 30 Jul 2016 17:42:53 +0300 Subject: [PATCH] Check if QProcess::waitForFinished was called after a process was finished. According to documentation QProcess::waitForFinished returns true if the process finished; otherwise returns false (if the operation timed out, if an error occurred, or if this QProcess is already finished). This last case is seems like importnant in this case. --HG-- branch : develop --- src/test/ValentinaTest/abstracttest.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/ValentinaTest/abstracttest.cpp b/src/test/ValentinaTest/abstracttest.cpp index dc60f451e..351c301a1 100644 --- a/src/test/ValentinaTest/abstracttest.cpp +++ b/src/test/ValentinaTest/abstracttest.cpp @@ -97,7 +97,7 @@ bool AbstractTest::Run(bool showWarn, int exit, int &exitCode, const QString &pr process->setWorkingDirectory(info.absoluteDir().absolutePath()); process->start(program, arguments); - if (not process->waitForFinished(msecs)) + if (not process->waitForFinished(msecs) && process->state() != QProcess::NotRunning) { const QString msg = QString("The operation timed out or an error occurred.\n%1").arg(parameters); QWARN(qUtf8Printable(msg));