@@ -65,7 +65,7 @@ bool Synchronizer::isProbablyOutdated(const fs::path &srcFilePath) const {
65
65
}
66
66
67
67
CollectionUtils::FileSet Synchronizer::getOutdatedSourcePaths () const {
68
- return CollectionUtils::filterOut (getSourceFiles (), [this ](fs::path const &sourcePath) {
68
+ return CollectionUtils::filterOut (getTargetSourceFiles (), [this ](fs::path const &sourcePath) {
69
69
return !isProbablyOutdated (sourcePath);
70
70
});
71
71
}
@@ -161,6 +161,7 @@ void Synchronizer::synchronizeStubs(StubSet &outdatedStubs,
161
161
162
162
fs::path ccJsonStubDirPath =
163
163
Paths::getUTBotBuildDir (testGen->projectContext ) / " stubs_build_files" ;
164
+ // todo: is it needed?
164
165
auto stubsCdb = createStubsCompilationDatabase (stubFiles, ccJsonStubDirPath);
165
166
166
167
auto sourceToHeaderRewriter =
@@ -197,7 +198,7 @@ Synchronizer::createStubsCompilationDatabase(StubSet &stubFiles,
197
198
198
199
void Synchronizer::synchronizeWrappers (const CollectionUtils::FileSet &outdatedSourcePaths) const {
199
200
auto sourceFilesNeedToRegenerateWrappers = outdatedSourcePaths;
200
- for (fs::path const &sourceFilePath : getSourceFiles ()) {
201
+ for (fs::path const &sourceFilePath : getTargetSourceFiles ()) {
201
202
if (!CollectionUtils::contains (sourceFilesNeedToRegenerateWrappers, sourceFilePath)) {
202
203
auto wrapperFilePath =
203
204
Paths::getWrapperFilePath (testGen->projectContext , sourceFilePath);
@@ -217,10 +218,14 @@ void Synchronizer::synchronizeWrappers(const CollectionUtils::FileSet &outdatedS
217
218
});
218
219
}
219
220
220
- const CollectionUtils::FileSet &Synchronizer::getSourceFiles () const {
221
+ const CollectionUtils::FileSet &Synchronizer::getTargetSourceFiles () const {
221
222
return testGen->getTargetBuildDatabase ()->compilationDatabase ->getAllFiles ();
222
223
}
223
224
225
+ const CollectionUtils::FileSet &Synchronizer::getProjectSourceFiles () const {
226
+ return testGen->getProjectBuildDatabase ()->compilationDatabase ->getAllFiles ();
227
+ }
228
+
224
229
StubSet Synchronizer::getStubsFiles () const {
225
230
return getStubSetFromSources (testGen->getProjectBuildDatabase ()->compilationDatabase ->getAllFiles ());
226
231
}
@@ -233,7 +238,7 @@ void Synchronizer::prepareDirectory(const fs::path &stubDirectory) {
233
238
if (!Paths::isHeaderFile (stubPath)) {
234
239
fs::path sourcePath =
235
240
Paths::stubPathToSourcePath (testGen->projectContext , stubPath);
236
- if (!CollectionUtils::contains (getSourceFiles (), sourcePath)) {
241
+ if (!CollectionUtils::contains (getProjectSourceFiles (), sourcePath)) {
237
242
LOG_S (DEBUG) << " Found extra file in stub directory: " << stubPath
238
243
<< " . Removing it." ;
239
244
fs::remove (stubPath);
0 commit comments