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:
		| @@ -61,7 +61,7 @@ protected: | ||||
|     RefactoringCompilationDatabase() | ||||
|     { | ||||
|         database.addFile(ClangBackEnd::NativeFilePathView{temporarySourceFilePath}, | ||||
|                          {"cc", toNativePath(temporaryDirectoryPath + "/data.cpp").path(), "-DNO_DEBUG"}); | ||||
|                          {"cc", toNativePath(temporaryDirectoryPath + "/data.cpp"), "-DNO_DEBUG"}); | ||||
|     } | ||||
|  | ||||
| protected: | ||||
| @@ -83,13 +83,13 @@ TEST_F(RefactoringCompilationDatabase, CompileCommandForFilePath) | ||||
|     auto compileCommands = database.getAllCompileCommands(); | ||||
|  | ||||
|     ASSERT_THAT(compileCommands, | ||||
|                 Contains(IsCompileCommand( | ||||
|                     temporaryDirectoryPath, | ||||
|                     toNativePath(temporaryDirectoryPath + "/data.cpp").path(), | ||||
|                     std::vector<std::string>{ | ||||
|                         "cc", | ||||
|                         std::string(toNativePath(temporaryDirectoryPath + "/data.cpp").path()), | ||||
|                         "-DNO_DEBUG"}))); | ||||
|                 Contains(IsCompileCommand(temporaryDirectoryPath, | ||||
|                                           toNativePath(temporaryDirectoryPath + "/data.cpp"), | ||||
|                                           std::vector<std::string>{"cc", | ||||
|                                                                    std::string(toNativePath( | ||||
|                                                                        temporaryDirectoryPath | ||||
|                                                                        + "/data.cpp")), | ||||
|                                                                    "-DNO_DEBUG"}))); | ||||
| } | ||||
|  | ||||
| TEST_F(RefactoringCompilationDatabase, NoCompileCommandForFilePath) | ||||
| @@ -97,13 +97,13 @@ TEST_F(RefactoringCompilationDatabase, NoCompileCommandForFilePath) | ||||
|     auto compileCommands = database.getAllCompileCommands(); | ||||
|  | ||||
|     ASSERT_THAT(compileCommands, | ||||
|                 Not(Contains(IsCompileCommand( | ||||
|                     temporaryDirectoryPath, | ||||
|                     toNativePath(temporaryDirectoryPath + "/data.cpp2").path(), | ||||
|                     std::vector<std::string>{ | ||||
|                         "cc", | ||||
|                         std::string(toNativePath(temporaryDirectoryPath + "/data.cpp").path()), | ||||
|                         "-DNO_DEBUG"})))); | ||||
|                 Not(Contains(IsCompileCommand(temporaryDirectoryPath, | ||||
|                                               toNativePath(temporaryDirectoryPath + "/data.cpp2"), | ||||
|                                               std::vector<std::string>{"cc", | ||||
|                                                                        std::string(toNativePath( | ||||
|                                                                            temporaryDirectoryPath | ||||
|                                                                            + "/data.cpp")), | ||||
|                                                                        "-DNO_DEBUG"})))); | ||||
| } | ||||
|  | ||||
| TEST_F(RefactoringCompilationDatabase, FilePaths) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user