rostest记录总结

本文介绍了rostest的使用,包括catkin_add_gtest和add_rostest_gtest的区别,并详细讲解了如何编写和测试ROS代码。同时,还涵盖了Markdown的基本语法,如改变文本样式、插入链接与图片、创建代码片、列表、表格等,帮助提升文档编写效率。
摘要由CSDN通过智能技术生成


官方链接:http://wiki.ros.org/rostest

1.catkin_add_gtest和add_rostest_gtest区别

if(CATKIN_ENABLE_TESTING)
  if(BUILD_UNIT_TESTS)
    catkin_add_gtest(
      primary_controller_unit_tests
      test/unit_tests.cpp
    )
    if(TARGET primary_controller_unit_tests)
      target_link_libraries(
        primary_controller_unit_tests 
        ${
   catkin_LIBRARIES}
        ${
   PROJECT_NAME}
      )
    endif()
  endif(BUILD_UNIT_TESTS)

  if(BUILD_INTEGRATION_TESTS)
    add_rostest_gtest(
      primary_controller_integration_tests 
      test/integration_tests.test 
      test/integration_tests.cpp
    )
    if(TARGET primary_controller_integration_tests)
      target_link_libraries(
        primary_controller_integration_tests 
        ${
   catkin_LIBRARIES}
        ${
   PROJECT_NAME}
      )
    endif()
  endif(BUILD_INTEGRATION_TESTS)

endif(CATKIN_ENABLE_TESTING)

2.使用add_rostest_gtest

if( CATKIN_ENABLE_TESTING )
  add_rostest_gtest( test_calculator_ test/test_calculator.cpp src/calculator_client.cpp )
  target_link_libraries( test_calculator_ ${
   catkin_LIBRARIES} )
endif()

rostest calculator calculator.test 

个人觉得这是对多个单元进行测试

3.使用catkin_add_gtest

if (CATKIN_ENABLE_TESTING)
  catkin_add_gtest( test_calculator_2 test/test_calculator.cpp)
  target_link_libraries( test_calculator_2 ${
   catkin_LIBRARIES} )
endif()

rosrun calculator test_calculator_2

个人觉得这是对单个文件进行测试
撤销:Ctrl/Command + Z
重做:Ctrl/Command + Y
加粗:Ctrl/Command + B
斜体:Ctrl/Command + I
标题:Ctrl/Command + Shift + H
无序列表:Ctrl/Command + Shift + U
有序列表:Ctrl/Command + Shift + O
检查列表:Ctrl/Command + Shift + C
插入代码:Ctrl/Command + Shift + K
插入链接:Ctrl/Command + Shift + L
插入图片:Ctrl/Command + Shift + G
查找:Ctrl/Command + F
替换:Ctrl/Command + G

直接输入1次#,并按下space后,将生成1级标题。
输入2次#,并按下space后,将生成2级标题。
以此类推,我们支持6级标题。有助于使用TOC语法后生成一个完美的目录。

如何改变文本的样式

强调文本 强调文本

加粗文本 加粗文本

标记文本

删除文本

引用文本

H2O is是液体。

210 运算结果是 1024.

插入链接与图片

链接: link.

图片: Alt

带尺寸的图片: Alt

居中的图片: Alt

居中并且带尺寸的图片: Alt

当然&#

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值