diff options
author | Adrian Negreanu <adrian.m.negreanu@intel.com> | 2015-05-15 14:30:11 (GMT) |
---|---|---|
committer | Adrian Negreanu <adrian.m.negreanu@intel.com> | 2015-05-15 16:34:41 (GMT) |
commit | 2e099b1950eee2c3a0d5d8ae4b25575caeb938b1 (patch) | |
tree | 4db52f4b6a2078ede1554bf586d012eb8d58be4f /testing/CMakeLists.txt | |
parent | ac576bd974ac27bc1f395e8ae6c77b19f800b6db (diff) | |
download | Doxygen-2e099b1950eee2c3a0d5d8ae4b25575caeb938b1.zip Doxygen-2e099b1950eee2c3a0d5d8ae4b25575caeb938b1.tar.gz Doxygen-2e099b1950eee2c3a0d5d8ae4b25575caeb938b1.tar.bz2 |
use cmake
runtest.pl replaced by testing/test_driver.cmake
version.py replaced by cmake/version.cmake
lang_cfg.py replaced by cmake/lang_cfg.cmake
settings.py implemented in src/CMakeLists.txt
increasebuffer.py replaced by defining the YY_BUF_SIZE and YY_READ_BUF_SIZE
Signed-off-by: Adrian Negreanu <adrian.m.negreanu@intel.com>
Diffstat (limited to 'testing/CMakeLists.txt')
-rw-r--r-- | testing/CMakeLists.txt | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/testing/CMakeLists.txt b/testing/CMakeLists.txt new file mode 100644 index 0000000..cb9479d --- /dev/null +++ b/testing/CMakeLists.txt @@ -0,0 +1,60 @@ +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) + + # 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() |