-
Notifications
You must be signed in to change notification settings - Fork 412
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
Trait tests for generated actions #853
Conversation
Can you point to what exactly requires |
When |
Wouldn't an exec dependency be sufficient? What is it needed for at build time? |
Maybe I'm unclear, but doesn't message (and action) generation happen during the build phase? Edit: Or are you proposing to modify the |
Currently the CMake code calls |
We are referencing action_msgs interfaces when generating code for actions: AFAICT, this is the only place, so maybe it's easy to avoid. |
What happens in the case when you need to generate an action and then immediately use it in the same package? In that case, it seems that |
Yes, if a package does want to do that it needs to declare that extra dependency. |
I tried removing
Maybe we could add a special case for them in the template? I'll try for a little longer to see if it can be done. |
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.
LGTM, just some nitpicks
rclcpp_action/test/test_traits.cpp
Outdated
TEST(TestActionTraits, is_action_impl) { | ||
using Fibonacci = test_msgs::action::Fibonacci; | ||
|
||
// Test traits on some of the internal implementation of actionlib |
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.
nit: actionlib refers to the ROS 1 implementation.
// Test traits on some of the internal implementation of actionlib | |
// Test traits on some of the internal implementation of actions |
rclcpp_action/test/test_traits.cpp
Outdated
using Fibonacci = test_msgs::action::Fibonacci; | ||
|
||
// Test traits on some of the internal implementation of actionlib | ||
ASSERT_TRUE(is_service<Fibonacci::Impl::SendGoalService>()); |
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.
What about adding some ASSERT_FALSE cases for completeness (like in the previous test)?
rclcpp_action/test/test_traits.cpp
Outdated
using Fibonacci = test_msgs::action::Fibonacci; | ||
|
||
// Top level definition is an action | ||
ASSERT_FALSE(is_message<Fibonacci>()); |
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.
nit: using EXPECT_*
instead, we'd see multiple failures instead of just the first to fail.
Signed-off-by: Michael Carroll <michael@openrobotics.org>
Signed-off-by: Michael Carroll <michael@openrobotics.org>
5514243
to
fec1549
Compare
Adds test coverage for the changes in ros2/rosidl#412.
Currently,
action_msgs
are required in order to be able to generate action, so the tests are here to prevent any sort of circular dependency inrosidl_generator_cpp
.