diff options
author | Nikolai Kosjar <nikolai.kosjar@digia.com> | 2014-08-05 11:34:52 +0200 |
---|---|---|
committer | Nikolai Kosjar <nikolai.kosjar@digia.com> | 2014-08-07 11:04:53 +0200 |
commit | 0f3032f8403de34692edd5c12ed28b2ddfec777f (patch) | |
tree | c788d313386608baf2f0bb0c0a20450e626b5f68 /src/plugins/cpptools/cppsnapshotupdater.cpp | |
parent | 8bf4a5b089a26474099f576e285026b7dcc47a7b (diff) | |
download | qt-creator-0f3032f8403de34692edd5c12ed28b2ddfec777f.tar.gz |
CppTools: Tests: Add "Find Errors Indexing" mode
Adding QTC_FIND_ERRORS_INDEXING=1 to the run environment will Creator
force to do some "extended indexing" in order to find bugs:
1) The project files are parsed as if they would be opened in an
editor. That is, parsing happens as precisely as possible, based on
the ProjectPart information.
2) Symbols are looked up by invoking CheckSymbols, the backend of the
semantic highlighter.
3) A "Task List File" (*.tasks) will be written with all diagnostic
messages.
This special indexing mode is meant for testing purposes. E.g. it can be
run nightly on some bigger projects to find regressions.
Note that Qt Creator will quit exactly after the first time some source
files are indexed. E.g. that will happen if you open a file manually or
if you open a new unconfigured project. Therefore it's required to
configure projects as needed before invoking in this indexing mode.
Change-Id: If25b83e67d24df9e28e107cb062f21cbf3b4c643
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
Diffstat (limited to 'src/plugins/cpptools/cppsnapshotupdater.cpp')
-rw-r--r-- | src/plugins/cpptools/cppsnapshotupdater.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/plugins/cpptools/cppsnapshotupdater.cpp b/src/plugins/cpptools/cppsnapshotupdater.cpp index a6900d3d2c..a534da4d57 100644 --- a/src/plugins/cpptools/cppsnapshotupdater.cpp +++ b/src/plugins/cpptools/cppsnapshotupdater.cpp @@ -42,6 +42,7 @@ SnapshotUpdater::SnapshotUpdater(const QString &fileInEditor) , m_editorDefinesChangedSinceLastUpdate(false) , m_usePrecompiledHeaders(false) , m_forceSnapshotInvalidation(false) + , m_releaseSourceAndAST(true) { } @@ -161,7 +162,8 @@ void SnapshotUpdater::update(CppModelManager::WorkingCopy workingCopy) newRev = qMax(rev + 1, newRev); doc->setRevision(newRev); modelManager->emitDocumentUpdated(doc); - doc->releaseSourceAndAST(); + if (m_releaseSourceAndAST) + doc->releaseSourceAndAST(); }); Snapshot globalSnapshot = modelManager->snapshot(); globalSnapshot.remove(fileInEditor()); @@ -245,6 +247,12 @@ void SnapshotUpdater::setEditorDefines(const QByteArray &editorDefines) } } +void SnapshotUpdater::setReleaseSourceAndAST(bool onoff) +{ + QMutexLocker locker(&m_mutex); + m_releaseSourceAndAST = onoff; +} + void SnapshotUpdater::updateProjectPart() { if (m_manuallySetProjectPart) { |