Skip to content

Commit 5f6b95f

Browse files
[tests] Fix the way the test library is build and the Path in launch files.
1 parent 9089b48 commit 5f6b95f

File tree

3 files changed

+17
-20
lines changed

3 files changed

+17
-20
lines changed

tests/CMakeLists.txt

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ if(BUILD_TESTING)
1414
add_library(impl_test_sot_mock_device SHARED impl_test_sot_mock_device.cpp)
1515
set_target_properties(impl_test_sot_mock_device PROPERTIES INSTALL_RPATH
1616
$ORIGIN)
17-
# target_include_directories(impl_test_sot_mock_device PUBLIC include)
1817
target_link_libraries(
1918
impl_test_sot_mock_device PUBLIC sot-core::sot-core
2019
dynamic-graph-python::dynamic-graph-python)
@@ -32,15 +31,12 @@ if(BUILD_TESTING)
3231
dynamic_graph_bridge-impl_test_sot_mock_device-wrap SOURCE_PYTHON_MODULE
3332
"${CMAKE_CURRENT_SOURCE_DIR}/impl_test_sot_mock_device-python-module-py.cc")
3433

35-
install(
36-
TARGETS ${plugin_library_name}
37-
EXPORT ${TARGETS_EXPORT_NAME}
38-
DESTINATION ${DYNAMIC_GRAPH_PLUGINDIR})
3934
# Library for sot_external_interface
4035
add_library(impl_test_library SHARED impl_test_sot_external_interface.cpp)
4136

4237
target_include_directories(impl_test_library PUBLIC include)
43-
target_link_libraries(impl_test_library PUBLIC sot-core::sot-core)
38+
target_link_libraries(impl_test_library PUBLIC impl_test_sot_mock_device
39+
sot-core::sot-core)
4440
ament_target_dependencies(impl_test_library PUBLIC dynamic_graph_bridge_msgs
4541
rclcpp rcl_interfaces std_srvs)
4642
# Executable for SotLoaderBasic test

tests/launch/launching_test_sot_loader.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,19 +31,18 @@
3131
def generate_test_description():
3232
"""Load a simple urdf, parameters and the library."""
3333
ld = LaunchDescription()
34-
34+
print("After launch description")
3535
robot_description_content_path = PathJoinSubstitution(
3636
[
3737
get_package_share_directory("dynamic_graph_bridge"),
3838
"urdf",
3939
"dgb_minimal_robot.urdf",
4040
],
4141
)
42-
43-
robot_description_content = Path.open(
44-
robot_description_content_path.perform(None),
45-
).read()
46-
42+
print("Before robot_description_content")
43+
robot_description_content_path = Path(robot_description_content_path.perform(None))
44+
robot_description_content = robot_description_content_path.open().read()
45+
print("Before params")
4746
params = {
4847
"state_vector_map": ["joint1", "joint2"],
4948
"robot_description": robot_description_content,

tests/launch/launching_test_sot_loader_basic.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,17 +33,19 @@ def generate_test_description():
3333
3434
It also set parameters state_vector_map and robot_description
3535
"""
36+
print("start generate_test_description")
3637
ld = LaunchDescription()
3738

38-
robot_description_content_path = (
39-
Path(get_package_share_directory("dynamic_graph_bridge"))
40-
/ "urdf"
41-
/ "dgb_minimal_robot.urdf"
39+
robot_description_pathjs_str = PathJoinSubstitution(
40+
[
41+
get_package_share_directory("dynamic_graph_bridge"),
42+
"urdf",
43+
"dgb_minimal_robot.urdf",
44+
],
4245
)
43-
assert robot_description_content_path.exists()
44-
robot_description_content = Path.open(
45-
PathJoinSubstitution(str(robot_description_content_path)).perform(None),
46-
).read()
46+
robot_description_path = Path(robot_description_pathjs_str.perform(None))
47+
robot_description_content = robot_description_path.open().read()
48+
print("After building robot_description_content")
4749
terminating_process = Node(
4850
package="dynamic_graph_bridge",
4951
executable="test_sot_loader_basic",

0 commit comments

Comments
 (0)