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

Use ADD_PYTHON_MEMORYCHECK_UNIT_TEST from jrlcmakemodules #2095

Merged
merged 4 commits into from
Nov 23, 2023
Merged
Show file tree
Hide file tree
Changes from 2 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
1 change: 0 additions & 1 deletion .github/workflows/ros-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ jobs:
strategy:
matrix:
env:
- {ROS_DISTRO: melodic}
- {ROS_DISTRO: noetic}
- {ROS_DISTRO: rolling, BUILDER: colcon}
env:
Expand Down
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[submodule "cmake"]
path = cmake
url = https://github.com/jrl-umi3218/jrl-cmakemodules
url = https://github.com/jorisv/jrl-cmakemodules
[submodule "models/example-robot-data"]
path = models/example-robot-data
url = https://github.com/Gepetto/example-robot-data.git
2 changes: 1 addition & 1 deletion cmake
39 changes: 0 additions & 39 deletions unittest/python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,45 +2,6 @@
# Copyright (c) 2015-2023 CNRS INRIA
#

macro(ADD_PYTHON_MEMORYCHECK_UNIT_TEST NAME SOURCE)
set(TEST_FILE_NAME memorycheck_unit_test_${NAME}.cmake)
set(PYTHON_TEST_SCRIPT "${PROJECT_SOURCE_DIR}/${SOURCE}")
configure_file(memorycheck_unit_test.cmake.in ${TEST_FILE_NAME} @ONLY)

add_test(NAME ${NAME}
COMMAND ${CMAKE_COMMAND} -P ${TEST_FILE_NAME})

set(MODULES "${ARGN}") # ARGN is not a variable
foreach(MODULE_PATH IN LISTS MODULES)
list(APPEND PYTHONPATH "${CMAKE_BINARY_DIR}/${MODULE_PATH}")
endforeach()

if(DEFINED ENV{PYTHONPATH})
list(APPEND PYTHONPATH "$ENV{PYTHONPATH}")
endif()

# get path separator to join those paths
execute_process(
COMMAND "${PYTHON_EXECUTABLE}" "-c" "import os; print(os.pathsep)"
OUTPUT_VARIABLE PATHSEP
OUTPUT_STRIP_TRAILING_WHITESPACE)

list(REMOVE_DUPLICATES PYTHONPATH)
if(WIN32)
# ensure that severals paths stay together as ENV variable PYTHONPATH when
# passed to python test via PROPERTIES
string(REPLACE ";" "\;" PYTHONPATH_STR "${PYTHONPATH}")
else(WIN32)
string(REPLACE ";" "${PATHSEP}" PYTHONPATH_STR "${PYTHONPATH}")
endif(WIN32)
set(ENV_VARIABLES "PYTHONPATH=${PYTHONPATH_STR}")
if(APPLE)
list(APPEND ENV_VARIABLES "LD_LIBRARY_PATH=$ENV{LD_LIBRARY_PATH}")
list(APPEND ENV_VARIABLES "DYLD_LIBRARY_PATH=$ENV{DYLD_LIBRARY_PATH}")
endif(APPLE)
set_tests_properties(${NAME} PROPERTIES ENVIRONMENT "${ENV_VARIABLES}")
endmacro()

SET(${PROJECT_NAME}_PYTHON_TESTS
bindings

Expand Down
17 changes: 0 additions & 17 deletions unittest/python/memorycheck_unit_test.cmake.in

This file was deleted.

Loading