From c259cd96e4754e9249100837f106bd11d2e8265c Mon Sep 17 00:00:00 2001 From: Matthias Maier Date: Sun, 15 Sep 2013 12:45:12 +0000 Subject: [PATCH] Port the build tests to ctest as well git-svn-id: https://svn.dealii.org/branches/branch_port_the_testsuite@30711 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/CMakeLists.txt | 3 ++- deal.II/cmake/scripts/run_test.cmake | 26 ++++++++++++++++--- deal.II/examples/step-1/step-1.cc | 1 - .../CMakeLists.txt | 0 .../threads/affinity.cc | 0 tests/CMakeLists.txt | 11 +++++--- tests/all-headers/CMakeLists.txt | 18 ++++++------- 7 files changed, 41 insertions(+), 18 deletions(-) rename deal.II/{build_tests => quick_tests}/CMakeLists.txt (100%) rename deal.II/{build_tests => quick_tests}/threads/affinity.cc (100%) diff --git a/deal.II/CMakeLists.txt b/deal.II/CMakeLists.txt index 7dcd959cf0..9d92608c0b 100644 --- a/deal.II/CMakeLists.txt +++ b/deal.II/CMakeLists.txt @@ -147,7 +147,8 @@ ADD_SUBDIRECTORY(cmake/config) # has to be included after source ADD_SUBDIRECTORY(contrib) # has to be included after source ADD_SUBDIRECTORY(examples) -ADD_SUBDIRECTORY(build_tests) +ADD_SUBDIRECTORY(quick_tests) + IF(BUILD_TESTING AND DEAL_II_HAVE_TESTS_DIRECTORY) ADD_SUBDIRECTORY(${TEST_DIR} ${CMAKE_BINARY_DIR}/tests) ENDIF() diff --git a/deal.II/cmake/scripts/run_test.cmake b/deal.II/cmake/scripts/run_test.cmake index 5f89255073..1955519fdf 100644 --- a/deal.II/cmake/scripts/run_test.cmake +++ b/deal.II/cmake/scripts/run_test.cmake @@ -16,25 +16,42 @@ IF("${_result_code}" STREQUAL "0") MESSAGE("Test ${TEST}: PASSED") MESSAGE("=============================== OUTPUT BEGIN ===============================") + # # Do not output everything, just that we are successful: - IF(TRGT MATCHES "\\.diff$") + # + IF(TRGT MATCHES "\\.diff$") # ordinary test: MESSAGE("${TEST}: BUILD successful.") MESSAGE("${TEST}: RUN successful.") MESSAGE("${TEST}: DIFF successful.") MESSAGE("${TEST}: PASSED.") - ELSE() + ELSEIF(TRGT MATCHES "\\.run$") # build_test for steps: + MESSAGE("${TEST}: CONFIGURE successful.") + MESSAGE("${TEST}: BUILD successful.") + MESSAGE("${TEST}: RUN successful.") + MESSAGE("${TEST}: PASSED.") + ELSEIF(TRGT MATCHES "\\.build$") # build_test for steps: + MESSAGE("${TEST}: CONFIGURE successful.") + MESSAGE("${TEST}: BUILD successful.") + MESSAGE("${TEST}: PASSED.") + ELSE() # all-headers test: MESSAGE("${TEST}: BUILD successful.") MESSAGE("${TEST}: PASSED.") ENDIF() MESSAGE("=============================== OUTPUT END ===============================") ELSE() + # - # Determine whether the BUILD or RUN stages were run successfully: + # Determine whether the CONFIGURE, BUILD or RUN stages were run successfully: # + + # configure is special because it only exists in build tests: + STRING(REGEX MATCH "${TEST}: CONFIGURE failed\\." _configure_regex ${_output}) STRING(REGEX MATCH "${TEST}: BUILD successful\\." _build_regex ${_output}) STRING(REGEX MATCH "${TEST}: RUN successful\\." _run_regex ${_output}) - IF("${_build_regex}" STREQUAL "") + IF(NOT "${_configure_regex}" STREQUAL "") + SET(_stage CONFIGURE) + ELSEIF("${_build_regex}" STREQUAL "") SET(_stage BUILD) ELSEIF("${_run_regex}" STREQUAL "") SET(_stage RUN) @@ -42,6 +59,7 @@ ELSE() SET(_stage DIFF) ENDIF() + MESSAGE("Test ${TEST}: ${_stage}") MESSAGE("=============================== OUTPUT BEGIN ===============================") IF("${_build_regex}" STREQUAL "") diff --git a/deal.II/examples/step-1/step-1.cc b/deal.II/examples/step-1/step-1.cc index 09599c7935..96da272b2b 100644 --- a/deal.II/examples/step-1/step-1.cc +++ b/deal.II/examples/step-1/step-1.cc @@ -16,7 +16,6 @@ */ - // @sect3{Include files} // The most fundamental class in the library is the Triangulation class, which diff --git a/deal.II/build_tests/CMakeLists.txt b/deal.II/quick_tests/CMakeLists.txt similarity index 100% rename from deal.II/build_tests/CMakeLists.txt rename to deal.II/quick_tests/CMakeLists.txt diff --git a/deal.II/build_tests/threads/affinity.cc b/deal.II/quick_tests/threads/affinity.cc similarity index 100% rename from deal.II/build_tests/threads/affinity.cc rename to deal.II/quick_tests/threads/affinity.cc diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 18fa3125ef..f40ded87ce 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -15,19 +15,23 @@ ## --------------------------------------------------------------------- # -# Setup and run the testsuite: +# Setup the testsuite: # - INCLUDE(setup_testsuite) +# +# And include all subdirectories: +# MESSAGE(STATUS "") MESSAGE(STATUS "Proceed to test definitions now:") -ADD_SUBDIRECTORY(a-framework) +#ADD_SUBDIRECTORY(a-framework) -- no idea what to do with that ... + ADD_SUBDIRECTORY(all-headers) ADD_SUBDIRECTORY(aniso) ADD_SUBDIRECTORY(base) ADD_SUBDIRECTORY(bits) +ADD_SUBDIRECTORY(build_tests) ADD_SUBDIRECTORY(codim_one) ADD_SUBDIRECTORY(deal.II) @@ -53,6 +57,7 @@ IF(DEAL_II_WITH_METIS) ADD_SUBDIRECTORY(metis) ENDIF() +# TODO: Really with P4EST? IF(DEAL_II_WITH_MPI AND DEAL_II_WITH_P4EST) ADD_SUBDIRECTORY(gla) ADD_SUBDIRECTORY(mpi) diff --git a/tests/all-headers/CMakeLists.txt b/tests/all-headers/CMakeLists.txt index 5ab714797b..d525a5286e 100644 --- a/tests/all-headers/CMakeLists.txt +++ b/tests/all-headers/CMakeLists.txt @@ -42,8 +42,8 @@ FOREACH(_full_file ${_header}) FOREACH(_build ${DEAL_II_BUILD_TYPES}) STRING(TOLOWER ${_build} _build_lowercase) - SET(_test ${_category}-${_path}-${_file}.${_build_lowercase}) - + SET(_test ${_category}/${_path}/${_file}.${_build_lowercase}) + SET(_target ${_category}-${_path}-${_file}.${_build_lowercase}) # # Respect TEST_PICKUP_REGEX: # @@ -53,18 +53,18 @@ FOREACH(_full_file ${_header}) # # Add an object library for each header file and build configuration: # - ADD_LIBRARY(${_test} OBJECT EXCLUDE_FROM_ALL test_header.cc) - SET_TARGET_PROPERTIES(${_test} PROPERTIES + ADD_LIBRARY(${_target} OBJECT EXCLUDE_FROM_ALL test_header.cc) + SET_TARGET_PROPERTIES(${_target} PROPERTIES COMPILE_DEFINITIONS "${DEAL_II_DEFINITIONS};${DEAL_II_DEFINITIONS_${_build}}" COMPILE_FLAGS "${DEAL_II_CXX_FLAGS_${_build}}" ) - SET_PROPERTY(TARGET ${_test} APPEND PROPERTY + SET_PROPERTY(TARGET ${_target} APPEND PROPERTY INCLUDE_DIRECTORIES "${CMAKE_BINARY_DIR}/include" "${CMAKE_SOURCE_DIR}/include" "${CMAKE_SOURCE_DIR}/include/deal.II/" ) - SET_PROPERTY(TARGET ${_test} APPEND PROPERTY + SET_PROPERTY(TARGET ${_target} APPEND PROPERTY COMPILE_DEFINITIONS HEADER= ) @@ -72,15 +72,15 @@ FOREACH(_full_file ${_header}) # # And finally add the test: # - ADD_TEST(NAME ${_category}/${_path}/${_file}.${_build_lowercase} + ADD_TEST(NAME ${_test} COMMAND ${CMAKE_COMMAND} - -DTRGT=${_test} + -DTRGT=${_target} -DTEST=${_category}/${_path}/${_file}.${_build_lowercase} -DDEAL_II_BINARY_DIR=${CMAKE_BINARY_DIR} -P ${CMAKE_SOURCE_DIR}/cmake/scripts/run_test.cmake WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} ) - SET_TESTS_PROPERTIES(${_category}/${_path}/${_file}.${_build_lowercase} PROPERTIES + SET_TESTS_PROPERTIES(${_test} PROPERTIES LABEL "${_category}" TIMEOUT ${TEST_TIME_LIMIT} ) -- 2.39.5