ROS2 gmock for external libraries
Hi all,
I am trying to implement unit testing in my ROS2 project. I used to work with python and ROS1, where I had experience with pytest and nose. Now I am using ROS2-foxy, C++ and I've chosen gtest, since it seemed to me the best option (not sure though). Now, I am trying to test a function that has calls to rclcpp Node, since its class inherits from it. I am able to gtest it, but when I bring in gmock, I get tons of linking problems with gtest. Navigating arround, it seems that these linking problems come because gmock brings its own gtest implementation, which may conflict with previous one. However, due to the dependencies of ros-foxy-gtest and ros-foxy-gmock packages with the rest of the ros-foxy packages, I can not remove one of them or even both and execute my own version. I am trying to use known ros2 packages as examples (like rclcpp or even nav2) but I am not able to unlock how they use gmock or how they actually mock these functionalities. Any place where I can find easy examples? Tutorials? any clue? Many thanks