CMakeLists.txt 2.71 KB
Newer Older
1
# Copyright 2010, 2020, François Bleibel, Olivier Stasse, Guilhem Saurel, JRL, CNRS/AIST, LAAS-CNRS
Thomas Moulard's avatar
Thomas Moulard committed
2

3
CONFIG_FILES_CMAKE(test-paths.h)
Francois Bleibel's avatar
Francois Bleibel committed
4

5
6
7
# Make Boost.Test generates the main function in test cases.
ADD_DEFINITIONS(-DBOOST_TEST_DYN_LINK -DBOOST_TEST_MAIN)

8
# Definition of a macro that corresponds to the suffix for a dynamic lib
9
10
ADD_DEFINITIONS(-DTESTS_DYNLIBSUFFIX="${CMAKE_SHARED_LIBRARY_SUFFIX}")

Thomas Moulard's avatar
Thomas Moulard committed
11
12
13
14
# The sot-core plugin libraries that tests have to be linked against
# the name of the variable for test EXECUTABLE_NAME is
# TEST_${EXECUTABLE_NAME}_LIBS
SET(TEST_tsot_LIBS
15
16
17
18
  task
  feature-visual-point
  gain-adaptive
  )
19

20
SET(TEST_test_traces_EXT_LIBS dynamic-graph::tracer)
21

22
SET(TEST_test_gain_LIBS
23
  gain-adaptive feature-visual-point)
24
25

SET(TEST_test_task_LIBS
26
  gain-adaptive feature-visual-point task)
27

28
SET(TEST_test_feature_point6d_LIBS
29
  gain-adaptive feature-point6d task)
30
31

SET(TEST_test_feature_generic_LIBS
32
  gain-adaptive feature-generic task feature-pose)
33

Francois Bleibel's avatar
Francois Bleibel committed
34
SET(TEST_test_mailbox_LIBS
35
  mailbox-vector)
Francois Bleibel's avatar
Francois Bleibel committed
36

37
SET(TEST_test_control_pd_LIBS
38
  control-pd)
39

40
41
42
SET(TEST_test_control_admittance_LIBS
  admittance-control-op-point)

43
44
SET(TEST_test_feature_generic_EXT_LIBS
  pinocchio::pinocchio)
45

46
47
SET(TEST_test_device_EXT_LIBS
  pinocchio::pinocchio)
48

49
SET(TEST_test_filter_differentiator_LIBS
50
  filter-differentiator)
Olivier Stasse's avatar
Olivier Stasse committed
51
52

SET(TEST_test_madgwick_ahrs_LIBS
53
  madgwickahrs)
Olivier Stasse's avatar
Olivier Stasse committed
54

55

Guilhem Saurel's avatar
Guilhem Saurel committed
56
SET(tests
57
  dummy
Thomas Moulard's avatar
Thomas Moulard committed
58

59
  control/test_control_pd
60
  control/test_control_admittance
Thomas Moulard's avatar
Thomas Moulard committed
61

62
63
  features/test_feature_point6d
  features/test_feature_generic
64

65
  filters/test_filter_differentiator
Olivier Stasse's avatar
Olivier Stasse committed
66
  filters/test_madgwick_ahrs
67

68
69
70
71
72
  signal/test_signal
  signal/test_depend
  signal/test_ptr
  signal/test_dep
  signal/test_ptrcast
Thomas Moulard's avatar
Thomas Moulard committed
73

74
  sot/tsot
Thomas Moulard's avatar
Thomas Moulard committed
75

76
77
  traces/files
  traces/test_traces
78

79
80
81
82
83
84
  task/test_flags
  task/test_gain
  task/test_multi_bound
  task/test_task

  tools/test_boost
85
  tools/test_device
86
87
88
89
90
91
92
93
94
  tools/test_mailbox
  tools/test_matrix
  tools/test_robot_utils

  math/matrix-twist
  math/matrix-homogeneous

  matrix/test_operator
  )
Francois Bleibel's avatar
Francois Bleibel committed
95

96
97
# TODO
IF(WIN32)
98
  LIST(REMOVE_ITEM tests tools/test_mailbox)
99
100
ENDIF(WIN32)

101
IF(UNIX)
102
  ADD_LIBRARY(pluginabstract SHARED tools/plugin.cc)
103

104
  ADD_EXECUTABLE(test_abstract_interface tools/test_abstract_interface.cpp)
105
106
107
  TARGET_LINK_LIBRARIES(test_abstract_interface PRIVATE
    Boost::program_options
    pluginabstract ${CMAKE_DL_LIBS})
108
109
ENDIF(UNIX)

110
111
112
FOREACH(path ${tests})
  GET_FILENAME_COMPONENT(test ${path} NAME)
  ADD_UNIT_TEST(${test} ${path}.cpp)
113

114
115
116
  TARGET_LINK_LIBRARIES(${test} PRIVATE ${PROJECT_NAME}
    Boost::unit_test_framework
    ${TEST_${test}_LIBS} ${TEST_${test}_EXT_LIBS})
117

Guilhem Saurel's avatar
Guilhem Saurel committed
118
  IF(UNIX)
119
    TARGET_LINK_LIBRARIES(${test} PRIVATE ${CMAKE_DL_LIBS})
120
  ENDIF(UNIX)
121
ENDFOREACH(path ${tests})
122
123
124
125

IF(BUILD_PYTHON_INTERFACE)
  ADD_SUBDIRECTORY(python)
ENDIF(BUILD_PYTHON_INTERFACE)