From 5dd461c5b1badcd3bdb6fd5159304bdfa73a8e6d Mon Sep 17 00:00:00 2001 From: Alex Cunningham Date: Wed, 14 Dec 2011 02:24:23 +0000 Subject: [PATCH] Added make check equivalent --- .cproject | 293 +++++++++++++++++++++++-------------------- CMakeLists.txt | 12 +- gtsam/CMakeLists.txt | 21 ++-- tests/CMakeLists.txt | 10 +- wrap/CMakeLists.txt | 3 +- 5 files changed, 180 insertions(+), 159 deletions(-) diff --git a/.cproject b/.cproject index 6fc7d8f1f..a456f1ab6 100644 --- a/.cproject +++ b/.cproject @@ -378,6 +378,14 @@ true true + + make + -j2 + testGaussianFactor.run + true + true + true + make -j2 @@ -404,7 +412,6 @@ make - tests/testBayesTree.run true false @@ -412,7 +419,6 @@ make - testBinaryBayesNet.run true false @@ -460,7 +466,6 @@ make - testSymbolicBayesNet.run true false @@ -468,7 +473,6 @@ make - tests/testSymbolicFactor.run true false @@ -476,7 +480,6 @@ make - testSymbolicFactorGraph.run true false @@ -492,20 +495,11 @@ make - tests/testBayesTree true false true - - make - -j2 - testGaussianFactor.run - true - true - true - make -j2 @@ -532,6 +526,7 @@ make + testGraph.run true false @@ -603,6 +598,7 @@ make + testInference.run true false @@ -610,6 +606,7 @@ make + testGaussianFactor.run true false @@ -617,6 +614,7 @@ make + testJunctionTree.run true false @@ -624,6 +622,7 @@ make + testSymbolicBayesNet.run true false @@ -631,6 +630,7 @@ make + testSymbolicFactorGraph.run true false @@ -700,22 +700,6 @@ false true - - make - -j2 - tests/testPose2.run - true - true - true - - - make - -j2 - tests/testPose3.run - true - true - true - make -j2 @@ -732,6 +716,22 @@ true true + + make + -j2 + tests/testPose2.run + true + true + true + + + make + -j2 + tests/testPose3.run + true + true + true + make -j2 @@ -756,15 +756,7 @@ true true - - make - -j2 - all - true - true - true - - + make -j2 check @@ -772,14 +764,6 @@ true true - - make - -j2 - clean - true - true - true - make -j2 @@ -820,7 +804,15 @@ true true - + + make + -j2 + all + true + true + true + + make -j2 check @@ -828,6 +820,14 @@ true true + + make + -j2 + clean + true + true + true + make -j2 @@ -1150,7 +1150,6 @@ make - testErrors.run true false @@ -1558,6 +1557,7 @@ make + testSimulated2DOriented.run true false @@ -1597,6 +1597,7 @@ make + testSimulated2D.run true false @@ -1604,6 +1605,7 @@ make + testSimulated3D.run true false @@ -1672,6 +1674,22 @@ true true + + make + -j2 + check + true + true + true + + + make + -j5 + check + true + false + true + make -j2 @@ -1906,6 +1924,7 @@ make + tests/testGaussianISAM2 true false @@ -1927,46 +1946,6 @@ true true - - make - -j2 - install - true - true - true - - - make - -j2 - clean - true - true - true - - - make - -j2 - check - true - true - true - - - make - -j2 - all - true - true - true - - - make - -j2 - dist - true - true - true - make -j2 @@ -2063,6 +2042,94 @@ true true + + make + -j2 + install + true + true + true + + + make + -j2 + clean + true + true + true + + + make + -j2 + check + true + true + true + + + make + -j2 + all + true + true + true + + + make + -j2 + dist + true + true + true + + + make + -j2 + check + true + true + true + + + make + -j2 + install + true + true + true + + + make + -j2 + tests/testSpirit.run + true + true + true + + + make + -j2 + tests/testWrap.run + true + true + true + + + make + -j2 + clean + true + true + true + + + make + -j2 + all + true + true + true + make -j2 @@ -2119,54 +2186,6 @@ false true - - make - -j2 - check - true - true - true - - - make - -j2 - install - true - true - true - - - make - -j2 - tests/testSpirit.run - true - true - true - - - make - -j2 - tests/testWrap.run - true - true - true - - - make - -j2 - clean - true - true - true - - - make - -j2 - all - true - true - true - diff --git a/CMakeLists.txt b/CMakeLists.txt index 3450ceccb..408e0c6bd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,8 +1,10 @@ project(GTSAM CXX C) +cmake_minimum_required(VERSION 2.6) + +# Set the version number for the libarary set (GTSAM_VERSION_MAJOR 0) set (GTSAM_VERSION_MINOR 9) set (GTSAM_VERSION_PATCH 3) -cmake_minimum_required(VERSION 2.6) # guard against in-source builds if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR}) @@ -23,8 +25,12 @@ set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -DEIGEN_NO_DEBUG") # Pull in tests -ENABLE_TESTING() -INCLUDE(Dart) +enable_testing() +include(Dart) +include(CTest) + +# Enable make check (http://www.cmake.org/Wiki/CMakeEmulateMakeCheck) +add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND}) # Find boost find_package(Boost 1.40 REQUIRED) diff --git a/gtsam/CMakeLists.txt b/gtsam/CMakeLists.txt index efd0ad18f..0a027dfda 100644 --- a/gtsam/CMakeLists.txt +++ b/gtsam/CMakeLists.txt @@ -7,12 +7,6 @@ set (gtsam_subdirs linear nonlinear slam) - -# Include CCOLAMD source directly into gtsam -#include_directories( -# 3rdparty/UFconfig -# 3rdparty/CCOLAMD/Include -# ${CMAKE_SOURCE_DIR}) set (ccolamd_srcs 3rdparty/CCOLAMD/Source/ccolamd.c @@ -21,8 +15,9 @@ set (ccolamd_srcs set(gtsam_srcs ${ccolamd_srcs}) -add_library(ccolamd STATIC ${ccolamd_srcs}) -list(APPEND inner_libs ccolamd) +# ccolamd convenience library +#add_library(ccolamd STATIC ${ccolamd_srcs}) +#list(APPEND inner_libs ccolamd) # Get all sources and headers from each foreach(subdir ${gtsam_subdirs}) @@ -31,8 +26,8 @@ foreach(subdir ${gtsam_subdirs}) list(APPEND gtsam_srcs ${sub_gtsam_srcs}) # Make a convenience library - add_library(${subdir} STATIC ${sub_gtsam_srcs}) - list(APPEND inner_libs ${subdir}) + # add_library(${subdir} STATIC ${sub_gtsam_srcs}) + # list(APPEND inner_libs ${subdir}) # Build tests file(GLOB tests_srcs "${subdir}/tests/test*.cpp") @@ -41,7 +36,8 @@ foreach(subdir ${gtsam_subdirs}) # Trying to put the executables in the right place #set( test_bin ${EXECUTABLE_OUTPUT_PATH}${subdir}/${test_base} ) set( test_bin ${subdir}_${test_base} ) - add_executable(${test_bin} ${test_src}) + add_executable(${test_bin} EXCLUDE_FROM_ALL ${test_src}) + add_dependencies(check ${test_bin}) add_test(${subdir}/${test_base} ${EXECUTABLE_OUTPUT_PATH}${test_bin}) #Linking: would like to link against subset of convenience libraries @@ -55,7 +51,8 @@ foreach(subdir ${gtsam_subdirs}) foreach(time_src ${time_srcs}) get_filename_component(time_base ${time_src} NAME_WE) set( time_bin ${time_base} ) - add_executable(${time_bin} ${time_src}) + add_executable(${time_bin} EXCLUDE_FROM_ALL ${time_src}) + add_dependencies(check ${time_bin}) target_link_libraries(${time_bin} CppUnitLite gtsam) add_custom_target(${time_base}.run ${EXECUTABLE_OUTPUT_PATH}${time_bin} ${ARGN}) endforeach(time_src) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index cda7b1aa3..96f101f5c 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -9,11 +9,10 @@ find_package(Boost COMPONENTS serialization REQUIRED) file(GLOB tests_srcs "test*.cpp") foreach(test_src ${tests_srcs}) get_filename_component(test_base ${test_src} NAME_WE) - # Trying to put the executables in the right place set( test_bin ${test_base} ) - add_executable(${test_bin} ${test_src}) + add_executable(${test_bin} EXCLUDE_FROM_ALL ${test_src}) + add_dependencies(check ${test_bin}) add_test(${test_bin} ${EXECUTABLE_OUTPUT_PATH}${test_bin}) - target_link_libraries(${test_bin} CppUnitLite gtsam ${Boost_SERIALIZATION_LIBRARY}) add_custom_target(${test_base}.run ${EXECUTABLE_OUTPUT_PATH}${test_bin} ${ARGN}) endforeach(test_src) @@ -22,10 +21,9 @@ endforeach(test_src) file(GLOB time_srcs "time*.cpp") foreach(time_src ${time_srcs}) get_filename_component(time_base ${time_src} NAME_WE) - # Trying to put the executables in the right place set( time_bin ${time_base} ) - add_executable(${time_bin} ${time_src}) - + add_executable(${time_bin} EXCLUDE_FROM_ALL ${time_src}) + add_dependencies(check ${time_bin}) target_link_libraries(${time_bin} CppUnitLite gtsam) add_custom_target(${time_base}.run ${EXECUTABLE_OUTPUT_PATH}${time_bin} ${ARGN}) endforeach(time_src) \ No newline at end of file diff --git a/wrap/CMakeLists.txt b/wrap/CMakeLists.txt index b357481bf..c28a1e006 100644 --- a/wrap/CMakeLists.txt +++ b/wrap/CMakeLists.txt @@ -13,8 +13,9 @@ add_definitions(-DTOPSRCDIR="${CMAKE_SOURCE_DIR}") foreach(test_src ${wrap_test_srcs} ) get_filename_component(test_base ${test_src} NAME_WE) set( test_bin wrap_${test_base} ) - add_executable(${test_bin} ${test_src}) + add_executable(${test_bin} EXCLUDE_FROM_ALL ${test_src}) add_test(${test_base} ${EXECUTABLE_OUTPUT_PATH}${test_bin}) + add_dependencies(check ${test_bin}) target_link_libraries(${test_bin} CppUnitLite gtsam wrapLib) add_custom_target(${test_bin}.run ${EXECUTABLE_OUTPUT_PATH}${test_bin} ${ARGN}) endforeach(test_src)