aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/unittest/symbolindexer-test.cpp
diff options
context:
space:
mode:
authorMarco Bubke <marco.bubke@qt.io>2019-06-04 15:53:27 +0200
committerMarco Bubke <marco.bubke@qt.io>2019-06-17 10:50:00 +0000
commit300feced2079b291ef107d0015bcf1f88e9e0eaf (patch)
tree394b59a5316c3708c2386b01b30dee01aa61081d /tests/unit/unittest/symbolindexer-test.cpp
parentee27ae2ef78692b29d26c466c519f4318526a7a4 (diff)
ClangRefactoring: Activate updating for indexing
Change-Id: I6fb818edfab8ef7d9cfab0520276acedf0597fd3 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Diffstat (limited to 'tests/unit/unittest/symbolindexer-test.cpp')
-rw-r--r--tests/unit/unittest/symbolindexer-test.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/unit/unittest/symbolindexer-test.cpp b/tests/unit/unittest/symbolindexer-test.cpp
index a03f2be5079..2db11dc5fbe 100644
--- a/tests/unit/unittest/symbolindexer-test.cpp
+++ b/tests/unit/unittest/symbolindexer-test.cpp
@@ -922,6 +922,21 @@ TEST_F(SymbolIndexer, DependentSourceAreUpToDate)
indexer.updateProjectParts({projectPart1});
}
+TEST_F(SymbolIndexer, SourcesAreWatched)
+{
+ using ClangBackEnd::IdPaths;
+ InSequence s;
+ FilePathIds sourcePathIds{4, 6, 8};
+
+ EXPECT_CALL(mockBuildDependenciesStorage, fetchSources(projectPart1.projectPartId))
+ .WillOnce(Return(sourcePathIds));
+ EXPECT_CALL(mockPathWatcher,
+ updateIdPaths(ElementsAre(AllOf(Field(&IdPaths::id, projectPart1.projectPartId),
+ Field(&IdPaths::filePathIds, sourcePathIds)))));
+
+ indexer.updateProjectParts({projectPart1});
+}
+
TEST_F(SymbolIndexer, CallSetNotifier)
{
EXPECT_CALL(mockPathWatcher, setNotifier(_));