Skip to content

Commit 93d8dff

Browse files
authored
Fix available targets (#242)
1 parent b51157d commit 93d8dff

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

server/src/utils/GenerationUtils.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -60,15 +60,15 @@ std::optional<fs::path> GenerationUtils::findTarget(const BaseTestGen &baseTestG
6060
LOG_S(INFO) << "Target was not chosen. Using UTBot: Auto target instead.";
6161
return GrpcUtils::UTBOT_AUTO_TARGET_PATH;
6262
}
63-
auto rootTargets = baseTestGen.buildDatabase->getRootTargets();
64-
auto candidates = CollectionUtils::filterOut(rootTargets, [&name](auto const &rootTarget) {
65-
fs::path output = rootTarget->getOutput();
63+
auto allTargets = baseTestGen.buildDatabase->getAllTargets();
64+
auto candidates = CollectionUtils::filterOut(allTargets, [&name](auto const &target) {
65+
fs::path output = target->getOutput();
6666
return !(output == name || output.stem() == name || output.stem() == "lib" + name);
6767
});
6868
if (candidates.empty()) {
6969
LOG_S(WARNING) << "Couldn't find appropriate target. List of available targets:\n";
70-
for (const auto &rootTarget : rootTargets) {
71-
LOG_S(WARNING) << rootTarget->getOutput() << "\n";
70+
for (const auto &target : allTargets) {
71+
LOG_S(WARNING) << target->getOutput() << "\n";
7272
}
7373
LOG_S(WARNING) << "\n";
7474
return std::nullopt;

0 commit comments

Comments
 (0)