]> git.lyx.org Git - lyx.git/commitdiff
Cmake tests: Allow for comments in control files
authorKornel Benko <kornel@amd64.local>
Fri, 23 Aug 2013 18:25:24 +0000 (20:25 +0200)
committerKornel Benko <kornel@amd64.local>
Fri, 23 Aug 2013 18:25:24 +0000 (20:25 +0200)
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

index 25713c6b22509b81c09a98fceaa992e70a195c48..293d764c46f3941f33ac00f61f665f32f657f748 100644 (file)
@@ -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})