- Notifications
You must be signed in to change notification settings - Fork 2
Feature: Common Unit Test Library #1
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
Conversation
Disclamer: still have linking errors with undefined references
cmraaron left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd be interested to see dogfooding of these to see how much complexity they removed from any tests where we'd have to do something similar
guilyx left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's something I'm unsure about here, I'll test this later.
SomaGallai left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really cool, could you please a README file just for what is the purpose of the repo and how to properly use it even though it is pretty straight forward.
| Okay, I'm satisfied now with where this is at. We have wrappers for basic subscribers, publishers, action/service client/server and all of them are tested in the package. I have implemented some of this already in |
cmraaron left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for you patience!
Purpose
Tired of rewriting code, would probably make it easier on everyone to have something like this ?
Not sure if I'm going in the right direction but it seems to be a nice start for testing ROS2 packages.
Approach
Basically created 4 helper classes:
They're all minimal and the purpose is just to test whatever we use them for.
Ex:
Open Questions and Pre-Merge TODOs
Dependencies
None
Disclaimers
Learning
Basic****Testobject and spinning it, rclcpp needs some time before calling shutdown - which is why there's an ugly sleep after all spins. (wondering if I should put the sleep in the spin_thread method?)Blog Posts
spin_somein a tight loop and checkrclcpp::ok()instead of usingspin(). It indeed solved the context error/race condition when we spin then shutdown rclcpp straight away.