ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

You didn't actually link against gtest

find_package(ament_cmake_gtest REQUIRED)

Ex. from Nav2's CI

if(BUILD_TESTING)
  find_package(ament_lint_auto REQUIRED)
  ament_lint_auto_find_test_dependencies()
  find_package(ament_cmake_gtest REQUIRED)
  add_subdirectory(test)
endif()

You didn't actually link against find gtest

find_package(ament_cmake_gtest REQUIRED)

Ex. from Nav2's CI

if(BUILD_TESTING)
  find_package(ament_lint_auto REQUIRED)
  ament_lint_auto_find_test_dependencies()
  find_package(ament_cmake_gtest REQUIRED)
  add_subdirectory(test)
endif()

You didn't actually find gtestgtest I believe, the rest looks good to me from a quick glance

find_package(ament_cmake_gtest REQUIRED)

Ex. from Nav2's CI

if(BUILD_TESTING)
  find_package(ament_lint_auto REQUIRED)
  ament_lint_auto_find_test_dependencies()
  find_package(ament_cmake_gtest REQUIRED)
  add_subdirectory(test)
endif()