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:
Christian Kandeler
2020-10-13 16:52:04 +02:00
parent 70851d371d
commit e7df6bba18
2 changed files with 10 additions and 1 deletions

View File

@@ -125,7 +125,7 @@ void ClangToolsUnitTests::testProject()
ClangToolsSettings::instance()->runSettings(),
diagnosticConfig);
QSignalSpy waitForFinishedTool(tool, &ClangTool::finished);
QVERIFY(waitForFinishedTool.wait(90000));
QVERIFY(waitForFinishedTool.wait(m_timeout));
// Check for errors
const QString errorText = waitForFinishedTool.takeFirst().first().toString();
@@ -186,5 +186,11 @@ void ClangToolsUnitTests::addTestRow(const QByteArray &relativeFilePath,
<< absoluteFilePath << expectedDiagCount << diagnosticConfig;
}
int ClangToolsUnitTests::getTimeout()
{
const int t = qEnvironmentVariableIntValue("QTC_CLANGTOOLS_TEST_TIMEOUT");
return t > 0 ? t : 480000;
}
} // namespace Internal
} // namespace ClangTools

View File

@@ -56,8 +56,11 @@ private:
const CppTools::ClangDiagnosticConfig &diagnosticConfig);
private:
static int getTimeout();
CppTools::Tests::TemporaryCopiedDir *m_tmpDir = nullptr;
ProjectExplorer::Kit *m_kit = nullptr;
int m_timeout = getTimeout();
};
} // namespace Internal