diff --git a/.github/workflows/apt.yml b/.github/workflows/apt.yml index f693aa8..4214411 100644 --- a/.github/workflows/apt.yml +++ b/.github/workflows/apt.yml @@ -41,7 +41,10 @@ jobs: sudo apt-get update # YARP dependencies sudo apt-get install git build-essential cmake ninja-build libace-dev libeigen3-dev libopencv-dev libtinyxml-dev + # gz-sim-yarp-plugins dependencies sudo apt-get install gz-${{ matrix.gazebo_distro }} + # Test dependencies + sudo apt-get install libgtest-dev - name: Cache Source-based Dependencies id: cache-source-deps diff --git a/README.md b/README.md index b6db20d..d854818 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ installing the dependencies with conda-forge on Linux, macOS or Windows, or apt Create and activate an environment with the required dependencies: ~~~ -mamba create -c conda-forge -n gsypdev libgz-sim8 yarp ycm-cmake-modules cmake ninja pkg-config cmake compilers +mamba create -c conda-forge -n gsypdev libgz-sim8 yarp ycm-cmake-modules cmake ninja pkg-config cmake compilers gtest mamba activate gsypdev ~~~ @@ -48,7 +48,7 @@ First install some necessary dependencies from apt ~~~ sudo apt-get update -sudo apt-get install lsb-release wget gnupg cmake pkg-config ninja-build build-essential +sudo apt-get install lsb-release wget gnupg cmake pkg-config ninja-build build-essential libgtest-dev ~~~ Then install Gazebo Harmonic: diff --git a/ci_env.yml b/ci_env.yml index 7e5a8d8..5f9c59f 100644 --- a/ci_env.yml +++ b/ci_env.yml @@ -9,3 +9,4 @@ dependencies: - pkg-config - libgz-sim8 - yarp + - gtest diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 4583d0f..28234a7 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -1,11 +1,4 @@ -# Fetch and configure GTest -include(FetchContent) -FetchContent_Declare( - googletest - URL https://github.com/google/googletest/archive/609281088cfefc76f9d0ce82e1ff6c30cc3591e5.zip -) -set(gtest_force_shared_crt ON CACHE BOOL "" FORCE) -FetchContent_MakeAvailable(googletest) +find_package(GTest REQUIRED) add_subdirectory(forcetorque) add_subdirectory(imu) diff --git a/tests/camera/CMakeLists.txt b/tests/camera/CMakeLists.txt index 51abf47..f135120 100644 --- a/tests/camera/CMakeLists.txt +++ b/tests/camera/CMakeLists.txt @@ -1,6 +1,6 @@ add_executable(CameraTest CameraTest.cc) target_link_libraries(CameraTest - gtest_main + GTest::gtest_main gz-sim${GZ_SIM_VER}::gz-sim${GZ_SIM_VER} gz-plugin${GZ_PLUGIN_VER}::gz-plugin${GZ_PLUGIN_VER} ${YARP_LIBRARIES} diff --git a/tests/clock/CMakeLists.txt b/tests/clock/CMakeLists.txt index 4d975b9..2f10b57 100644 --- a/tests/clock/CMakeLists.txt +++ b/tests/clock/CMakeLists.txt @@ -1,6 +1,6 @@ add_executable(ClockTest ClockTest.cc) target_link_libraries(ClockTest - gtest_main + GTest::gtest_main gz-sim${GZ_SIM_VER}::gz-sim${GZ_SIM_VER} gz-plugin${GZ_PLUGIN_VER}::gz-plugin${GZ_PLUGIN_VER} YARP::YARP_dev diff --git a/tests/commons/CMakeLists.txt b/tests/commons/CMakeLists.txt index e978278..cfd0112 100644 --- a/tests/commons/CMakeLists.txt +++ b/tests/commons/CMakeLists.txt @@ -2,7 +2,7 @@ add_executable(ConfigurationParsingTest ConfigurationParsingTest.cc) target_link_libraries(ConfigurationParsingTest PRIVATE - gtest_main + GTest::gtest_main gz-sim${GZ_SIM_VER}::gz-sim${GZ_SIM_VER} gz-plugin${GZ_PLUGIN_VER}::gz-plugin${GZ_PLUGIN_VER} YARP::YARP_dev diff --git a/tests/controlboard/CMakeLists.txt b/tests/controlboard/CMakeLists.txt index b9d5864..c5506e8 100644 --- a/tests/controlboard/CMakeLists.txt +++ b/tests/controlboard/CMakeLists.txt @@ -9,7 +9,7 @@ foreach(TEST ${TESTS}) add_executable(${TEST} ${TEST}.cc) target_link_libraries(${TEST} - PRIVATE gtest_main + PRIVATE GTest::gtest_main PRIVATE gz-plugin${GZ_PLUGIN_VER}::gz-plugin${GZ_PLUGIN_VER} PRIVATE gz-sim${GZ_SIM_VER}::gz-sim${GZ_SIM_VER} PRIVATE diff --git a/tests/forcetorque/CMakeLists.txt b/tests/forcetorque/CMakeLists.txt index 1c17d7f..cab4fe9 100644 --- a/tests/forcetorque/CMakeLists.txt +++ b/tests/forcetorque/CMakeLists.txt @@ -1,6 +1,6 @@ add_executable(ForceTorqueTest ForceTorqueTest.cc) target_link_libraries(ForceTorqueTest - gtest_main + GTest::gtest_main gz-sim${GZ_SIM_VER}::gz-sim${GZ_SIM_VER} gz-plugin${GZ_PLUGIN_VER}::gz-plugin${GZ_PLUGIN_VER} ${YARP_LIBRARIES} diff --git a/tests/imu/CMakeLists.txt b/tests/imu/CMakeLists.txt index b27f446..3ccbe3c 100644 --- a/tests/imu/CMakeLists.txt +++ b/tests/imu/CMakeLists.txt @@ -1,6 +1,6 @@ add_executable(ImuTest ImuTest.cc) target_link_libraries(ImuTest - PRIVATE gtest_main + PRIVATE GTest::gtest_main PRIVATE gz-sim${GZ_SIM_VER}::gz-sim${GZ_SIM_VER} PRIVATE gz-plugin${GZ_PLUGIN_VER}::gz-plugin${GZ_PLUGIN_VER} PRIVATE diff --git a/tests/laser/CMakeLists.txt b/tests/laser/CMakeLists.txt index b59baf3..ce50f92 100644 --- a/tests/laser/CMakeLists.txt +++ b/tests/laser/CMakeLists.txt @@ -1,6 +1,6 @@ add_executable(LaserTest LaserTest.cc) target_link_libraries(LaserTest - gtest_main + GTest::gtest_main gz-sim${GZ_SIM_VER}::gz-sim${GZ_SIM_VER} gz-plugin${GZ_PLUGIN_VER}::gz-plugin${GZ_PLUGIN_VER} ${YARP_LIBRARIES}