Classes | Functions | Variables
gtest_factory.cpp File Reference
#include <gtest/gtest.h>
#include <filesystem>
#include <string>
#include <utility>
#include <vector>
#include "behaviortree_cpp/xml_parsing.h"
#include "../sample_nodes/crossdoor_nodes.h"
#include "../sample_nodes/dummy_nodes.h"
Include dependency graph for gtest_factory.cpp:

Go to the source code of this file.

Classes

class  ActionWithMetadata
 

Functions

std::string FilePath (const std::filesystem::path &relative_path)
 
KeyValueVector makeTestMetadata ()
 
 TEST (BehaviorTreeFactory, addMetadataToManifest)
 
 TEST (BehaviorTreeFactory, CreateTreeFromFile)
 
 TEST (BehaviorTreeFactory, CreateTreeFromFileWhichIncludesFileFromChildDirectory)
 
 TEST (BehaviorTreeFactory, CreateTreeFromFileWhichIncludesFileFromChildDirectoryWhichIncludesFileFromChildDirectory)
 
 TEST (BehaviorTreeFactory, CreateTreeFromFileWhichIncludesFileFromChildDirectoryWhichIncludesFileFromParentDirectory)
 
 TEST (BehaviorTreeFactory, CreateTreeFromFileWhichIncludesFileFromChildDirectoryWhichIncludesFileFromSameDirectory)
 
 TEST (BehaviorTreeFactory, CreateTreeFromFileWhichIncludesFileFromSameDirectory)
 
 TEST (BehaviorTreeFactory, Issue7)
 
 TEST (BehaviorTreeFactory, ManifestMethod)
 
 TEST (BehaviorTreeFactory, NotRegisteredNode)
 
 TEST (BehaviorTreeFactory, Subtree)
 
 TEST (BehaviorTreeFactory, SubTreeWithRemapping)
 
 TEST (BehaviorTreeFactory, WrongTreeName)
 
 TEST (BehaviorTreeFactory, XMLParsingOrder)
 
 TEST (BehaviorTreeReload, ReloadSameTree)
 

Variables

static const char * xml_ports_subtree
 
static const char * xml_text
 
static const char * xml_text_subtree
 
static const char * xml_text_subtree_part1
 
static const char * xml_text_subtree_part2
 

Function Documentation

◆ FilePath()

std::string FilePath ( const std::filesystem::path &  relative_path)

Definition at line 269 of file gtest_factory.cpp.

◆ makeTestMetadata()

KeyValueVector makeTestMetadata ( )

Definition at line 399 of file gtest_factory.cpp.

◆ TEST() [1/15]

TEST ( BehaviorTreeFactory  ,
addMetadataToManifest   
)

Definition at line 451 of file gtest_factory.cpp.

◆ TEST() [2/15]

TEST ( BehaviorTreeFactory  ,
CreateTreeFromFile   
)

Definition at line 287 of file gtest_factory.cpp.

◆ TEST() [3/15]

TEST ( BehaviorTreeFactory  ,
CreateTreeFromFileWhichIncludesFileFromChildDirectory   
)

Definition at line 307 of file gtest_factory.cpp.

◆ TEST() [4/15]

TEST ( BehaviorTreeFactory  ,
CreateTreeFromFileWhichIncludesFileFromChildDirectoryWhichIncludesFileFromChildDirectory   
)

Definition at line 329 of file gtest_factory.cpp.

◆ TEST() [5/15]

TEST ( BehaviorTreeFactory  ,
CreateTreeFromFileWhichIncludesFileFromChildDirectoryWhichIncludesFileFromParentDirectory   
)

Definition at line 341 of file gtest_factory.cpp.

◆ TEST() [6/15]

TEST ( BehaviorTreeFactory  ,
CreateTreeFromFileWhichIncludesFileFromChildDirectoryWhichIncludesFileFromSameDirectory   
)

Definition at line 317 of file gtest_factory.cpp.

◆ TEST() [7/15]

TEST ( BehaviorTreeFactory  ,
CreateTreeFromFileWhichIncludesFileFromSameDirectory   
)

Definition at line 297 of file gtest_factory.cpp.

◆ TEST() [8/15]

