Skip to content

Commit

Permalink
enable unit tests when CATKIN_ENABLE_TESTING is set (fixes ros-driver…
Browse files Browse the repository at this point in the history
  • Loading branch information
jack-oquin authored and vrabaud committed May 9, 2016
1 parent 62a4b45 commit 7e1334b
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 46 deletions.
2 changes: 2 additions & 0 deletions velodyne/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Change history
* Fix errors with Mac OSX compiler (`#8`_).
* Install `pluginlib` XML files (`#9`_).
* Install some launch and parameter files.
* Enable unit tests when `CATKIN_ENABLE_TESTING` is set (`#10`_).

1.0.1 (2013-06-15)
------------------
Expand Down Expand Up @@ -72,3 +73,4 @@ Change history
.. _`#7`: https://github.com/ros-drivers/velodyne/issues/7
.. _`#8`: https://github.com/ros-drivers/velodyne/pull/8
.. _`#9`: https://github.com/ros-drivers/velodyne/issues/9
.. _`#10`: https://github.com/ros-drivers/velodyne/issues/10
50 changes: 29 additions & 21 deletions velodyne_driver/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,24 +35,32 @@ install(FILES nodelet_velodyne.xml
install(DIRECTORY launch/
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/launch)

# Download packet capture (PCAP) files containing test data.
# Store them in devel-space, so rostest can easily find them.
catkin_download_test_data(
${PROJECT_NAME}_tests_class.pcap
http://pr.willowgarage.com/data/velodyne/class.pcap
DESTINATION ${CATKIN_DEVEL_PREFIX}/${CATKIN_PACKAGE_SHARE_DESTINATION}/tests
MD5 65808d25772101358a3719b451b3d015)
catkin_download_test_data(
${PROJECT_NAME}_tests_32e.pcap
http://pr.willowgarage.com/data/velodyne/32e.pcap
DESTINATION ${CATKIN_DEVEL_PREFIX}/${CATKIN_PACKAGE_SHARE_DESTINATION}/tests
MD5 e41d02aac34f0967c03a5597e1d554a9)

# unit tests
add_rostest(tests/pcap_node_hertz.test)
add_rostest(tests/pcap_nodelet_hertz.test)
add_rostest(tests/pcap_32e_node_hertz.test)
add_rostest(tests/pcap_32e_nodelet_hertz.test)

# parse check all the launch/*.launch files
##roslaunch_add_file_check(launch)

if (CATKIN_ENABLE_TESTING)
message("${PROJECT_NAME} unit testing enabled")

# Download packet capture (PCAP) files containing test data.
# Store them in devel-space, so rostest can easily find them.
catkin_download_test_data(
${PROJECT_NAME}_tests_class.pcap
http://pr.willowgarage.com/data/velodyne/class.pcap
DESTINATION ${CATKIN_DEVEL_PREFIX}/${CATKIN_PACKAGE_SHARE_DESTINATION}/tests
MD5 65808d25772101358a3719b451b3d015)
catkin_download_test_data(
${PROJECT_NAME}_tests_32e.pcap
http://pr.willowgarage.com/data/velodyne/32e.pcap
DESTINATION ${CATKIN_DEVEL_PREFIX}/${CATKIN_PACKAGE_SHARE_DESTINATION}/tests
MD5 e41d02aac34f0967c03a5597e1d554a9)

# unit tests
add_rostest(tests/pcap_node_hertz.test)
add_rostest(tests/pcap_nodelet_hertz.test)
add_rostest(tests/pcap_32e_node_hertz.test)
add_rostest(tests/pcap_32e_nodelet_hertz.test)

# parse check all the launch/*.launch files
##roslaunch_add_file_check(launch)

else ()
message("${PROJECT_NAME} unit testing disabled")
endif (CATKIN_ENABLE_TESTING)
57 changes: 32 additions & 25 deletions velodyne_pointcloud/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ catkin_package(
add_subdirectory(src/lib)
add_subdirectory(src/conversions)

install(DIRECTORY include/${PROJECT_NAME}/
Install(DIRECTORY include/${PROJECT_NAME}/
DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION})
install(FILES nodelets.xml
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION})
Expand All @@ -48,29 +48,36 @@ install(DIRECTORY launch/
install(DIRECTORY params/
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/params)

# Download packet capture (PCAP) files containing test data.
# Store them in devel-space, so rostest can easily find them.
catkin_download_test_data(
${PROJECT_NAME}_tests_class.pcap
http://pr.willowgarage.com/data/velodyne/class.pcap
DESTINATION ${CATKIN_DEVEL_PREFIX}/${CATKIN_PACKAGE_SHARE_DESTINATION}/tests
MD5 65808d25772101358a3719b451b3d015)
catkin_download_test_data(
${PROJECT_NAME}_tests_32e.pcap
http://pr.willowgarage.com/data/velodyne/32e.pcap
DESTINATION ${CATKIN_DEVEL_PREFIX}/${CATKIN_PACKAGE_SHARE_DESTINATION}/tests
MD5 e41d02aac34f0967c03a5597e1d554a9)
if (CATKIN_ENABLE_TESTING)
message("${PROJECT_NAME} unit testing enabled")

# unit tests
add_rostest(tests/cloud_node_hz.test)
add_rostest(tests/cloud_nodelet_hz.test)
add_rostest(tests/cloud_node_32e_hz.test)
add_rostest(tests/cloud_nodelet_32e_hz.test)
# Download packet capture (PCAP) files containing test data.
# Store them in devel-space, so rostest can easily find them.
catkin_download_test_data(
${PROJECT_NAME}_tests_class.pcap
http://pr.willowgarage.com/data/velodyne/class.pcap
DESTINATION ${CATKIN_DEVEL_PREFIX}/${CATKIN_PACKAGE_SHARE_DESTINATION}/tests
MD5 65808d25772101358a3719b451b3d015)
catkin_download_test_data(
${PROJECT_NAME}_tests_32e.pcap
http://pr.willowgarage.com/data/velodyne/32e.pcap
DESTINATION ${CATKIN_DEVEL_PREFIX}/${CATKIN_PACKAGE_SHARE_DESTINATION}/tests
MD5 e41d02aac34f0967c03a5597e1d554a9)

# unit tests
add_rostest(tests/cloud_node_hz.test)
add_rostest(tests/cloud_nodelet_hz.test)
add_rostest(tests/cloud_node_32e_hz.test)
add_rostest(tests/cloud_nodelet_32e_hz.test)

## These tests don't work well enough to be worth the effort of
## running them:
#add_rostest(tests/transform_node_hz.test)
#add_rostest(tests/transform_nodelet_hz.test)

# parse check all the launch/*.launch files
##roslaunch_add_file_check(launch)

## These tests don't work well enough to be worth the effort of
## running them:
#add_rostest(tests/transform_node_hz.test)
#add_rostest(tests/transform_nodelet_hz.test)

# parse check all the launch/*.launch files
##roslaunch_add_file_check(launch)
else ()
message("${PROJECT_NAME} unit testing disabled")
endif (CATKIN_ENABLE_TESTING)

0 comments on commit 7e1334b

Please sign in to comment.