2012-06-10 04:15:44 +08:00
|
|
|
# Build a library of example domains, just for tests
|
|
|
|
file(GLOB test_lib_srcs "*.cpp")
|
|
|
|
file(GLOB test_srcs "test*.cpp")
|
|
|
|
file(GLOB time_srcs "time*.cpp")
|
|
|
|
list(REMOVE_ITEM test_lib_srcs ${test_srcs})
|
|
|
|
list(REMOVE_ITEM test_lib_srcs ${time_srcs})
|
|
|
|
add_library(test_lib STATIC ${test_lib_srcs})
|
|
|
|
|
|
|
|
# Assemble local libraries
|
2012-03-30 02:57:31 +08:00
|
|
|
set(tests_local_libs
|
2012-06-10 04:15:44 +08:00
|
|
|
test_lib
|
2012-03-30 02:57:31 +08:00
|
|
|
slam
|
|
|
|
nonlinear
|
|
|
|
linear
|
2012-05-18 00:33:51 +08:00
|
|
|
discrete
|
2012-03-30 02:57:31 +08:00
|
|
|
inference
|
|
|
|
geometry
|
|
|
|
base
|
2012-04-24 22:01:42 +08:00
|
|
|
ccolamd
|
|
|
|
CppUnitLite)
|
2012-02-01 03:59:19 +08:00
|
|
|
|
2012-02-12 06:38:53 +08:00
|
|
|
# exclude certain files
|
|
|
|
# note the source dir on each
|
|
|
|
set (tests_exclude
|
2012-05-22 04:54:40 +08:00
|
|
|
#"${CMAKE_CURRENT_SOURCE_DIR}/testOccupancyGrid.cpp"
|
2012-02-12 06:38:53 +08:00
|
|
|
)
|
|
|
|
|
2011-12-14 10:24:21 +08:00
|
|
|
# Build tests
|
2012-02-01 03:59:15 +08:00
|
|
|
if (GTSAM_BUILD_TESTS)
|
2012-03-30 02:57:31 +08:00
|
|
|
# Subdirectory target for tests
|
2012-02-01 03:59:15 +08:00
|
|
|
add_custom_target(check.tests COMMAND ${CMAKE_CTEST_COMMAND})
|
2012-03-30 02:57:31 +08:00
|
|
|
set(is_test TRUE)
|
|
|
|
|
|
|
|
# Build grouped tests
|
|
|
|
gtsam_add_grouped_scripts("tests" # Use subdirectory as group label
|
|
|
|
"test*.cpp" check "Test" # Standard for all tests
|
2012-06-10 04:15:44 +08:00
|
|
|
"${tests_local_libs}" "gtsam-static;CppUnitLite;test_lib" "${tests_exclude}" # Pass in linking and exclusion lists
|
2012-03-30 02:57:31 +08:00
|
|
|
${is_test}) # Set all as tests
|
2012-02-01 03:59:15 +08:00
|
|
|
endif (GTSAM_BUILD_TESTS)
|
2011-12-14 10:24:21 +08:00
|
|
|
|
|
|
|
# Build timing scripts
|
2012-02-01 03:59:15 +08:00
|
|
|
if (GTSAM_BUILD_TIMING)
|
2012-03-30 02:57:31 +08:00
|
|
|
# Subdirectory target for timing - does not actually execute the scripts
|
2012-02-01 03:59:15 +08:00
|
|
|
add_custom_target(timing.tests)
|
2012-03-30 02:57:31 +08:00
|
|
|
set(is_test FALSE)
|
|
|
|
|
|
|
|
# Build grouped benchmarks
|
|
|
|
gtsam_add_grouped_scripts("tests" # Use subdirectory as group label
|
|
|
|
"time*.cpp" timing "Timing Benchmark" # Standard for all timing scripts
|
2012-06-10 04:15:44 +08:00
|
|
|
"${tests_local_libs}" "gtsam-static;CppUnitLite;test_lib" "${tests_exclude}" # Pass in linking and exclusion lists
|
2012-04-24 22:01:42 +08:00
|
|
|
${is_test})
|
2012-02-01 03:59:15 +08:00
|
|
|
endif (GTSAM_BUILD_TIMING)
|