Not able to run Gtest after following ROS2 setup tutorial

Answered

Hi everyone,

I have set up CLion to work with my ROS2 development workflow following the setup tutorial:

https://www.jetbrains.com/help/clion/ros2-tutorial.html#create-custom-targets

However, I am getting a problem when I try to run my GTest suite with CLion configured this way:

Error running '<test_name>': Cannot run '<test_name>' on '<default>'.

It seems that there is no target to run the tests on.

If I open one of the repository's CMakeLists.txt as a new project, it correctly identifies it as CMake project and I am able to run the tests just fine. However, this disrupts my ROS2 workflow and does not let me work with the whole workspace.

Is there some core incompatibility which prevents me from opening a workspace as a JSON Compilation Database and running GTests in the same project?

Thanks!

 

Versions:

Ubuntu 20.04.4

CLion 2022.3.1

Runtime version: 17.0.5+1-b653.23 amd64

0
1 comment

Hello!

Yes, unfortunately, for now Unit Test run/debug configurations are not supported for custom build targets - https://youtrack.jetbrains.com/issue/CPP-15158. Feel free to comment or upvote the issue in order to get updates. See https://intellij-support.jetbrains.com/hc/en-us/articles/207241135-How-to-follow-YouTrack-issues-and-receive-notifications if you are not familiar with YouTrack.

0

Please sign in to leave a comment.