| 277 | namespace |
| 278 | { |
| 279 | std::string FilePath(const std::filesystem::path& relative_path) |
| 280 | { |
| 281 | // clang-format off |
| 282 | static const std::filesystem::path search_paths[] = { |
| 283 | BT_TEST_FOLDER, |
| 284 | std::filesystem::current_path() / "tests"}; |
| 285 | // clang-format on |
| 286 | |
| 287 | for(auto const& path : search_paths) |
| 288 | { |
| 289 | if(std::filesystem::exists(path / relative_path)) |
| 290 | { |
| 291 | return (path / relative_path).string(); |
| 292 | } |
| 293 | } |
| 294 | return {}; |
| 295 | } |
| 296 | } // namespace |
| 297 | |
| 298 | TEST(BehaviorTreeFactory, CreateTreeFromFile) |