From cee576db75e3bbe05fb8fbf4927e2beac7afd946 Mon Sep 17 00:00:00 2001 From: Deep Kotadiya Date: Thu, 14 May 2026 21:11:34 -0400 Subject: [PATCH 1/2] Fix C++ testing tutorial: comment out placeholder target_link_libraries > Cpp Testing #2833 --- source/Tutorials/Intermediate/Testing/Cpp.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/Tutorials/Intermediate/Testing/Cpp.rst b/source/Tutorials/Intermediate/Testing/Cpp.rst index 51ddcfbe51b..989f7f911f5 100644 --- a/source/Tutorials/Intermediate/Testing/Cpp.rst +++ b/source/Tutorials/Intermediate/Testing/Cpp.rst @@ -50,11 +50,12 @@ CMakeLists.txt $ $ ) - target_link_libraries(${PROJECT_NAME}_tutorial_test name_of_local_library) + # target_link_libraries(${PROJECT_NAME}_tutorial_test name_of_local_library) endif() The testing code is wrapped in the ``if/endif`` block to avoid building tests where possible. ``ament_add_gtest`` functions much like ``add_executable`` so you'll need to call ``target_include_directories`` and ``target_link_libraries`` as you normally would. +The ``target_link_libraries`` call is shown commented out because ``name_of_local_library`` is a placeholder; uncomment it and replace ``name_of_local_library`` with the actual target name from your ``add_library()`` call only if your tests depend on a library built in this package. Running Tests From 2cf1cba0db7155206a835e079211ced8a9c42da7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Hern=C3=A1ndez=20Cordero?= Date: Fri, 15 May 2026 09:13:32 +0200 Subject: [PATCH 2/2] Update source/Tutorials/Intermediate/Testing/Cpp.rst MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Tomoya Fujita Signed-off-by: Alejandro Hernández Cordero --- source/Tutorials/Intermediate/Testing/Cpp.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/Tutorials/Intermediate/Testing/Cpp.rst b/source/Tutorials/Intermediate/Testing/Cpp.rst index 989f7f911f5..10917240b19 100644 --- a/source/Tutorials/Intermediate/Testing/Cpp.rst +++ b/source/Tutorials/Intermediate/Testing/Cpp.rst @@ -55,7 +55,7 @@ CMakeLists.txt The testing code is wrapped in the ``if/endif`` block to avoid building tests where possible. ``ament_add_gtest`` functions much like ``add_executable`` so you'll need to call ``target_include_directories`` and ``target_link_libraries`` as you normally would. -The ``target_link_libraries`` call is shown commented out because ``name_of_local_library`` is a placeholder; uncomment it and replace ``name_of_local_library`` with the actual target name from your ``add_library()`` call only if your tests depend on a library built in this package. +The ``target_link_libraries`` call is shown commented out because ``name_of_local_library`` is a placeholder, uncomment it and replace ``name_of_local_library`` with the actual target name from your ``add_library()`` call only if your tests depend on a library built in this package. Running Tests