ament / ament_lint

Apache License 2.0
36 stars 107 forks source link

ament_lint_auto does not respect `<test_depend condition=...>` #266

Closed rotu closed 3 years ago

rotu commented 4 years ago

Adding a conditional flag to disable cppcheck <test_depend condition="$OSTYPE==linux-gnu">ament_cmake_cppcheck</test_depend> causes a test failure on Linux and non-Linux platforms.

Compare:

Enable cppcheck unconditionally: https://github.com/rotu/rmw_cyclonedds/actions/runs/232035117 Linux passes, Mac and Windows fail (because ament_cmake_cppcheck fails to pull in macros from rcutils; separate issue)

Enable cppcheck only on linux: https://github.com/rotu/rmw_cyclonedds/actions/runs/231703783 Linux, Mac, and Windows all fail. This is unexpected on Linux because the condition should evaluate to true and so the test should continue to pass. It is unexpected on Mac and Windows, because the condition should evaluate to false and so the test should not be attempted

Disable cppcheck unconditionally: https://github.com/rotu/rmw_cyclonedds/actions/runs/231705143 All platforms pass since cppcheck is not attempted to run.

rotu commented 4 years ago

fyi @piraka9011 I think the problem is that various ament tools either respect or don't respect the condition flag.

discovered in https://github.com/ros2/rmw_cyclonedds/pull/232

mjeronimo commented 3 years ago

Fixed by https://github.com/ament/ament_cmake/pull/287

rotu commented 3 years ago

Thanks, @mjeronimo!

mjeronimo commented 3 years ago

@rotu You're welcome. Glad I could track it down.