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

Document running tests on catkin packages #29

Closed
paulbovbel opened this issue Jul 26, 2018 · 3 comments
Closed

Document running tests on catkin packages #29

paulbovbel opened this issue Jul 26, 2018 · 3 comments

Comments

@paulbovbel
Copy link
Contributor

paulbovbel commented Jul 26, 2018

Doing a bit of experimenting, I've found that running test on catkin packages isn't quite as straightforward as colcon build && colcon test. It's not immediately obvious, but one has to run:

colcon build --cmake-target tests
colcon test

...as extracted from ros-infrastructure/ros_buildfarm#548,


I'm guessing this is my fault, but I've found that when I attach a DEPENDENCY to catkin_add_nosetests such as when using catkin_virtualenv (https://github.com/paulbovbel/test_meta/blob/master/CMakeLists.txt#L52), I have to run the following to get all tests to pass:

colcon build
colcon build --cmake-target tests
colcon test

Even though it looks like the ${PROJECT_NAME}_generate_virtualenv should be getting hooked in via the underlying catkin mechanisms.

@dirk-thomas
Copy link
Member

In catkin packages test targets are usually created with the EXCLUDE_FROM_ALL flag. Therefore they are not being built by a normal cmake --build invocation. To the second snippet (colcon build, colcon build --cmake-target tests, colcon test) is the right "generic" approach.

Can you create a pull request to update the documentation accordingly?

@paulbovbel
Copy link
Contributor Author

paulbovbel commented Jul 26, 2018

Done #30

Although I wonder if for consistency's sake, it would make sense to suppress EXCLUDE_FROM_ALL behaviour when building from ROS via colcon.

@dirk-thomas
Copy link
Member

it would make sense to suppress EXCLUDE_FROM_ALL behaviour when building from ROS via colcon

I don't think there is (currently?) a way to override that from the "outside". The argument is hard coded in the CMake code (e.g. the catkin function to add tests) but potentially also in the package specific CMake code. If you can imagine a way I would be happy to consider it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants