Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removes custom gtest package and uses ament_cmake_gtest instead #717

Merged
merged 9 commits into from
Nov 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ jobs:
token: ${{ secrets.MALIPUT_TOKEN }}
# use setup-ros action to get vcs, rosdep, and colcon
- uses: ros-tooling/[email protected]
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
# install drake_vendor prereqs using dsim-repos-index/tools/prereqs.lib
- name: install drake_vendor prereqs
shell: bash
Expand Down
2 changes: 2 additions & 0 deletions package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,12 @@
<build_export_depend>ignition-msgs2</build_export_depend>
<build_export_depend>ignition-transport5</build_export_depend>
<build_export_depend>malidrive</build_export_depend>
<build_export_depend>maliput_malidrive</build_export_depend>

<exec_depend>ament_cmake</exec_depend>
<exec_depend>py_trees</exec_depend>

<test_depend>ament_cmake_gtest</test_depend>
<test_depend>ament_cmake_clang_format</test_depend>

<export>
Expand Down
15 changes: 4 additions & 11 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
# Find Packages
##############################################################################

find_package(ament_cmake_gtest REQUIRED)

# Find the Python interpreter for running the check_test_ran.py script
find_package(PythonInterp QUIET)

Expand All @@ -15,7 +17,7 @@ macro(delphyne_build_tests)
string(REGEX REPLACE ".cc" "" BINARY_NAME ${GTEST_SOURCE_file})
set(BINARY_NAME ${TEST_TYPE}_${BINARY_NAME})

add_executable(${BINARY_NAME} ${GTEST_SOURCE_file} ${sources})
ament_add_gtest(${BINARY_NAME} ${GTEST_SOURCE_file} TIMEOUT 240)

target_include_directories(${BINARY_NAME}
PRIVATE
Expand All @@ -25,15 +27,12 @@ macro(delphyne_build_tests)
)

# Kind of an ugly catch-all bucket

target_link_libraries(
${BINARY_NAME}
agents
backend
delphyne_test_utilities
drake::drake
gtest_main
gtest
ignition-common3::ignition-common3
ignition-msgs2::ignition-msgs2
ignition-transport5::ignition-transport5
Expand All @@ -50,17 +49,12 @@ macro(delphyne_build_tests)
# Remove a warning in GTest.
target_compile_options(${BINARY_NAME} PRIVATE "-Wno-sign-compare")

add_test(${BINARY_NAME} ${CMAKE_CURRENT_BINARY_DIR}/${BINARY_NAME}
--gtest_output=xml:${CMAKE_BINARY_DIR}/test_results/${BINARY_NAME}.xml)

set_tests_properties(${BINARY_NAME} PROPERTIES TIMEOUT 240)

if (PYTHONINTERP_FOUND)
# Check that the test produced a result and create a failure if
# it didn't. Guards against crashed and timed out tests.
add_test(check_${BINARY_NAME} python
${PROJECT_SOURCE_DIR}/test/utils/check_test_ran.py
${CMAKE_BINARY_DIR}/test_results/${BINARY_NAME}.xml)
${CMAKE_BINARY_DIR}/test_results/delphyne/${BINARY_NAME}.gtest.xml)
endif()
endforeach()
endmacro()
Expand All @@ -84,7 +78,6 @@ configure_file (test_config.h.in ${PROJECT_BINARY_DIR}/test/test_config.h)
# Testing
##############################################################################

add_subdirectory(libgtest)
add_subdirectory(regression)


5 changes: 0 additions & 5 deletions test/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@ $ ./test/run_tests.sh

## Errata

### GTest

Built as a shared library so that it can be used in helper libraries AND
test executables without causing invalid pointer fun in the destructors.

### Categories

Regression, performance and integration. If we get so many tests, might be worth
Expand Down
Empty file removed test/libgtest/AMENT_IGNORE
Empty file.
23 changes: 0 additions & 23 deletions test/libgtest/CMakeLists.txt

This file was deleted.

227 changes: 0 additions & 227 deletions test/libgtest/gtest-1.7.0/cmake/internal_utils.cmake

This file was deleted.

44 changes: 0 additions & 44 deletions test/libgtest/gtest-1.7.0/gtest-1.7.0.diff

This file was deleted.

Loading