Commit 92f94eb4 authored by Justin Carpentier's avatar Justin Carpentier Committed by GitHub

Merge pull request #869 from jcarpent/devel

test: add prefix test- before each TARGET
parents 47670b2a 3e8d8304
......@@ -14,26 +14,27 @@ ENDMACRO(ADD_TEST_CFLAGS)
MACRO(ADD_PINOCCHIO_UNIT_TEST NAME)
SET(PKGS ${ARGN}) # Optional arguments
ADD_UNIT_TEST(${NAME} ${NAME}.cpp)
SET_TARGET_PROPERTIES(${NAME} PROPERTIES LINKER_LANGUAGE CXX)
TARGET_INCLUDE_DIRECTORIES(${NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
SET(TEST_NAME "${NAME}-test")
ADD_UNIT_TEST(${TEST_NAME} ${NAME}.cpp)
SET_TARGET_PROPERTIES(${TEST_NAME} PROPERTIES LINKER_LANGUAGE CXX)
TARGET_INCLUDE_DIRECTORIES(${TEST_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
ADD_TEST_CFLAGS(${NAME} "-DBOOST_TEST_DYN_LINK")
ADD_TEST_CFLAGS(${TEST_NAME} "-DBOOST_TEST_DYN_LINK")
SET(MODULE_NAME "${NAME}Test")
STRING(REGEX REPLACE "-" "_" MODULE_NAME ${MODULE_NAME})
ADD_TEST_CFLAGS(${NAME} "-DBOOST_TEST_MODULE=${MODULE_NAME}")
ADD_TEST_CFLAGS(${TEST_NAME} "-DBOOST_TEST_MODULE=${MODULE_NAME}")
PKG_CONFIG_USE_DEPENDENCY(${NAME} eigen3)
PKG_CONFIG_USE_DEPENDENCY(${TEST_NAME} eigen3)
FOREACH(PKG ${PKGS})
PKG_CONFIG_USE_DEPENDENCY(${NAME} ${PKG})
PKG_CONFIG_USE_DEPENDENCY(${TEST_NAME} ${PKG})
ENDFOREACH(PKG)
IF(HPP_FCL_FOUND)
PKG_CONFIG_USE_DEPENDENCY(${NAME} hpp-fcl)
PKG_CONFIG_USE_DEPENDENCY(${TEST_NAME} hpp-fcl)
ENDIF(HPP_FCL_FOUND)
TARGET_LINK_LIBRARIES(${NAME} ${PROJECT_NAME})
TARGET_LINK_LIBRARIES(${NAME} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
TARGET_LINK_LIBRARIES(${TEST_NAME} ${PROJECT_NAME})
TARGET_LINK_LIBRARIES(${TEST_NAME} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
ENDMACRO(ADD_PINOCCHIO_UNIT_TEST)
# --- RULES -------------------------------------------------------------------
......@@ -62,35 +63,35 @@ ADD_PINOCCHIO_UNIT_TEST(kinematics)
IF(URDFDOM_FOUND)
ADD_PINOCCHIO_UNIT_TEST(urdf urdfdom)
ADD_TEST_CFLAGS(urdf '-DPINOCCHIO_SOURCE_DIR=\\\"${${PROJECT_NAME}_SOURCE_DIR}\\\"')
ADD_TEST_CFLAGS(urdf-test '-DPINOCCHIO_SOURCE_DIR=\\\"${${PROJECT_NAME}_SOURCE_DIR}\\\"')
ADD_PINOCCHIO_UNIT_TEST(value urdfdom)
ADD_TEST_CFLAGS(value '-DPINOCCHIO_SOURCE_DIR=\\\"${${PROJECT_NAME}_SOURCE_DIR}\\\"')
ADD_TEST_CFLAGS(value-test '-DPINOCCHIO_SOURCE_DIR=\\\"${${PROJECT_NAME}_SOURCE_DIR}\\\"')
IF(HPP_FCL_FOUND)
ADD_PINOCCHIO_UNIT_TEST(geom urdfdom)
ADD_TEST_CFLAGS(geom '-DPINOCCHIO_SOURCE_DIR=\\\"${${PROJECT_NAME}_SOURCE_DIR}\\\"')
ADD_TEST_CFLAGS(geom-test '-DPINOCCHIO_SOURCE_DIR=\\\"${${PROJECT_NAME}_SOURCE_DIR}\\\"')
ADD_PINOCCHIO_UNIT_TEST(srdf urdfdom)
ADD_TEST_CFLAGS(srdf '-DPINOCCHIO_SOURCE_DIR=\\\"${${PROJECT_NAME}_SOURCE_DIR}\\\"')
ADD_TEST_CFLAGS(srdf-test '-DPINOCCHIO_SOURCE_DIR=\\\"${${PROJECT_NAME}_SOURCE_DIR}\\\"')
ENDIF(HPP_FCL_FOUND)
ENDIF(URDFDOM_FOUND)
IF(LUA5_FOUND)
ADD_PINOCCHIO_UNIT_TEST(lua ${LUA5_PACKAGE})
ADD_TEST_CFLAGS(lua '-DPINOCCHIO_SOURCE_DIR=\\\"${${PROJECT_NAME}_SOURCE_DIR}\\\"')
ADD_TEST_CFLAGS(lua-test '-DPINOCCHIO_SOURCE_DIR=\\\"${${PROJECT_NAME}_SOURCE_DIR}\\\"')
ENDIF(LUA5_FOUND)
IF(BUILD_PYTHON_INTERFACE)
ADD_PINOCCHIO_UNIT_TEST(python_parser eigenpy)
ADD_TEST_CFLAGS(python_parser '-DPINOCCHIO_SOURCE_DIR=\\\"${${PROJECT_NAME}_SOURCE_DIR}\\\"')
ADD_TEST_CFLAGS(python_parser-test '-DPINOCCHIO_SOURCE_DIR=\\\"${${PROJECT_NAME}_SOURCE_DIR}\\\"')
TARGET_LINK_LIBRARIES(python_parser ${PYWRAP})
TARGET_LINK_LIBRARIES(python_parser ${PYTHON_LIBRARIES})
TARGET_LINK_LIBRARIES(python_parser-test ${PYWRAP})
TARGET_LINK_LIBRARIES(python_parser-test ${PYTHON_LIBRARIES})
SET(ENV_VARIABLES "PYTHONPATH=${CMAKE_BINARY_DIR}/bindings/python:$ENV{PYTHONPATH}")
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_PROPERTY(TEST python_parser PROPERTY ENVIRONMENT ${ENV_VARIABLES})
SET_PROPERTY(TEST python_parser-test PROPERTY ENVIRONMENT ${ENV_VARIABLES})
ADD_SUBDIRECTORY(python)
ENDIF(BUILD_PYTHON_INTERFACE)
......@@ -115,7 +116,7 @@ ADD_PINOCCHIO_UNIT_TEST(version)
ADD_PINOCCHIO_UNIT_TEST(copy)
MAKE_DIRECTORY("${CMAKE_CURRENT_BINARY_DIR}/serialization-data")
ADD_PINOCCHIO_UNIT_TEST(serialization)
ADD_TEST_CFLAGS(serialization '-DTEST_SERIALIZATION_FOLDER=\\\"${CMAKE_CURRENT_BINARY_DIR}/serialization-data\\\"')
ADD_TEST_CFLAGS(serialization-test '-DTEST_SERIALIZATION_FOLDER=\\\"${CMAKE_CURRENT_BINARY_DIR}/serialization-data\\\"')
# Derivatives algo
ADD_PINOCCHIO_UNIT_TEST(kinematics-derivatives)
......@@ -135,25 +136,25 @@ IF(CPPAD_FOUND AND BUILD_WITH_AUTODIFF_SUPPORT)
IF(CPPADCG_FOUND AND BUILD_WITH_CODEGEN_SUPPORT)
ADD_PINOCCHIO_UNIT_TEST(cppadcg-basic cppadcg)
SET_PROPERTY(TARGET cppadcg-basic PROPERTY CXX_STANDARD 11)
TARGET_LINK_LIBRARIES(cppadcg-basic ${CMAKE_DL_LIBS})
SET_PROPERTY(TARGET cppadcg-basic-test PROPERTY CXX_STANDARD 11)
TARGET_LINK_LIBRARIES(cppadcg-basic-test ${CMAKE_DL_LIBS})
ADD_PINOCCHIO_UNIT_TEST(cppadcg-algo cppadcg)
SET_PROPERTY(TARGET cppadcg-algo PROPERTY CXX_STANDARD 11)
TARGET_LINK_LIBRARIES(cppadcg-algo ${CMAKE_DL_LIBS})
SET_PROPERTY(TARGET cppadcg-algo-test PROPERTY CXX_STANDARD 11)
TARGET_LINK_LIBRARIES(cppadcg-algo-test ${CMAKE_DL_LIBS})
ENDIF(CPPADCG_FOUND AND BUILD_WITH_CODEGEN_SUPPORT)
ENDIF(CPPAD_FOUND AND BUILD_WITH_AUTODIFF_SUPPORT)
IF(CASADI_FOUND AND BUILD_WITH_CASADI_SUPPORT)
ADD_PINOCCHIO_UNIT_TEST(casadi-basic casadi)
SET_PROPERTY(TARGET casadi-basic PROPERTY CXX_STANDARD 11)
SET_PROPERTY(TARGET casadi-basic-test PROPERTY CXX_STANDARD 11)
ADD_PINOCCHIO_UNIT_TEST(casadi-spatial casadi)
SET_PROPERTY(TARGET casadi-spatial PROPERTY CXX_STANDARD 11)
SET_PROPERTY(TARGET casadi-spatial-test PROPERTY CXX_STANDARD 11)
ADD_PINOCCHIO_UNIT_TEST(casadi-joints casadi)
SET_PROPERTY(TARGET casadi-joints PROPERTY CXX_STANDARD 11)
SET_PROPERTY(TARGET casadi-joints-test PROPERTY CXX_STANDARD 11)
ADD_PINOCCHIO_UNIT_TEST(casadi-algo casadi)
SET_PROPERTY(TARGET casadi-algo PROPERTY CXX_STANDARD 11)
SET_PROPERTY(TARGET casadi-algo-test PROPERTY CXX_STANDARD 11)
ADD_PINOCCHIO_UNIT_TEST(casadi-algo-derivatives casadi)
SET_PROPERTY(TARGET casadi-algo-derivatives PROPERTY CXX_STANDARD 11)
SET_PROPERTY(TARGET casadi-algo-derivatives-test PROPERTY CXX_STANDARD 11)
ENDIF(CASADI_FOUND AND BUILD_WITH_CASADI_SUPPORT)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment