forked from qt-creator/qt-creator
Clang: Improve project part updating
The project part ids are now already created very early in the database. This removes some checks because we can assume that an id already exists. The project part are now completely persistent, so we can read them from the database and compare them with new generated from a new creator session. This should help to not recreate the same PCH again and again. Task-number: QTCREATORBUG-21151 Change-Id: Iced818ff9f7431eaed3e37978087cc0a43b9afda Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
This commit is contained in:
@@ -180,19 +180,20 @@ TEST_F(RefactoringClientServerInProcess, RequestSourceRangesForQueryMessage)
|
||||
|
||||
TEST_F(RefactoringClientServerInProcess, SendUpdateProjectPartsMessage)
|
||||
{
|
||||
ProjectPartContainer projectPart2{"projectPartId",
|
||||
{"-x", "c++-header", "-Wno-pragma-once-outside-header"},
|
||||
{{"DEFINE", "1", 1}},
|
||||
{IncludeSearchPath{"/system/path", 2, IncludeSearchPathType::System},
|
||||
IncludeSearchPath{"/builtin/path", 3, IncludeSearchPathType::BuiltIn},
|
||||
IncludeSearchPath{"/framework/path", 1, IncludeSearchPathType::System}},
|
||||
{IncludeSearchPath{"/to/path1", 1, IncludeSearchPathType::User},
|
||||
IncludeSearchPath{"/to/path2", 2, IncludeSearchPathType::User}},
|
||||
{{1, 1}},
|
||||
{{1, 2}},
|
||||
Utils::Language::C,
|
||||
Utils::LanguageVersion::C11,
|
||||
Utils::LanguageExtension::All};
|
||||
ProjectPartContainer projectPart2{
|
||||
1,
|
||||
{"-x", "c++-header", "-Wno-pragma-once-outside-header"},
|
||||
{{"DEFINE", "1", 1}},
|
||||
{IncludeSearchPath{"/system/path", 2, IncludeSearchPathType::System},
|
||||
IncludeSearchPath{"/builtin/path", 3, IncludeSearchPathType::BuiltIn},
|
||||
IncludeSearchPath{"/framework/path", 1, IncludeSearchPathType::System}},
|
||||
{IncludeSearchPath{"/to/path1", 1, IncludeSearchPathType::User},
|
||||
IncludeSearchPath{"/to/path2", 2, IncludeSearchPathType::User}},
|
||||
{{1, 1}},
|
||||
{{1, 2}},
|
||||
Utils::Language::C,
|
||||
Utils::LanguageVersion::C11,
|
||||
Utils::LanguageExtension::All};
|
||||
UpdateProjectPartsMessage message{{projectPart2}, {"toolChainArgument"}};
|
||||
|
||||
EXPECT_CALL(mockRefactoringServer, updateProjectParts(message));
|
||||
@@ -214,7 +215,7 @@ TEST_F(RefactoringClientServerInProcess, SendUpdateGeneratedFilesMessage)
|
||||
|
||||
TEST_F(RefactoringClientServerInProcess, SendRemoveProjectPartsMessage)
|
||||
{
|
||||
RemoveProjectPartsMessage message{{"projectPartId1", "projectPartId2"}};
|
||||
RemoveProjectPartsMessage message{{1, 2}};
|
||||
|
||||
EXPECT_CALL(mockRefactoringServer, removeProjectParts(message));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user