Skip to content

Ros2 reenable tests - #59

Merged
mikaelarguedas merged 4 commits into
ros2from
ros2_reenable_tests
Nov 8, 2017
Merged

mikaelarguedas merged 4 commits into
ros2from
ros2_reenable_tests

Conversation

@mikaelarguedas

Copy link
Copy Markdown
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

Comment thread test/fviz_case_study/CMakeLists.txt Outdated
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
Copy Markdown
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
Copy Markdown
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>)?

Comment thread src/class_loader.cpp
#elif _WIN32
return ".dll";
#else
return Poco::SharedLibrary::suffix();

Copy link
Copy Markdown
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
Copy Markdown
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)

Comment thread test/CMakeLists.txt Outdated
class_loader_hide_library_symbols(${PROJECT_NAME}_TestPlugins1)

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

Copy link
Copy Markdown
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
Copy Markdown
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?

Comment thread test/CMakeLists.txt
add_dependencies(${PROJECT_NAME}_utest ${PROJECT_NAME}_TestPlugins1 ${PROJECT_NAME}_TestPlugins2)
add_dependencies(${PROJECT_NAME}_utest
${PROJECT_NAME}_TestPlugins1
${PROJECT_NAME}_TestPlugins2)

Copy link
Copy Markdown
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
Copy Markdown
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

Comment thread test/fviz_case_study/CMakeLists.txt Outdated
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
Copy Markdown
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

mikaelarguedas commented Nov 7, 2017 •

Copy link
Copy Markdown
Member Author

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.

@wjwwood wjwwood left a comment

Copy link
Copy Markdown
Member

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
Copy Markdown
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