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

Ros2 reenable tests #59

Merged
merged 4 commits into from
Nov 8, 2017
Merged

Ros2 reenable tests #59

merged 4 commits into from
Nov 8, 2017

Conversation

mikaelarguedas
Copy link
Member

Opening for visibility.

Apparently class_loader tests have been disabled in ROS2 for a looong time (ament/ament_cmake#68). This aims to reenable and fix them

ament_add_gtest(${PROJECT_NAME}_fviz_test fviz_test.cpp)
set(append_library_dirs "${CMAKE_CURRENT_BINARY_DIR}")
if(WIN32)
set(append_library_dirs "${append_library_dirs}/../../$<CONFIG>;${append_library_dirs}/$<CONFIG>")
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wjwwood @dirk-thomas this is pretty ugly. Am I approaching this the wrong way?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I get why you want to use ${append_library_dirs}/$<CONFIG> but where is ${append_library_dirs}/../$<CONFIG> supposed to be pointing to?

Maybe you can use a generator expression to point to the target directory of one of the plugin libraries instead (like $<TARGET_FILE_DIR:${PROJECT_NAME}_TestPlugins1>)?

return ".dll";
#else
return Poco::SharedLibrary::suffix();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't it be nice if the debug shared libraries could be loaded for debugging?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes that would be great, I'll track this on #31 given that this commit already got merged in #60
(commenting now because the rebase + force push may overwrite this comment)

@@ -7,43 +7,62 @@ target_include_directories(${PROJECT_NAME}_TestPlugins1
PUBLIC "../include" ${console_bridge_INCLUDE_DIRS} ${Poco_INCLUDE_DIRS})
target_link_libraries(${PROJECT_NAME}_TestPlugins1 ${PROJECT_NAME})
class_loader_hide_library_symbols(${PROJECT_NAME}_TestPlugins1)

if(WIN32)
target_compile_definitions(${PROJECT_NAME}_TestPlugins1 PRIVATE "CLASS_LOADER_BUILDING_DLL")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My expectation would be that this should only be defined when class_loader is being built. Why is this necessary here? And if it is I would suggest to use a separate name to indicate that the "using" part of class loader is being built here.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without this, the tests linking against these testing libraries fail to link.

And if it is I would suggest to use a separate name to indicate that the "using" part of class loader is being built here.

I'm not sure I get what you mean here, do you suggest creating another set of visibility macros for the libraries built and used for testing?

add_dependencies(${PROJECT_NAME}_utest ${PROJECT_NAME}_TestPlugins1 ${PROJECT_NAME}_TestPlugins2)
add_dependencies(${PROJECT_NAME}_utest
${PROJECT_NAME}_TestPlugins1
${PROJECT_NAME}_TestPlugins2)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the target already links against these libraries the dependency declaration is redundant.

Same below.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indeed the target should not link these libraries, fixed in 08d4345

ament_add_gtest(${PROJECT_NAME}_fviz_test fviz_test.cpp)
set(append_library_dirs "${CMAKE_CURRENT_BINARY_DIR}")
if(WIN32)
set(append_library_dirs "${append_library_dirs}/../../$<CONFIG>;${append_library_dirs}/$<CONFIG>")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I get why you want to use ${append_library_dirs}/$<CONFIG> but where is ${append_library_dirs}/../$<CONFIG> supposed to be pointing to?

Maybe you can use a generator expression to point to the target directory of one of the plugin libraries instead (like $<TARGET_FILE_DIR:${PROJECT_NAME}_TestPlugins1>)?

…15 so we cant use that, removing all cpp11 checks for now given that ros2 and melodic will only target compilers that support it
@mikaelarguedas
Copy link
Member Author

mikaelarguedas commented Nov 7, 2017

Ok I think this is ready for a round of reviews

This PR reenables the tests for ROS2, convert the tests using catkin and boost to use ament and STL and modifies test amd CMake code to pass on all platforms

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

Note: I removed all the checks for c++11 support, my assumption here is that I'll branch out class_loader for Melodic and will not need that check in Melodic either because all compilers will support c++11 by default. I will reconciliate the melodic-devel and the ros2 branches at that point.

Copy link
Member

@wjwwood wjwwood left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, thanks for cleaning up those tests for me

@mikaelarguedas mikaelarguedas changed the title [WIP] Ros2 reenable tests Ros2 reenable tests Nov 8, 2017
@mikaelarguedas
Copy link
Member Author

ok I rerun a full set of CI and everything's green, merging

@mikaelarguedas mikaelarguedas merged commit 3411f8d into ros2 Nov 8, 2017
@mikaelarguedas mikaelarguedas deleted the ros2_reenable_tests branch November 8, 2017 19:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants