Clang: Add lastModified to the precompiled header

It is important to know then the PCH generation started, so we can compare
the header file time stamps against it.

Change-Id: Id8ee91e886c153d9d4a37cc0438c682f2098f7fa
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
This commit is contained in:
Marco Bubke
2018-02-15 14:29:20 +01:00
parent f67df4f9ab
commit 1f0562742e
13 changed files with 48 additions and 44 deletions

View File

@@ -592,8 +592,8 @@ std::ostream &operator<<(std::ostream &os, const ProjectPartContainer &container
std::ostream &operator<<(std::ostream &out, const ProjectPartPch &projectPartPch)
{
out << "("
<< projectPartPch.id() << ", "
<< projectPartPch.path() << ")";
<< projectPartPch.projectPartId << ", "
<< projectPartPch.pchPath << ")";
return out;
}

View File

@@ -36,8 +36,8 @@ public:
: ClangPchManager::PchManagerNotifierInterface(pchManagerClient)
{}
MOCK_METHOD2(precompiledHeaderUpdated,
void (const QString &projectPartId, const QString &pchFilePath));
MOCK_METHOD3(precompiledHeaderUpdated,
void (const QString &projectPartId, const QString &pchFilePath, long long lastModified));
MOCK_METHOD1(precompiledHeaderRemoved,
void (const QString &projectPartId));
};

View File

@@ -312,10 +312,10 @@ TEST_F(PchCreatorVerySlowTest, ProjectPartPchsForCreatePchsForProjectParts)
{
EXPECT_CALL(mockPchGeneratorNotifier,
taskFinished(ClangBackEnd::TaskFinishStatus::Successfully,
Property(&ProjectPartPch::id, "project1")));
Field(&ProjectPartPch::projectPartId, "project1")));
EXPECT_CALL(mockPchGeneratorNotifier,
taskFinished(ClangBackEnd::TaskFinishStatus::Successfully,
Property(&ProjectPartPch::id, "project2")));
Field(&ProjectPartPch::projectPartId, "project2")));
creator.generatePchs();
}

View File

@@ -61,7 +61,7 @@ protected:
NiceMock<MockPchGeneratorNotifier> mockNotifier;
ClangBackEnd::PchGenerator<FakeProcess> generator{environment, &mockNotifier};
Utils::SmallStringVector compilerArguments = {"-DXXXX", "-Ifoo"};
ClangBackEnd::ProjectPartPch projectPartPch{"projectPartId", "/path/to/pch"};
ClangBackEnd::ProjectPartPch projectPartPch{"projectPartId", "/path/to/pch", 1};
};
TEST_F(PchGenerator, ProcessFinished)

View File

@@ -57,7 +57,7 @@ protected:
ClangPchManager::PchManagerProjectUpdater projectUpdater{mockPchManagerServer, client, filePathCache};
Utils::SmallString projectPartId{"projectPartId"};
Utils::SmallString pchFilePath{"/path/to/pch"};
PrecompiledHeadersUpdatedMessage message{{{projectPartId.clone(), pchFilePath.clone()}}};
PrecompiledHeadersUpdatedMessage message{{{projectPartId.clone(), pchFilePath.clone(), 1}}};
};
TEST_F(PchManagerClient, NotifierAttached)
@@ -81,7 +81,7 @@ TEST_F(PchManagerClient, NotifierDetached)
TEST_F(PchManagerClient, Update)
{
EXPECT_CALL(mockPchManagerNotifier, precompiledHeaderUpdated(projectPartId.toQString(), pchFilePath.toQString()));
EXPECT_CALL(mockPchManagerNotifier, precompiledHeaderUpdated(projectPartId.toQString(), pchFilePath.toQString(), Eq(1)));
client.precompiledHeadersUpdated(message.clone());
}

View File

@@ -119,7 +119,7 @@ TEST_F(PchManagerClientServerInProcess, SendRemovePchProjectPartsMessage)
TEST_F(PchManagerClientServerInProcess, SendPrecompiledHeaderUpdatedMessage)
{
PrecompiledHeadersUpdatedMessage message{{{"projectPartId", "/path/to/pch"}}};
PrecompiledHeadersUpdatedMessage message{{{"projectPartId", "/path/to/pch", 1}}};
EXPECT_CALL(mockPchManagerClient, precompiledHeadersUpdated(message));

View File

@@ -84,8 +84,8 @@ protected:
FileContainer generatedFile{{"/path/to/", "file"}, "content", {}};
ClangBackEnd::UpdatePchProjectPartsMessage updatePchProjectPartsMessage{Utils::clone(projectParts),
{generatedFile}};
ClangBackEnd::ProjectPartPch projectPartPch1{projectPart1.projectPartId().clone(), "/path1/to/pch"};
ClangBackEnd::ProjectPartPch projectPartPch2{projectPart2.projectPartId().clone(), "/path2/to/pch"};
ClangBackEnd::ProjectPartPch projectPartPch1{projectPart1.projectPartId().clone(), "/path1/to/pch", 1};
ClangBackEnd::ProjectPartPch projectPartPch2{projectPart2.projectPartId().clone(), "/path2/to/pch", 1};
std::vector<ClangBackEnd::ProjectPartPch> projectPartPchs{projectPartPch1, projectPartPch2};
ClangBackEnd::PrecompiledHeadersUpdatedMessage precompiledHeaderUpdatedMessage1{{projectPartPch1}};
ClangBackEnd::PrecompiledHeadersUpdatedMessage precompiledHeaderUpdatedMessage2{{projectPartPch2}};