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

[ament_cmake_gtest] ensure gtest to consume the correct headers. #267

Merged
merged 2 commits into from
Aug 6, 2020

Conversation

seanyen
Copy link
Contributor

@seanyen seanyen commented Jul 21, 2020

When building ROS2 from source on Windows, if there is another copy of gtest in the CMAKE_PREFIX_PATH, the ament_cmake_gtest could consume the wrong headers and causes build breaks.

Here is a snapshot of what errors you might see:

C:\opt\ros\eloquent\x64\src\gtest_vendor\.\src/gtest.cc(2206,24): error C2039: 'skipped': is not a member of 'testing::TestPartResult' [C:\workspace\xxx_ws\build\srdfdom\gtest\gtest.vcxproj]
C:\opt\rosdeps\x64\include\gtest/gtest-test-part.h(47): message : see declaration of 'testing::TestPartResult' [C:\workspace\xxx_ws\build\srdfdom\gtest\gtest.vcxproj]

This pull request is to ensure the gtest and gtest_main to consume the respective headers.

Signed-off-by: seanyen <seanyen@microsoft.com>
Signed-off-by: seanyen <seanyen@microsoft.com>
@dirk-thomas
Copy link
Contributor

Just to be safe - the patch shouldn't affect our standard builds. CI build only running CTest tests (except linters):

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

@dirk-thomas dirk-thomas merged commit 79145a6 into ament:master Aug 6, 2020
@seanyen seanyen deleted the seanyen/googletest branch August 6, 2020 22:28
@seanyen
Copy link
Contributor Author

seanyen commented Aug 6, 2020

Thanks for the review and merge!

dirk-thomas pushed a commit that referenced this pull request Aug 6, 2020
* ensure gtest to consume the correct headers.

Signed-off-by: seanyen <seanyen@microsoft.com>

* add another patch.

Signed-off-by: seanyen <seanyen@microsoft.com>
@dirk-thomas dirk-thomas added the bug Something isn't working label Aug 6, 2020
dirk-thomas pushed a commit that referenced this pull request Aug 7, 2020
* ensure gtest to consume the correct headers.

Signed-off-by: seanyen <seanyen@microsoft.com>

* add another patch.

Signed-off-by: seanyen <seanyen@microsoft.com>
Signed-off-by: Dirk Thomas <dirk-thomas@users.noreply.github.com>
dirk-thomas added a commit that referenced this pull request Aug 7, 2020
… (#268)

* ensure gtest to consume the correct headers.

Signed-off-by: seanyen <seanyen@microsoft.com>

* add another patch.

Signed-off-by: seanyen <seanyen@microsoft.com>
Signed-off-by: Dirk Thomas <dirk-thomas@users.noreply.github.com>

Co-authored-by: Sean Yen <seanyen@microsoft.com>
seanyen added a commit to ms-iot/ament_cmake that referenced this pull request Sep 16, 2020
…nt#267)

* ensure gtest to consume the correct headers.

Signed-off-by: seanyen <seanyen@microsoft.com>

* add another patch.

Signed-off-by: seanyen <seanyen@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants