-
Notifications
You must be signed in to change notification settings - Fork 119
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
Confusion over WORKING_DIRECTORY #406
Comments
Yes, very good call.
I think our current practice is to just specify it for every test. I don't know that we have a way to set it once. See https://github.com/ros2/rcl/blob/rolling/rcl_yaml_param_parser/CMakeLists.txt , for example.
docs.ros.org is the right place. If you would open a pull request to fix up https://github.com/ros2/ros2_documentation/blob/rolling/source/How-To-Guides/Ament-CMake-Documentation.rst , I'd be happy to review it. |
Thank you very much @clalancette for the fast response! I'll open a ticket in the documentation repo and get a PR up within the next couple of days. The example you provided is now making me wonder if we should revert #206? I understand it's nice to follow cmake behaviour, but if the majority of the ROS community is running tests with data/files, maybe |
I will say that at least in the core, we only need to set Given all of that, my preference would be to leave things as-is and fix up the documentation. [1] I calculated this number by pulling all of the sources of packages released into Rolling, counting the number of |
Thanks @clalancette, I agree, probably best to leave it as-is for now. Thanks for your thoughts! I'll close this out and try to update the documentation soon. |
Hi There, I recently spent a lot of time trying to understand why some of my unit tests that worked fine in ROS2 Dashing were failing in ROS2 Foxy. I hope the below helps other people who may come across the same issue.
According to Dashing, Foxy, and Humble documentation, the following is stated about the default
WORKING_DIRECTORY
for theament_add_gtest()
macro.However, this only seems to be true for Dashing (maybe the intermediate releases too, I didn't use them). PR #206 changed the default behaviour from
CMAKE_SOURCE_DIR
toCMAKE_CURRENT_BINARY_DIR
.This leaves me with a few questions:
CMAKE_CURRENT_BINARY_DIR
. I also have about 10-15ament_add_gtest()
calls. Is there some way to set the default once instead of addingWORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
to everyament_add_gtest()
call? Or is it better practice to copy test data into the build directory only, but not the install directory?I guess there aren't any action items for this repo, but I suppose I could open a documentation ticket that references this one.
I think Foxy was the first release to have this guide? I'm not sure.
The text was updated successfully, but these errors were encountered: