📜  c++ unittest in ros - C++ 代码示例

📅  最后修改于: 2022-03-11 14:44:49.945000             🧑  作者: Mango

代码示例1
// Bring in my package's API, which is what I'm testing
#include "foo/foo.h"
// Bring in gtest
#include 

// Declare a test
TEST(TestSuite, testCase1)
{

}

// Declare another test
TEST(TestSuite, testCase2)
{

}

// Run all the tests that were declared with TEST()
int main(int argc, char **argv){
  testing::InitGoogleTest(&argc, argv);
  ros::init(argc, argv, "tester");
  ros::NodeHandle nh;
  return RUN_ALL_TESTS();
}