18 #ifndef PRBT_HARDWARE_SUPPORT_ROS_TEST_HELPER_H 19 #define PRBT_HARDWARE_SUPPORT_ROS_TEST_HELPER_H 25 #include <gtest/gtest.h> 37 std::vector<std::string> node_names;
39 std::find(node_names.begin(), node_names.end(), node_name) == node_names.end());
47 inline void waitForNode(std::string node_name,
double loop_frequency = 10.0)
50 std::vector<std::string> node_names;
52 std::find(node_names.begin(), node_names.end(), node_name) == node_names.end())
65 inline ::testing::AssertionResult
waitForNodeShutdown(std::string node_name,
double timeout = 1.0,
double loop_frequency = 10.0)
67 std::vector<std::string> node_names;
70 std::find(node_names.begin(), node_names.end(), node_name) != node_names.end())
75 return ::testing::AssertionFailure() <<
"Timed out waiting for shutdown of Node " << node_name;
79 return ::testing::AssertionSuccess();
85 if ( !obj.init(ip, port) )
98 #endif // PRBT_HARDWARE_SUPPORT_ROS_TEST_HELPER_H void waitForNode(std::string node_name, double loop_frequency=10.0)
Blocks until a node defined by node_name comes up.
static void initalizeAndRun(T &obj, const char *ip, unsigned int port)
bool checkForNode(std::string node_name)
Checks if a node is up and running.
#define ROS_INFO_STREAM(args)
ROSCPP_DECL bool getNodes(V_string &nodes)
inline::testing::AssertionResult waitForNodeShutdown(std::string node_name, double timeout=1.0, double loop_frequency=10.0)
Blocks until a node defined by node_name can no longer be found.