Add Official/Unsupported labels to unit tests and add a ctest driver to submit subprojects to cdash

This commit is contained in:
Gael Guennebaud 2013-03-20 08:40:13 +01:00
parent 11a9091084
commit 9bfeeba1c5
6 changed files with 77 additions and 4 deletions

View File

@ -311,6 +311,7 @@ add_subdirectory(Eigen)
add_subdirectory(doc EXCLUDE_FROM_ALL)
include(EigenConfigureTesting)
# fixme, not sure this line is still needed:
enable_testing() # must be called from the root CMakeLists, see man page
@ -345,6 +346,8 @@ if(NOT WIN32)
add_subdirectory(bench/spbench EXCLUDE_FROM_ALL)
endif(NOT WIN32)
configure_file(scripts/cdashtesting.cmake.in cdashtesting.cmake @ONLY)
ei_testing_print_summary()
message(STATUS "")

View File

@ -11,3 +11,7 @@ set(CTEST_DROP_METHOD "http")
set(CTEST_DROP_SITE "manao.inria.fr")
set(CTEST_DROP_LOCATION "/CDash/submit.php?project=Eigen")
set(CTEST_DROP_SITE_CDASH TRUE)
set(CTEST_PROJECT_SUBPROJECTS
Official
Unsupported
)

View File

@ -73,6 +73,14 @@ macro(ei_add_test_internal testname testname_with_suffix)
else()
add_test(${testname_with_suffix} "${targetname}")
endif()
# Specify target and test labels accoirding to EIGEN_CURRENT_SUBPROJECT
get_property(current_subproject GLOBAL PROPERTY EIGEN_CURRENT_SUBPROJECT)
if ((current_subproject) AND (NOT (current_subproject STREQUAL "")))
set_property(TARGET ${targetname} PROPERTY LABELS "Build${current_subproject}")
add_dependencies("Build${current_subproject}" ${targetname})
set_property(TEST ${testname_with_suffix} PROPERTY LABELS "${current_subproject}")
endif()
endmacro(ei_add_test_internal)
@ -263,6 +271,7 @@ macro(ei_testing_print_summary)
endmacro(ei_testing_print_summary)
macro(ei_init_testing)
define_property(GLOBAL PROPERTY EIGEN_CURRENT_SUBPROJECT BRIEF_DOCS " " FULL_DOCS " ")
define_property(GLOBAL PROPERTY EIGEN_TESTED_BACKENDS BRIEF_DOCS " " FULL_DOCS " ")
define_property(GLOBAL PROPERTY EIGEN_MISSING_BACKENDS BRIEF_DOCS " " FULL_DOCS " ")
define_property(GLOBAL PROPERTY EIGEN_TESTING_SUMMARY BRIEF_DOCS " " FULL_DOCS " ")

View File

@ -0,0 +1,49 @@
set(CTEST_SOURCE_DIRECTORY "@CMAKE_SOURCE_DIR@")
set(CTEST_BINARY_DIRECTORY "@CMAKE_BINARY_DIR@")
set(CTEST_CMAKE_GENERATOR "@CMAKE_GENERATOR@")
set(CTEST_BUILD_NAME "@BUILDNAME@")
set(CTEST_SITE "@SITE@")
set(MODEL Experimental)
if(${CTEST_SCRIPT_ARG} MATCHES Nightly)
set(MODEL Nightly)
elif(${CTEST_SCRIPT_ARG} MATCHES Continuous)
set(MODEL Continuous)
endif()
find_program(CTEST_HG_COMMAND NAMES hg)
set(CTEST_UPDATE_COMMAND "${CTEST_HG_COMMAND}")
ctest_start(${MODEL} ${CTEST_SOURCE_DIRECTORY} ${CTEST_BINARY_DIRECTORY})
ctest_update(SOURCE "${CTEST_SOURCE_DIRECTORY}")
ctest_submit(PARTS Update Notes)
# to get CTEST_PROJECT_SUBPROJECTS definition:
include("${CTEST_SOURCE_DIRECTORY}/CTestConfig.cmake")
foreach(subproject ${CTEST_PROJECT_SUBPROJECTS})
message("")
message("Process ${subproject}")
set_property(GLOBAL PROPERTY SubProject ${subproject})
set_property(GLOBAL PROPERTY Label ${subproject})
ctest_configure(BUILD ${CTEST_BINARY_DIRECTORY} SOURCE ${CTEST_SOURCE_DIRECTORY} )
ctest_submit(PARTS Configure)
set(CTEST_BUILD_TARGET "Build${subproject}")
message("Build ${CTEST_BUILD_TARGET}")
ctest_build(BUILD "${CTEST_BINARY_DIRECTORY}" APPEND)
# builds target ${CTEST_BUILD_TARGET}
ctest_submit(PARTS Build)
ctest_test(BUILD "${CTEST_BINARY_DIRECTORY}" INCLUDE_LABEL "${subproject}" )
# runs only tests that have a LABELS property matching "${subproject}"
ctest_coverage(BUILD "${CTEST_BINARY_DIRECTORY}" LABELS "${subproject}" )
ctest_submit(PARTS Test)
endforeach()

View File

@ -122,6 +122,9 @@ if(TEST_LIB)
add_definitions("-DEIGEN_EXTERN_INSTANTIATIONS=1")
endif(TEST_LIB)
set_property(GLOBAL PROPERTY EIGEN_CURRENT_SUBPROJECT "Official")
add_custom_target(BuildOfficial)
ei_add_test(meta)
ei_add_test(sizeof)
ei_add_test(dynalloc)
@ -201,9 +204,6 @@ ei_add_test(stdvector_overload)
ei_add_test(stdlist)
ei_add_test(stddeque)
ei_add_test(resize)
if(QT4_FOUND)
ei_add_test(qtvector "" "${QT_QTCORE_LIBRARY}")
endif(QT4_FOUND)
ei_add_test(sparse_vector)
ei_add_test(sparse_basic)
ei_add_test(sparse_product)
@ -214,7 +214,6 @@ ei_add_test(swap)
ei_add_test(conservative_resize)
ei_add_test(permutationmatrices)
ei_add_test(sparse_permutations)
ei_add_test(eigen2support)
ei_add_test(nullary)
ei_add_test(nesting_ops "${CMAKE_CXX_FLAGS_DEBUG}")
ei_add_test(zerosized)
@ -232,6 +231,12 @@ ei_add_test(sparseqr)
# ei_add_test(denseLM)
if(QT4_FOUND)
ei_add_test(qtvector "" "${QT_QTCORE_LIBRARY}")
endif(QT4_FOUND)
ei_add_test(eigen2support)
if(UMFPACK_FOUND)
ei_add_test(umfpack_support "" "${UMFPACK_ALL_LIBS}")
endif()

View File

@ -1,4 +1,7 @@
set_property(GLOBAL PROPERTY EIGEN_CURRENT_SUBPROJECT "Unsupported")
add_custom_target(BuildUnsupported)
include_directories(../../test ../../unsupported ../../Eigen
${CMAKE_CURRENT_BINARY_DIR}/../../test)