Skip to content

Commit

Permalink
[jsk_tools/audible_warning] Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
iory committed May 17, 2022
1 parent 2a2b0b0 commit da312f9
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
2 changes: 2 additions & 0 deletions jsk_tools/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ endforeach(exec)

if (CATKIN_ENABLE_TESTING)
find_package(roslint REQUIRED)
roslint_python(src/audible_warning.py)
roslint_python(src/jsk_tools/cltool.py)
roslint_python(src/test_topic_published.py)
roslint_python(src/test_rosparam_set.py)
Expand All @@ -49,6 +50,7 @@ if (CATKIN_ENABLE_TESTING)
# https://github.com/jsk-ros-pkg/jsk_common/pull/1293#issuecomment-164158260
jsk_tools_add_rostest(test/test_rosparam_set.test)
endif()
jsk_tools_add_rostest(test/test_audible_warning.test)
jsk_tools_add_rostest(test/test_stdout.test)
jsk_tools_add_rostest(test/test_rostopic_host_sanity.test)
jsk_tools_add_rostest(test/test_sanity_diagnostics.test)
Expand Down
4 changes: 3 additions & 1 deletion jsk_tools/sample/sample_audible_warning.launch
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

<arg name="gui" default="true" />
<arg name="device" default="" />
<arg name="launch_sound_play" default="true" />

<node name="pseudo_diagnostics"
pkg="jsk_tools" type="pseudo_diagnostics.py"
Expand All @@ -15,7 +16,8 @@
</node>

<node name="sound_play"
pkg="sound_play" type="soundplay_node.py">
pkg="sound_play" type="soundplay_node.py"
if="$(arg launch_sound_play)" >
<param name="device" value="$(arg device)" />
<param name="loop_rate" value="100" />
</node>
Expand Down
17 changes: 17 additions & 0 deletions jsk_tools/test/test_audible_warning.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<launch>

<include file="$(find jsk_tools)/sample/sample_audible_warning.launch" >
<arg name="device" value="plughw:100,0" /> <!-- pseudo device -->
<arg name="gui" value="false" />
</include>

<test test-name="test_topic_published"
name="test_topic_published"
pkg="jsk_tools" type="test_topic_published.py">
<rosparam>
topic_0: /sound_play/goal
timeout_0: 10
</rosparam>
</test>

</launch>

0 comments on commit da312f9

Please sign in to comment.