Skip to content

Cleanup gmock Test Dependencies#460

Draft
bjin2364 wants to merge 2 commits into
ros-controls:masterfrom
bjin2364:cleanup_test_dependencies
Draft

Cleanup gmock Test Dependencies#460
bjin2364 wants to merge 2 commits into
ros-controls:masterfrom
bjin2364:cleanup_test_dependencies

Conversation

@bjin2364
Copy link
Copy Markdown
Contributor

Changes

  • something that's slightly been bothering me are the gmock test deps, when none of the unit tests are using gmock. This PR updates the dependencies so they're gtest

Testing

  • passing unit tests

Notes

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Nov 23, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.33%. Comparing base (69bd9a3) to head (1beb22f).
⚠️ Report is 7 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #460      +/-   ##
==========================================
+ Coverage   85.25%   85.33%   +0.08%     
==========================================
  Files          17       17              
  Lines        1397     1398       +1     
  Branches      132      132              
==========================================
+ Hits         1191     1193       +2     
+ Misses        120      119       -1     
  Partials       86       86              
Flag Coverage Δ
unittests 85.33% <100.00%> (+0.08%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
realtime_tools/test/lock_free_queue_tests.cpp 94.04% <ø> (+0.59%) ⬆️
realtime_tools/test/realtime_buffer_tests.cpp 100.00% <ø> (ø)
realtime_tools/test/realtime_mutex_tests.cpp 100.00% <ø> (ø)
realtime_tools/test/realtime_publisher_tests.cpp 92.85% <ø> (ø)
...e_tools/test/realtime_server_goal_handle_tests.cpp 92.80% <ø> (ø)
...time_tools/test/realtime_thread_safe_box_tests.cpp 98.82% <100.00%> (+0.01%) ⬆️
...ealtime_tools/test/test_async_function_handler.cpp 100.00% <ø> (ø)
realtime_tools/test/thread_priority_tests.cpp 100.00% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@christophfroehlich
Copy link
Copy Markdown
Member

we use gmock per default in all our repositories. I haven't compared it, but the argument of @bmagyar is that the failure messages are more descriptive.

@bjin2364
Copy link
Copy Markdown
Contributor Author

the argument of @bmagyar is that the failure messages are more descriptive.

Interesting... for my own education, what would be an example of this case? My understanding is unless we're making calls to gmock-specific API, then the outcome is exactly the same as if we depended directly on gtest.

@christophfroehlich
Copy link
Copy Markdown
Member

maybe this was only a decision for simplicity to have the same all over the place, and use gmock matchers where they make sense like testing::AllOf

@bjin2364
Copy link
Copy Markdown
Contributor Author

bjin2364 commented Nov 23, 2025

From my experience so far, the issue with defaulting to gmock is:

I think developers can always include gmock later when they need a feature from it, but I can close this PR if this goes against a preferred convention

@bmagyar
Copy link
Copy Markdown
Member

bmagyar commented Dec 18, 2025

Thanks for highlighting the fact that there are features from gtest that are not available when one includes the gmock headers. We've been using gmock across the board in our projects as we tend to rely on matchers.

That being said, I'd also prefer we stay one step closer to the advanced matcher functionality than typed tests, even though some of our testing don't use either of those 🤷

@christophfroehlich christophfroehlich moved this from Needs discussion to WIP in Review triage Jan 7, 2026
@github-actions
Copy link
Copy Markdown
Contributor

This PR is stale because it has been open for 45 days with no activity. Please tag a maintainer for help on completing this PR, or close it if you think it has become obsolete.

@github-actions github-actions Bot added the stale label Feb 17, 2026
@mergify
Copy link
Copy Markdown

mergify Bot commented Feb 17, 2026

This pull request is in conflict. Could you fix it @bjin2364?

@github-actions github-actions Bot removed the stale label Feb 18, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 6, 2026

This PR is stale because it has been open for 45 days with no activity. Please tag a maintainer for help on completing this PR, or close it if you think it has become obsolete.

@github-actions github-actions Bot added the stale label Apr 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: WIP

Development

Successfully merging this pull request may close these issues.

4 participants