@@ -65,7 +65,7 @@ bool Synchronizer::isProbablyOutdated(const fs::path &srcFilePath) const {
6565}
6666
6767CollectionUtils::FileSet Synchronizer::getOutdatedSourcePaths () const {
68- return CollectionUtils::filterOut (getSourceFiles (), [this ](fs::path const &sourcePath) {
68+ return CollectionUtils::filterOut (getTargetSourceFiles (), [this ](fs::path const &sourcePath) {
6969 return !isProbablyOutdated (sourcePath);
7070 });
7171}
@@ -161,6 +161,7 @@ void Synchronizer::synchronizeStubs(StubSet &outdatedStubs,
161161
162162 fs::path ccJsonStubDirPath =
163163 Paths::getUTBotBuildDir (testGen->projectContext ) / " stubs_build_files" ;
164+ // todo: is it needed?
164165 auto stubsCdb = createStubsCompilationDatabase (stubFiles, ccJsonStubDirPath);
165166
166167 auto sourceToHeaderRewriter =
@@ -197,7 +198,7 @@ Synchronizer::createStubsCompilationDatabase(StubSet &stubFiles,
197198
198199void Synchronizer::synchronizeWrappers (const CollectionUtils::FileSet &outdatedSourcePaths) const {
199200 auto sourceFilesNeedToRegenerateWrappers = outdatedSourcePaths;
200- for (fs::path const &sourceFilePath : getSourceFiles ()) {
201+ for (fs::path const &sourceFilePath : getTargetSourceFiles ()) {
201202 if (!CollectionUtils::contains (sourceFilesNeedToRegenerateWrappers, sourceFilePath)) {
202203 auto wrapperFilePath =
203204 Paths::getWrapperFilePath (testGen->projectContext , sourceFilePath);
@@ -217,10 +218,14 @@ void Synchronizer::synchronizeWrappers(const CollectionUtils::FileSet &outdatedS
217218 });
218219}
219220
220- const CollectionUtils::FileSet &Synchronizer::getSourceFiles () const {
221+ const CollectionUtils::FileSet &Synchronizer::getTargetSourceFiles () const {
221222 return testGen->getTargetBuildDatabase ()->compilationDatabase ->getAllFiles ();
222223}
223224
225+ const CollectionUtils::FileSet &Synchronizer::getProjectSourceFiles () const {
226+ return testGen->getProjectBuildDatabase ()->compilationDatabase ->getAllFiles ();
227+ }
228+
224229StubSet Synchronizer::getStubsFiles () const {
225230 return getStubSetFromSources (testGen->getProjectBuildDatabase ()->compilationDatabase ->getAllFiles ());
226231}
@@ -233,7 +238,7 @@ void Synchronizer::prepareDirectory(const fs::path &stubDirectory) {
233238 if (!Paths::isHeaderFile (stubPath)) {
234239 fs::path sourcePath =
235240 Paths::stubPathToSourcePath (testGen->projectContext , stubPath);
236- if (!CollectionUtils::contains (getSourceFiles (), sourcePath)) {
241+ if (!CollectionUtils::contains (getProjectSourceFiles (), sourcePath)) {
237242 LOG_S (DEBUG) << " Found extra file in stub directory: " << stubPath
238243 << " . Removing it." ;
239244 fs::remove (stubPath);
0 commit comments