Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: 👷 add gtests to ctest #328

Closed
wants to merge 1 commit into from
Closed

Conversation

jaron-l
Copy link
Member

@jaron-l jaron-l commented Apr 11, 2022

Adds support for ctest by adding gtest_discover_tests to all of the CMakeLists.txt files. This allows one to use colcon test --ctest-args .... I have been using this a lot to filter tests so I thought I'd share it case others want to use it.

@jaron-l
Copy link
Member Author

jaron-l commented Apr 19, 2022

As an FYI, I discovered that this results in a slowdown of running the tests. Probably not a big deal when run tests once, but if using with an colcon retest flags or looping manually, you'll notice. I created an issue at colcon/colcon-cmake#120.

@bmagyar
Copy link
Member

bmagyar commented Apr 27, 2022

I'm a little reluctant about adding this change. I think the majority of users won't use ctest to filter their tests, but rather call the test binary directly.

At the same time I'm worried about the extra amount of code in the cmake + the explicit gtest imports... I suggest we close this PR instead of merging

@jaron-l
Copy link
Member Author

jaron-l commented Apr 27, 2022

I'm a little reluctant about adding this change. I think the majority of users won't use ctest to filter their tests, but rather call the test binary directly.

At the same time I'm worried about the extra amount of code in the cmake + the explicit gtest imports... I suggest we close this PR instead of merging

That's fine. I just thought I'd offer it as I used it a lot in debugging #263. It's really mostly useful if you want the tests to show up independently with colcon test.

@bmagyar bmagyar closed this May 3, 2022
@jaron-l jaron-l deleted the ctest branch August 15, 2022 19:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants