tst_QSharedPointer: raise the timeout for running qmake and makespec

We had 30s and 60s only, which isn'tenough for the Qt CI.

Task-number: QTBUG-69741
Change-Id: I00e04a465fcf4fc1a462fffd154782999e84ef8b
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
This commit is contained in:
Thiago Macieira 2018-08-03 16:09:54 -07:00
parent b3da7494ba
commit f8dba7ac01

View File

@ -53,6 +53,12 @@
# include <unistd.h> # include <unistd.h>
#endif #endif
enum {
QMakeTimeout = 300000, // 5 minutes
CompileTimeout = 600000, // 10 minutes
RunTimeout = 300000 // 5 minutes
};
static QString makespec() static QString makespec()
{ {
static const char default_makespec[] = DEFAULT_MAKESPEC; static const char default_makespec[] = DEFAULT_MAKESPEC;
@ -143,7 +149,7 @@ namespace QTest {
bool prepareSourceCode(const QByteArray &body); bool prepareSourceCode(const QByteArray &body);
bool createProjectFile(); bool createProjectFile();
bool runQmake(); bool runQmake();
bool runMake(Target target); bool runMake(Target target, int timeout);
bool commonSetup(const QByteArray &body); bool commonSetup(const QByteArray &body);
}; };
@ -602,7 +608,7 @@ namespace QTest {
std_err += "qmake: "; std_err += "qmake: ";
std_err += qmake.errorString().toLocal8Bit(); std_err += qmake.errorString().toLocal8Bit();
} else { } else {
ok = qmake.waitForFinished(); ok = qmake.waitForFinished(QMakeTimeout);
exitCode = qmake.exitCode(); exitCode = qmake.exitCode();
if (!ok) if (!ok)
QTest::ensureStopped(qmake); QTest::ensureStopped(qmake);
@ -617,7 +623,7 @@ namespace QTest {
#endif // QT_CONFIG(process) #endif // QT_CONFIG(process)
} }
bool QExternalTestPrivate::runMake(Target target) bool QExternalTestPrivate::runMake(Target target, int timeout)
{ {
#if !QT_CONFIG(process) #if !QT_CONFIG(process)
return false; return false;
@ -670,7 +676,7 @@ namespace QTest {
} }
make.closeWriteChannel(); make.closeWriteChannel();
bool ok = make.waitForFinished(channelMode == QProcess::ForwardedChannels ? -1 : 60000); bool ok = make.waitForFinished(channelMode == QProcess::ForwardedChannels ? -1 : timeout);
if (!ok) if (!ok)
QTest::ensureStopped(make); QTest::ensureStopped(make);
exitCode = make.exitCode(); exitCode = make.exitCode();
@ -705,7 +711,7 @@ namespace QTest {
failedStage = QExternalTest::CompilationStage; failedStage = QExternalTest::CompilationStage;
std_out += "\n### --- stdout from make (compilation) --- ###\n"; std_out += "\n### --- stdout from make (compilation) --- ###\n";
std_err += "\n### --- stderr from make (compilation) --- ###\n"; std_err += "\n### --- stderr from make (compilation) --- ###\n";
return runMake(Compile); return runMake(Compile, CompileTimeout);
} }
bool QExternalTestPrivate::tryLink(const QByteArray &body) bool QExternalTestPrivate::tryLink(const QByteArray &body)
@ -717,7 +723,7 @@ namespace QTest {
failedStage = QExternalTest::LinkStage; failedStage = QExternalTest::LinkStage;
std_out += "\n### --- stdout from make (linking) --- ###\n"; std_out += "\n### --- stdout from make (linking) --- ###\n";
std_err += "\n### --- stderr from make (linking) --- ###\n"; std_err += "\n### --- stderr from make (linking) --- ###\n";
return runMake(Link); return runMake(Link, CompileTimeout);
} }
bool QExternalTestPrivate::tryRun(const QByteArray &body) bool QExternalTestPrivate::tryRun(const QByteArray &body)
@ -729,7 +735,7 @@ namespace QTest {
failedStage = QExternalTest::RunStage; failedStage = QExternalTest::RunStage;
std_out += "\n### --- stdout from process --- ###\n"; std_out += "\n### --- stdout from process --- ###\n";
std_err += "\n### --- stderr from process --- ###\n"; std_err += "\n### --- stderr from process --- ###\n";
return runMake(Run); return runMake(Run, RunTimeout);
} }
} }
QT_END_NAMESPACE QT_END_NAMESPACE