test_env.cpp
Go to the documentation of this file.
1 // Unit tests for env tags
2 // Author: Max Schwarz <max.schwarz@ais.uni-bonn.de>
3 
4 #include <catch_ros/catch.hpp>
5 
6 #include "../../src/launch/launch_config.h"
7 
8 #include "param_utils.h"
9 
10 using namespace rosmon::launch;
11 
12 TEST_CASE("env basic", "[env]")
13 {
14  LaunchConfig config;
15  config.parseString(R"EOF(
16  <launch>
17  <env name="test" value="hello world" />
18 
19  <node name="test_node" pkg="rosmon_core" type="abort" />
20  </launch>
21  )EOF");
22 
23  config.evaluateParameters();
24 
25  auto nodes = config.nodes();
26  CAPTURE(nodes);
27 
28  REQUIRE(nodes.size() == 1);
29 
30  auto node = nodes.at(0);
31 
32  auto env = node->extraEnvironment();
33  CAPTURE(env);
34 
35  CHECK(env.at("test") == "hello world");
36 }
const std::vector< Node::Ptr > & nodes() const
void parseString(const std::string &input, bool onlyArguments=false)
std::string env(const std::string &name)
TEST_CASE("env basic","[env]")
Definition: test_env.cpp:12


rosmon_core
Author(s): Max Schwarz
autogenerated on Wed Jul 10 2019 03:10:12