From c5c57dca0ce12fc8fd4d9654b8b3cc602ca21023 Mon Sep 17 00:00:00 2001 From: Nikolai Kosjar Date: Fri, 8 May 2015 12:19:08 +0200 Subject: CppTools: Tests: Allow to check only project relevant state Needed for ClangCodeModel. If editors are open, the global snapshot and working copy will not be empty. Change-Id: I0d1bab8e082a7f41630c7b1b78febe2da009298b Reviewed-by: Marco Bubke --- src/plugins/cpptools/cpptoolstestcase.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/plugins/cpptools/cpptoolstestcase.cpp') diff --git a/src/plugins/cpptools/cpptoolstestcase.cpp b/src/plugins/cpptools/cpptoolstestcase.cpp index 5aebd87428..fa6bed8b51 100644 --- a/src/plugins/cpptools/cpptoolstestcase.cpp +++ b/src/plugins/cpptools/cpptoolstestcase.cpp @@ -363,16 +363,18 @@ VerifyCleanCppModelManager::~VerifyCleanCppModelManager() { #define RETURN_FALSE_IF_NOT(check) if (!(check)) return false; -bool VerifyCleanCppModelManager::isClean() +bool VerifyCleanCppModelManager::isClean(bool testOnlyForCleanedProjects) { CppModelManager *mm = CppModelManager::instance(); RETURN_FALSE_IF_NOT(mm->projectInfos().isEmpty()); RETURN_FALSE_IF_NOT(mm->headerPaths().isEmpty()); RETURN_FALSE_IF_NOT(mm->definedMacros().isEmpty()); RETURN_FALSE_IF_NOT(mm->projectFiles().isEmpty()); - RETURN_FALSE_IF_NOT(mm->snapshot().isEmpty()); - RETURN_FALSE_IF_NOT(mm->workingCopy().size() == 1); - RETURN_FALSE_IF_NOT(mm->workingCopy().contains(mm->configurationFileName())); + if (!testOnlyForCleanedProjects) { + RETURN_FALSE_IF_NOT(mm->snapshot().isEmpty()); + RETURN_FALSE_IF_NOT(mm->workingCopy().size() == 1); + RETURN_FALSE_IF_NOT(mm->workingCopy().contains(mm->configurationFileName())); + } return true; } -- cgit v1.2.1