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

Convert retreived path to CMake path for use. #244

Merged
merged 2 commits into from
May 19, 2019

Conversation

nuclearsandwich
Copy link
Member

While working I encountered an error due to mixed CMake and Windows
style paths from this package (Example below).

With this change the path will be converted to a CMake path as soon as
it is validated.

CMake Error at cmake/add_launch_test.cmake:67 (if):
  Syntax error in cmake code at

    C:/Users/Administrator/jacob_ws/src/ros2/launch/launch_testing_ament_cmake/cmake/add_launch_test.cmake:67

  when parsing string

    c:\Users\Administrator\jacob_ws\install\launch_testing/share/launch_testing/examples/args.test.py

  Invalid character escape '\U'.
Call Stack (most recent call first):
  cmake/add_launch_test.cmake:105 (parse_launch_test_arguments)
  CMakeLists.txt:28 (add_launch_test)

While working I encountered an error due to mixed CMake and Windows
style paths from this package (Example below).

With this change the path will be converted to a CMake path as soon as
it is validated.

```
CMake Error at cmake/add_launch_test.cmake:67 (if):
  Syntax error in cmake code at

    C:/Users/Administrator/jacob_ws/src/ros2/launch/launch_testing_ament_cmake/cmake/add_launch_test.cmake:67

  when parsing string

    c:\Users\Administrator\jacob_ws\install\launch_testing/share/launch_testing/examples/args.test.py

  Invalid character escape '\U'.
Call Stack (most recent call first):
  cmake/add_launch_test.cmake:105 (parse_launch_test_arguments)
  CMakeLists.txt:28 (add_launch_test)
```

Signed-off-by: Steven! Ragnarök <steven@nuclearsandwich.com>
@nuclearsandwich nuclearsandwich added the in review Waiting for review (Kanban column) label May 18, 2019
@nuclearsandwich nuclearsandwich self-assigned this May 18, 2019
@nuclearsandwich
Copy link
Member Author

  • Linux Build Status
  • Linux-aarch64 Build Status
  • macOS Build Status
  • Windows Build Status

Move the conversion into the add_launch_test function so all callers can
benefit from it. The conversion must happen before the internal argument
parsing macro is called in order to avoid string escape errors on
Windows.

Signed-off-by: Steven! Ragnarök <steven@nuclearsandwich.com>
@nuclearsandwich
Copy link
Member Author

  • Linux Build Status
  • Linux-aarch64 Build Status
  • macOS Build Status
  • Windows Build Status

@nuclearsandwich
Copy link
Member Author

The second commit moves the conversion into the add_launch_test function. I tried at first to do it inside the argument parsing macro but the macro invocation itself has errors if the string contains unescaped backslashes at that point. So it has to be just before it is called.

@nuclearsandwich nuclearsandwich merged commit c0abf15 into master May 19, 2019
@delete-merged-branch delete-merged-branch bot deleted the convert-to-cmake-path branch May 19, 2019 05:38
@hidmic
Copy link
Contributor

hidmic commented May 20, 2019

Just saw this on CI: https://ci.ros2.org/job/ci_windows/6980/testReport/junit/(root)/projectroot/C__J_workspace_ci_windows_ws_install_share_launch_testing_examples_args_test_py/. Could be it a regression related to this patch?

@nuclearsandwich
Copy link
Member Author

nuclearsandwich commented May 20, 2019

This test failure is indeed introduced by this change.

Actually, this was premature. It looks like #239 which landed on top of this independently reproduces the above error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in review Waiting for review (Kanban column)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants