summaryrefslogtreecommitdiffstats
path: root/testing/CMakeLists.txt
diff options
context:
space:
mode:
authorDimitri van Heesch <dimitri@stack.nl>2015-05-31 07:59:01 (GMT)
committerDimitri van Heesch <dimitri@stack.nl>2015-05-31 07:59:01 (GMT)
commit635d8cf30e702bdf83fe5c96452f8f863d57bdee (patch)
treec88a62cfee260b2ff42ba00ce360d638605adf16 /testing/CMakeLists.txt
parent7bcf8e9a379ec0599160e5562f07b93f8fb9557a (diff)
downloadDoxygen-635d8cf30e702bdf83fe5c96452f8f863d57bdee.zip
Doxygen-635d8cf30e702bdf83fe5c96452f8f863d57bdee.tar.gz
Doxygen-635d8cf30e702bdf83fe5c96452f8f863d57bdee.tar.bz2
Further cmake changes
- made static build option for all windows targets - made wizard flex interactive - add 64bit support for libiconv on windows build - updated test mechanism
Diffstat (limited to 'testing/CMakeLists.txt')
-rw-r--r--testing/CMakeLists.txt61
1 files changed, 5 insertions, 56 deletions
diff --git a/testing/CMakeLists.txt b/testing/CMakeLists.txt
index cb9479d..af3ddf3 100644
--- a/testing/CMakeLists.txt
+++ b/testing/CMakeLists.txt
@@ -1,60 +1,9 @@
find_program(XMLLINT NAMES xmllint)
find_program(DIFF NAMES diff)
-file(GLOB test_files "[0-9][0-9][0-9]_*.*")
-foreach(test_file ${test_files})
- if ( ${test_file} MATCHES "([0-9][0-9][0-9])_")
- set(test_id ${CMAKE_MATCH_1})
- set(test_out ${CMAKE_BINARY_DIR}/testing/${test_id})
- get_filename_component(test_dirname ${test_file} DIRECTORY)
- get_filename_component(test_basename ${test_file} NAME)
- set(doxyfile ${test_out}/Doxyfile)
+add_custom_target(tests
+ COMMENT "Running doxygen tests..."
+ COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/testing/runtests.py --all --inputdir ${CMAKE_SOURCE_DIR}/testing --outputdir ${PROJECT_BINARY_DIR}/testing
+ DEPENDS doxygen
+)
- # setup the test directory
- execute_process(COMMAND ${CMAKE_COMMAND} -E remove_directory ${test_out})
- execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${test_out})
- execute_process(COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/testing/Doxyfile ${test_out})
- execute_process(COMMAND ${CMAKE_COMMAND} -E copy ${test_file} ${test_out})
- file(APPEND ${doxyfile} "STRIP_FROM_PATH = ${test_out}\n")
- file(APPEND ${doxyfile} "INPUT = ${test_basename}\n")
-
- # extract config lines from test files
- file(STRINGS "${test_basename}" test_file_config REGEX "// [a-z]+: .*")
-
- # clear the lists
- set(test_objective)
- set(test_config)
- set(test_check)
-
- # turn the config lines into lists
- foreach(line IN LISTS test_file_config)
- if ("${line}" MATCHES "//[ ]*([a-zA-Z]+)[ ]*:[ ]*(.*)")
- list(APPEND test_${CMAKE_MATCH_1} ${CMAKE_MATCH_2})
- endif()
- endforeach()
- foreach(line IN LISTS test_config)
- # append the config line to Doxyfile
- file(APPEND ${doxyfile} "${line}\n")
- # in case this is an INPUT line, copy the files to test directory
- if ("${line}" MATCHES "INPUT[ ]*=(.*)")
- separate_arguments(items UNIX_COMMAND "${CMAKE_MATCH_1}")
- foreach(i IN LISTS items)
- execute_process(COMMAND ${CMAKE_COMMAND} -E copy ${test_dirname}/${i} ${test_out})
- endforeach()
- endif()
- endforeach()
- # replace spaces with semicolons so it can be passed as argument
- separate_arguments(test_check UNIX_COMMAND "${test_check}")
- add_test(NAME test_${test_id}
- WORKING_DIRECTORY ${test_out}
- COMMAND cmake
- -D check=${test_check}
- -D dirname=${test_dirname}/${test_id}
- -D top=${CMAKE_SOURCE_DIR}
- -D doxygen=${EXECUTABLE_OUTPUT_PATH}/doxygen
- -D diff=${DIFF}
- -D xmllint=${XMLLINT}
- -P ${CMAKE_SOURCE_DIR}/testing/test_driver.cmake
- )
- endif()
-endforeach()