aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/cppeditor/cpptoolstestcase.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/cppeditor/cpptoolstestcase.cpp')
-rw-r--r--src/plugins/cppeditor/cpptoolstestcase.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/plugins/cppeditor/cpptoolstestcase.cpp b/src/plugins/cppeditor/cpptoolstestcase.cpp
index 869bbf9b84..70435abe9f 100644
--- a/src/plugins/cppeditor/cpptoolstestcase.cpp
+++ b/src/plugins/cppeditor/cpptoolstestcase.cpp
@@ -510,4 +510,19 @@ int clangdIndexingTimeout()
return intervalAsInt;
}
+SourceFilesRefreshGuard::SourceFilesRefreshGuard()
+{
+ connect(CppModelManager::instance(), &CppModelManager::sourceFilesRefreshed, this, [this] {
+ m_refreshed = true;
+ });
+}
+
+bool SourceFilesRefreshGuard::wait()
+{
+ for (int i = 0; i < 10 && !m_refreshed; ++i) {
+ CppEditor::Tests::waitForSignalOrTimeout(
+ CppModelManager::instance(), &CppModelManager::sourceFilesRefreshed, 1000);
+ }
+ return m_refreshed;
+}
} // namespace CppEditor::Tests