MoveIt Pro Behavior Interface  5.0.1
Library for developing custom behaviors for use in MoveIt Pro
moveit_studio::test_utils::WithBehaviorWithoutContext< BehaviorT > Class Template Reference

Adds testing capabilities of Behaviors without context to any test fixture. More...

#include <test_behavior.hpp>

Public Member Functions

void initBehavior (const std::string &name, PortSetterMapGenerator input_port_setter_generator, PortSetterMapGenerator output_port_setter_generator)
 Initializes the Behavior under test. More...
 
BehaviorT & behavior ()
 
BT::NodeConfiguration & config ()
 
BT::Blackboard & blackboard ()
 

Detailed Description

template<class BehaviorT>
class moveit_studio::test_utils::WithBehaviorWithoutContext< BehaviorT >

Adds testing capabilities of Behaviors without context to any test fixture.

To test a Behavior without context (shared resources), a test fixture inherits from this class in addition to any base test fixture, e.g. ::testing::Test, ::moveit_studio::test_utils::RostTest, etc. The fixture automatically tests that the Behavior creates all and only the expected ports.

Template Parameters
BehaviorTThe class of the Behavior under test.

Member Function Documentation

◆ behavior()

template<class BehaviorT >
BehaviorT& moveit_studio::test_utils::WithBehaviorWithoutContext< BehaviorT >::behavior ( )
inline

◆ blackboard()

template<class BehaviorT >
BT::Blackboard& moveit_studio::test_utils::WithBehaviorWithoutContext< BehaviorT >::blackboard ( )
inline

◆ config()

template<class BehaviorT >
BT::NodeConfiguration& moveit_studio::test_utils::WithBehaviorWithoutContext< BehaviorT >::config ( )
inline

◆ initBehavior()

template<class BehaviorT >
void moveit_studio::test_utils::WithBehaviorWithoutContext< BehaviorT >::initBehavior ( const std::string &  name,
PortSetterMapGenerator  input_port_setter_generator,
PortSetterMapGenerator  output_port_setter_generator 
)

Initializes the Behavior under test.

Call this function in your fixture's constructor, SetUp() or any of its setUp* variations.

Parameters
nameThe name of the Behavior.
input_port_setter_generatorA port setter map generator defining the expected input ports.
output_port_setter_generatorA port setter map generator defining the expected output ports.
Exceptions
WrongBehaviorPortsExceptionif the Behavior does not define exactly the expected ports.

The documentation for this class was generated from the following files: