Skip to content

Commit

Permalink
add "--log-file-name" command line argument for test. (#387)
Browse files Browse the repository at this point in the history
Signed-off-by: Tomoya Fujita <[email protected]>
  • Loading branch information
fujitatomoya authored Jan 8, 2024
1 parent edaf38f commit 82fe7c5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
5 changes: 3 additions & 2 deletions test_launch_ros/test/test_launch_ros/actions/test_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,12 @@ def test_launch_node_with_remappings(self):
assert expanded_remappings[i] == ('chatter', 'new_chatter')

def test_launch_node_with_ros_arguments(self):
node_action = self._create_node(ros_arguments=['--log-level', 'debug'])
node_action = self._create_node(
ros_arguments=['--log-level', 'debug', '--log-file-name', 'filename'])
self._assert_launch_no_errors([node_action])

cmd_string = ' '.join(node_action.process_details['cmd'])
assert '--ros-args --log-level debug' in cmd_string
assert '--ros-args --log-level debug --log-file-name filename' in cmd_string

def test_launch_required_node(self):
# This node will never exit on its own, it'll keep publishing forever.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def test_launch_frontend_xml():
<let name="a_string" value="\'[2, 5, 8]\'"/>
<let name="a_list" value="[2, 5, 8]"/>
<let name="my_value" value="100"/>
<node pkg="demo_nodes_py" exec="talker_qos" output="screen" name="my_talker" namespace="my_ns" exec_name="my_talker_process" args="--number_of_cycles 1" ros_args="--log-level info">
<node pkg="demo_nodes_py" exec="talker_qos" output="screen" name="my_talker" namespace="my_ns" exec_name="my_talker_process" args="--number_of_cycles 1" ros_args="--log-level info --log-file-name filename">
<param name="param1" value="ads"/>
<param name="param_group1">
<param name="param_group2">
Expand Down Expand Up @@ -91,7 +91,7 @@ def test_launch_frontend_yaml():
namespace: my_ns
exec_name: my_talker_process
args: '--number_of_cycles 1'
ros_args: '--log-level info'
ros_args: '--log-level info --log-file-name filename'
param:
- name: param1
value: ads
Expand Down Expand Up @@ -206,7 +206,7 @@ def check_launch_node(file):

talker_node_action = ld.describe_sub_entities()[3]
talker_node_cmd_string = ' '.join(talker_node_action.process_details['cmd'])
assert '--ros-args --log-level info' in talker_node_cmd_string
assert '--ros-args --log-level info --log-file-name filename' in talker_node_cmd_string

listener_node_action = ld.describe_sub_entities()[4]
listener_node_cmd = listener_node_action.process_details['cmd']
Expand Down

0 comments on commit 82fe7c5

Please sign in to comment.