summaryrefslogtreecommitdiff
path: root/tests/unit
diff options
context:
space:
mode:
authorMarco Bubke <marco.bubke@qt.io>2019-04-04 15:49:23 +0200
committerMarco Bubke <marco.bubke@qt.io>2019-04-23 09:08:15 +0000
commit0fbc16cd7d1aa376b6c7ea1850ebe32187c4a7f1 (patch)
tree1b287114b698f42986843ec92c1158e5a804996f /tests/unit
parent3927ca2ffae58eeea9dc1eecf8fa83a66794cf1e (diff)
downloadqt-creator-0fbc16cd7d1aa376b6c7ea1850ebe32187c4a7f1.tar.gz
ClangPchManager: Fix alive message
Computing the dependencies can take quite some time. So it is better to ensure that the alive timer is fired. Change-Id: I0b372ef73a8a5e6716673ba9457d424151a762bb Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
Diffstat (limited to 'tests/unit')
-rw-r--r--tests/unit/unittest/builddependenciesprovider-test.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/unit/unittest/builddependenciesprovider-test.cpp b/tests/unit/unittest/builddependenciesprovider-test.cpp
index c9794c8cc0..9983e42d8d 100644
--- a/tests/unit/unittest/builddependenciesprovider-test.cpp
+++ b/tests/unit/unittest/builddependenciesprovider-test.cpp
@@ -56,6 +56,14 @@ MATCHER_P(HasSourceId, sourceId, std::string(negation ? "hasn't" : "has")
class BuildDependenciesProvider : public testing::Test
{
protected:
+ BuildDependenciesProvider()
+ {
+ provider.setEnsureAliveMessageIsSentCallback(
+ mockEnsureAliveMessageIsSentCallback.AsStdFunction());
+ }
+
+protected:
+ NiceMock<MockFunction<void()>> mockEnsureAliveMessageIsSentCallback;
NiceMock<MockSqliteTransactionBackend> mockSqliteTransactionBackend;
NiceMock<MockBuildDependenciesStorage> mockBuildDependenciesStorage;
NiceMock<MockSourceEntriesModifiedTimeChecker> mockModifiedTimeChecker;
@@ -209,4 +217,11 @@ TEST_F(BuildDependenciesProvider, FetchUsedMacrosFromStorageIfDependSourcesAreUp
ASSERT_THAT(buildDependency.usedMacros, ElementsAre(UsedMacro{"YI", 1}, UsedMacro{"ER", 2}, UsedMacro{"LIANG", 2}, UsedMacro{"SAN", 10}));
}
+
+TEST_F(BuildDependenciesProvider, CallEnsureAliveMessageIsSentCallback)
+{
+ EXPECT_CALL(mockEnsureAliveMessageIsSentCallback, Call());
+
+ provider.create(projectPart1);
+}
}