diff --git a/tests/gtest_factory.cpp b/tests/gtest_factory.cpp index 321d24e..af97613 100644 --- a/tests/gtest_factory.cpp +++ b/tests/gtest_factory.cpp @@ -268,6 +268,14 @@ TEST(BehaviorTreeFactory, SubTreeWithRemapping) std::string FilePath(const std::filesystem::path& relative_path) { + // NOTE: Bazel doesn't support getting the execpath of a directory, so use a file instead. + // BT_TEST_PARENT_INCLUDE_CHILD_XML_FILE is expected to be the bazel runtime path to: + // tests/trees/parent_include_child.xml + const std::filesystem::path BT_TEST_FOLDER = + std::filesystem::path{ BT_TEST_PARENT_INCLUDE_CHILD_XML_FILE } + .parent_path() + .parent_path(); + // clang-format off static const std::filesystem::path search_paths[] = { BT_TEST_FOLDER,