2012-01-31 13:28:00 +08:00
|
|
|
# Convenience targets
|
|
|
|
|
add_custom_target(check.tests COMMAND ${CMAKE_CTEST_COMMAND})
|
|
|
|
|
add_custom_target(timing.tests)
|
2011-12-14 10:24:21 +08:00
|
|
|
|
2012-01-31 13:28:00 +08:00
|
|
|
set(tests_local_libs
|
|
|
|
|
slam
|
|
|
|
|
nonlinear
|
|
|
|
|
linear
|
|
|
|
|
inference
|
|
|
|
|
geometry
|
|
|
|
|
base
|
|
|
|
|
ccolamd
|
|
|
|
|
CppUnitLite
|
|
|
|
|
${Boost_LIBRARIES}
|
|
|
|
|
)
|
2011-12-14 10:24:21 +08:00
|
|
|
|
|
|
|
|
# Build tests
|
|
|
|
|
file(GLOB tests_srcs "test*.cpp")
|
|
|
|
|
foreach(test_src ${tests_srcs})
|
|
|
|
|
get_filename_component(test_base ${test_src} NAME_WE)
|
2012-01-31 13:28:00 +08:00
|
|
|
set( test_bin tests.${test_base} )
|
|
|
|
|
message(STATUS "Adding Test ${test_bin}")
|
|
|
|
|
add_executable(${test_bin} ${test_src})
|
|
|
|
|
add_dependencies(check.tests ${test_bin})
|
2011-12-14 10:24:23 +08:00
|
|
|
add_dependencies(check ${test_bin})
|
2012-01-31 13:28:00 +08:00
|
|
|
add_test(${test_base} ${EXECUTABLE_OUTPUT_PATH}${test_bin})
|
|
|
|
|
target_link_libraries(${test_bin} ${tests_local_libs})
|
|
|
|
|
add_custom_target(${test_bin}.run ${EXECUTABLE_OUTPUT_PATH}${test_bin} ${ARGN})
|
2011-12-14 10:24:21 +08:00
|
|
|
endforeach(test_src)
|
|
|
|
|
|
|
|
|
|
# Build timing scripts
|
2012-01-31 13:28:00 +08:00
|
|
|
file(GLOB timing_srcs "time*.cpp")
|
|
|
|
|
foreach(time_src ${timing_srcs})
|
2011-12-14 10:24:21 +08:00
|
|
|
get_filename_component(time_base ${time_src} NAME_WE)
|
2012-01-31 13:28:00 +08:00
|
|
|
set( time_bin tests.${time_base} )
|
|
|
|
|
message(STATUS "Adding Timing Benchmark ${time_bin}")
|
|
|
|
|
add_executable(${time_bin} ${time_src})
|
|
|
|
|
add_dependencies(timing.tests ${time_bin})
|
2011-12-16 00:17:58 +08:00
|
|
|
add_dependencies(timing ${time_bin})
|
2012-01-31 13:28:00 +08:00
|
|
|
target_link_libraries(${time_bin} ${tests_local_libs})
|
|
|
|
|
add_custom_target(${time_bin}.run ${EXECUTABLE_OUTPUT_PATH}${time_bin} ${ARGN})
|
|
|
|
|
endforeach(time_src)
|
|
|
|
|
|