summaryrefslogtreecommitdiff
path: root/src/plugins/cpptools/cpptoolstestcase.cpp
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@qt.io>2021-05-19 13:22:49 +0200
committerChristian Kandeler <christian.kandeler@qt.io>2021-06-02 10:52:50 +0000
commitff0301635e7af28df61104cc5fa15e9c407f257e (patch)
tree3dc89bfa426033e51036c5ffe801a54bc7d6e70d /src/plugins/cpptools/cpptoolstestcase.cpp
parent003ab51c3d6029827c661a4ee2f5834d7505ad0a (diff)
downloadqt-creator-ff0301635e7af28df61104cc5fa15e9c407f257e.tar.gz
CppEditor: Tweak test infrastructure
... so we can re-use the "follow symbol" test cases with clangd. Call Creator like this (clangd needs to be version 12 or later): $ QTC_CLANGD=<path to clangd> qtcreator -test 'CppEditor,*Follow*,*Switch*' -test 'ClangCodeModel,*dummy*' During testing, some invalid code in the test cases was uncovered and fixed. Change-Id: I9dc650fdba2a27600e6a550420ee873f6fb31d23 Reviewed-by: David Schulz <david.schulz@qt.io>
Diffstat (limited to 'src/plugins/cpptools/cpptoolstestcase.cpp')
-rw-r--r--src/plugins/cpptools/cpptoolstestcase.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/plugins/cpptools/cpptoolstestcase.cpp b/src/plugins/cpptools/cpptoolstestcase.cpp
index 8a714b7df7..c80a4a7cff 100644
--- a/src/plugins/cpptools/cpptoolstestcase.cpp
+++ b/src/plugins/cpptools/cpptoolstestcase.cpp
@@ -44,6 +44,7 @@
#include <cplusplus/CppDocument.h>
#include <utils/executeondestruction.h>
#include <utils/fileutils.h>
+#include <utils/hostosinfo.h>
#include <utils/temporarydirectory.h>
#include <QtTest>
@@ -421,5 +422,15 @@ bool VerifyCleanCppModelManager::isClean(bool testOnlyForCleanedProjects)
#undef RETURN_FALSE_IF_NOT
+int clangdIndexingTimeout()
+{
+ const QByteArray timeoutAsByteArray = qgetenv("QTC_CLANGD_INDEXING_TIMEOUT");
+ bool isConversionOk = false;
+ const int intervalAsInt = timeoutAsByteArray.toInt(&isConversionOk);
+ if (!isConversionOk)
+ return Utils::HostOsInfo::isWindowsHost() ? 20000 : 10000;
+ return intervalAsInt;
+}
+
} // namespace Tests
} // namespace CppTools