forked from qt-creator/qt-creator
ClangTools: Further increase the test timeout
The clazy tool in particular can be exceedingly slow on Windows. Increase the default timeout and also add a hook to set the timeout at runtime via the environment. Change-Id: I94c46ce03f8348fb239870df4d5627bf8d545307 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -125,7 +125,7 @@ void ClangToolsUnitTests::testProject()
|
|||||||
ClangToolsSettings::instance()->runSettings(),
|
ClangToolsSettings::instance()->runSettings(),
|
||||||
diagnosticConfig);
|
diagnosticConfig);
|
||||||
QSignalSpy waitForFinishedTool(tool, &ClangTool::finished);
|
QSignalSpy waitForFinishedTool(tool, &ClangTool::finished);
|
||||||
QVERIFY(waitForFinishedTool.wait(90000));
|
QVERIFY(waitForFinishedTool.wait(m_timeout));
|
||||||
|
|
||||||
// Check for errors
|
// Check for errors
|
||||||
const QString errorText = waitForFinishedTool.takeFirst().first().toString();
|
const QString errorText = waitForFinishedTool.takeFirst().first().toString();
|
||||||
@@ -186,5 +186,11 @@ void ClangToolsUnitTests::addTestRow(const QByteArray &relativeFilePath,
|
|||||||
<< absoluteFilePath << expectedDiagCount << diagnosticConfig;
|
<< absoluteFilePath << expectedDiagCount << diagnosticConfig;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int ClangToolsUnitTests::getTimeout()
|
||||||
|
{
|
||||||
|
const int t = qEnvironmentVariableIntValue("QTC_CLANGTOOLS_TEST_TIMEOUT");
|
||||||
|
return t > 0 ? t : 480000;
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
} // namespace ClangTools
|
} // namespace ClangTools
|
||||||
|
@@ -56,8 +56,11 @@ private:
|
|||||||
const CppTools::ClangDiagnosticConfig &diagnosticConfig);
|
const CppTools::ClangDiagnosticConfig &diagnosticConfig);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
static int getTimeout();
|
||||||
|
|
||||||
CppTools::Tests::TemporaryCopiedDir *m_tmpDir = nullptr;
|
CppTools::Tests::TemporaryCopiedDir *m_tmpDir = nullptr;
|
||||||
ProjectExplorer::Kit *m_kit = nullptr;
|
ProjectExplorer::Kit *m_kit = nullptr;
|
||||||
|
int m_timeout = getTimeout();
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
Reference in New Issue
Block a user