test
xml
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
}
TEST_CASE
TEST_CASE("env basic", "[env]")
Definition:
test_env.cpp:12
rosmon::launch::LaunchConfig::parseString
void parseString(const std::string &input, bool onlyArguments=false)
Definition:
launch_config.cpp:249
param_utils.h
rosmon::launch::LaunchConfig::nodes
const std::vector< Node::Ptr > & nodes() const
Definition:
launch_config.h:215
rosmon::launch::LaunchConfig
Definition:
launch_config.h:175
rosmon::launch::substitutions::env
std::string env(const std::string &name)
Definition:
substitution.cpp:67
rosmon::launch
Definition:
bytes_parser.cpp:15
rosmon::launch::LaunchConfig::evaluateParameters
void evaluateParameters()
Definition:
launch_config.cpp:1185
rosmon_core
Author(s): Max Schwarz
autogenerated on Wed Feb 21 2024 04:01:14