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

Use enable_testing() instead of include(CTest) #150

Closed
wants to merge 1 commit into from

Conversation

jpsamper2009
Copy link
Contributor

  • include(CTest) enables CTest and CDash
  • CDash creates a lot of targets (ContinuousBuild, NightlyTest, etc.) which are not needed
  • enable_testing() enables CTest without CDash

See also https://stackoverflow.com/questions/45169854/cmake-in-qtcreator-4-3-shows-many-automatic-targets-how-to-remove-hide-them

- include(CTest) enables CTest and CDash
- CDash creates a lot of targets (ContinuousBuild, NightlyTest, etc.) which are not needed
- enable_testing() enables CTest without CDash
@tfoote tfoote added the in review Waiting for review (Kanban column) label Jan 14, 2019
@jpsamper2009
Copy link
Contributor Author

Turns out that this change disables all tests that are wrapped with BUILD_TESTING. The alternative may be to set(ENABLE_TESTING ON) also, but I'll investigate further to make sure we don't have even more unexpected side effects

@dirk-thomas
Copy link
Contributor

Instead of calling set(...) you should define it with option(...) as it happens when including the CTest module.

@jpsamper2009
Copy link
Contributor Author

@dirk-thomas It looks like there is some expectation that CDash is enabled. I get the following warning after adding option(BUILD_TESTING "Option to enable/disable tests" ON):

$ colcon test --packages-select rcutils
...
--- stderr: rcutils
Cannot find file: /home/jp.samper/ros2_ws/build/rcutils/DartConfiguration.tcl
Problem reading custom configuration: /home/jp.samper/ros2_ws/build/rcutils/CTestCustom.ctest
Cannot find file: /home/jp.samper/ros2_ws/build/rcutils/DartConfiguration.tcl
---
  • The CTestCustom.ctest warning is coming from line 27 of ament_cmake_test-extras.cmake
    • Simply deleting the lines gets rid of the warning without causing any new warnings/error
  • The other two warnings are generated by the ctest invocation because of the -D ExperimentalTest.

Since it looks like this is a bigger task than expected. I'll actually close this PR and create an issue for discussing.

@tfoote tfoote removed the in review Waiting for review (Kanban column) label Jan 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants