MCPcopy Create free account
hub / github.com/BehaviorTree/BehaviorTree.CPP / FilePath

Function FilePath

tests/gtest_factory.cpp:279–295  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

277namespace
278{
279std::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
298TEST(BehaviorTreeFactory, CreateTreeFromFile)

Callers 1

TESTFunction · 0.85

Calls 1

stringMethod · 0.45

Tested by

no test coverage detected