From 036a78e9907d6e66ce0d6fd17a928b250238b31b Mon Sep 17 00:00:00 2001 From: Kornel Benko Date: Fri, 23 Aug 2013 20:25:24 +0200 Subject: [PATCH] Cmake tests: Allow for comments in control files Files, which contain names of ctest-tests controling whether they should be inverted, or ignored. We have two such files ATM: revertedTests + ignoredTests --- development/autotests/CMakeLists.txt | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/development/autotests/CMakeLists.txt b/development/autotests/CMakeLists.txt index 25713c6b22..293d764c46 100644 --- a/development/autotests/CMakeLists.txt +++ b/development/autotests/CMakeLists.txt @@ -129,6 +129,21 @@ macro(getreverted testname reverted listreverted) endif() endmacro() +macro(loadTestList filename resList) + # Create list of strings from a file without comments + file(STRINGS ${filename} tempList) + set(${resList}) + foreach(_l ${tempList}) + string(REGEX REPLACE "[ \t]*#.*" "" _newl "${_l}") + if(_newl) + list(APPEND ${resList} "${_newl}") + endif() + endforeach() +endmacro() + +loadTestList(revertedTests revertedTests) +loadTestList(ignoredTests ignoredTests) + foreach(libsubfolder doc examples templates) set(LIBSUB_SRC_DIR "${TOP_SRC_DIR}/lib/${libsubfolder}") file(GLOB_RECURSE lyx_files RELATIVE "${LIBSUB_SRC_DIR}" "${LIBSUB_SRC_DIR}/*.lyx") @@ -144,8 +159,6 @@ foreach(libsubfolder doc examples templates) list(APPEND nolang_lyx_files ${f}) endif() endforeach() - file(STRINGS "${CMAKE_CURRENT_SOURCE_DIR}/revertedTests" revertedTests) - file(STRINGS "${CMAKE_CURRENT_SOURCE_DIR}/ignoredTests" ignoredTests) foreach(f ${nolang_lyx_files} ${lang_lyx_files}) # Strip extension string(REGEX REPLACE "\\.lyx$" "" f ${f}) -- 2.39.5