TEST ( BehaviorTreeFactory  ,
Issue7   
)

Definition at line 176 of file gtest_factory.cpp.

◆ TEST() [9/15]

TEST ( BehaviorTreeFactory  ,
ManifestMethod   
)

Definition at line 430 of file gtest_factory.cpp.

◆ TEST() [10/15]

TEST ( BehaviorTreeFactory  ,
NotRegisteredNode   
)

Definition at line 107 of file gtest_factory.cpp.

◆ TEST() [11/15]

TEST ( BehaviorTreeFactory  ,
Subtree   
)

Definition at line 145 of file gtest_factory.cpp.

◆ TEST() [12/15]

TEST ( BehaviorTreeFactory  ,
SubTreeWithRemapping   
)

Definition at line 219 of file gtest_factory.cpp.

◆ TEST() [13/15]

TEST ( BehaviorTreeFactory  ,
WrongTreeName   
)

Definition at line 353 of file gtest_factory.cpp.

◆ TEST() [14/15]

TEST ( BehaviorTreeFactory  ,
XMLParsingOrder   
)

Definition at line 114 of file gtest_factory.cpp.

◆ TEST() [15/15]

TEST ( BehaviorTreeReload  ,
ReloadSameTree   
)

Definition at line 368 of file gtest_factory.cpp.

Variable Documentation

◆ xml_ports_subtree

const char* xml_ports_subtree
static
Initial value:
= R"(
<root BTCPP_format="4" main_tree_to_execute="MainTree">
<BehaviorTree ID="TalkToMe">
<Sequence>
<SaySomething message="{hello_msg}" />
<SaySomething message="{bye_msg}" />
<Script code=" output:='done!' " />
</Sequence>
</BehaviorTree>
<BehaviorTree ID="MainTree">
<Sequence>
<Script code = " talk_hello:='hello' " />
<Script code = " talk_bye:='bye bye' " />
<SubTree ID="TalkToMe" hello_msg="{talk_hello}"
bye_msg="{talk_bye}"
output="{talk_out}" />
<SaySomething message="{talk_out}" />
</Sequence>
</BehaviorTree>
</root> )"

Definition at line 192 of file gtest_factory.cpp.

◆ xml_text

const char* xml_text
static

Definition at line 14 of file gtest_factory.cpp.

◆ xml_text_subtree

const char* xml_text_subtree
static
Initial value:
= R"(
<root BTCPP_format="4" main_tree_to_execute="MainTree" >
<BehaviorTree ID="MainTree">
<Sequence>
<Fallback>
<Inverter>
<IsDoorClosed/>
</Inverter>
<SubTree ID="DoorClosedSubtree"/>
</Fallback>
<PassThroughDoor/>
</Sequence>
</BehaviorTree>
<BehaviorTree ID="DoorClosedSubtree">
<Fallback>
<OpenDoor/>
<RetryUntilSuccessful num_attempts="5">
<PickLock/>
</RetryUntilSuccessful>
<SmashDoor/>
</Fallback>
</BehaviorTree>
</root> )"

Definition at line 51 of file gtest_factory.cpp.

◆ xml_text_subtree_part1

const char* xml_text_subtree_part1
static
Initial value:
= R"(
<root BTCPP_format="4">
<BehaviorTree ID="MainTree">
<Fallback name="root_selector">
<SubTree ID="DoorClosedSubtree" />
<Action ID="PassThroughWindow" />
</Fallback>
</BehaviorTree>
</root> )"

Definition at line 79 of file gtest_factory.cpp.

◆ xml_text_subtree_part2

const char* xml_text_subtree_part2
static
Initial value:
= R"(
<root BTCPP_format="4">
<BehaviorTree ID="DoorClosedSubtree">
<Sequence name="door_sequence">
<Decorator ID="Inverter">
<Action ID="IsDoorLocked" />
</Decorator>
<Action ID="OpenDoor" />
<Action ID="PassThroughDoor" />
<Action ID="CloseDoor" />
</Sequence>
</BehaviorTree>
</root> )"

Definition at line 90 of file gtest_factory.cpp.



behaviortree_cpp_v4
Author(s): Davide Faconti
autogenerated on Wed Apr 16 2025 02:20:57