]> git.lyx.org Git - features.git/commitdiff
Cmake tests: Allow ignoring some latex error messages
authorKornel Benko <kornel@lyx.org>
Wed, 11 Jan 2017 09:15:13 +0000 (10:15 +0100)
committerKornel Benko <kornel@lyx.org>
Wed, 11 Jan 2017 09:15:13 +0000 (10:15 +0100)
New file: ignoreLatexErrorsTests
The sublabels in this list of export-testnames specify which error
messages should be ignored.
For each sublabel (for example "xxx") the lyx-command line is expanded with
  "--ignore-error-message xxx"

development/autotests/ExportTests.cmake
development/autotests/export.cmake
development/autotests/ignoreLatexErrorsTests [new file with mode: 0644]

index 7184994e5c5b1e6bdbdba3fa0fad4c027982e121..9d3e6d0357cdd21797ac698a64160162f94feb79 100644 (file)
@@ -186,7 +186,7 @@ macro(maketestname testname inverted listinverted listignored listunreliable lis
   endif()
 endmacro()
 
-macro(loadTestList filename resList depth)
+macro(loadTestList filename resList depth splitlangs)
   # Create list of strings from a file without comments
   # ENCODING parameter is a new feature in cmake 3.1
   initLangVars(${resList})
@@ -218,8 +218,12 @@ macro(loadTestList filename resList depth)
         list(REMOVE_DUPLICATES mylabels)
         set(sublabel ${_newl})
       else()
-        string(REGEX REPLACE "(\\/|\\||\\(|\\))" "  " _vxx ${_newl})
-        string(REGEX MATCHALL " ([a-z][a-z](_[A-Z][A-Z])?) " _vx ${_vxx})
+       if (splitlangs)
+         string(REGEX REPLACE "(\\/|\\||\\(|\\))" "  " _vxx ${_newl})
+         string(REGEX MATCHALL " ([a-z][a-z](_[A-Z][A-Z])?) " _vx ${_vxx})
+       else()
+         set(_vx OFF)
+       endif()
         if(_vx)
           foreach(_v ${_vx})
             string(REGEX REPLACE " " "" _v ${_v})
@@ -276,10 +280,11 @@ assignLabelDepth(1 "unreliable" "inverted")
 assignLabelDepth(2 "suspended")
 assignLabelDepth(-1 "examples" "manuals" "mathmacros" "templates" "autotests")
 
-loadTestList(invertedTests invertedTests 7)
-loadTestList(ignoredTests ignoredTests 0)
-loadTestList(suspendedTests suspendedTests 6)
-loadTestList(unreliableTests unreliableTests 5)
+loadTestList(invertedTests invertedTests 7 ON)
+loadTestList(ignoredTests ignoredTests 0 ON)
+loadTestList(suspendedTests suspendedTests 6 ON)
+loadTestList(unreliableTests unreliableTests 5 ON)
+loadTestList(ignoreLatexErrorsTests ignoreLatexErrorsTests 8 OFF)
 
 foreach(libsubfolderx autotests/export lib/doc lib/examples lib/templates autotests/mathmacros)
   set(testlabel "export")
@@ -417,6 +422,8 @@ foreach(libsubfolderx autotests/export lib/doc lib/examples lib/templates autote
           set(mytestlabel ${testlabel})
           maketestname(TestName inverted invertedTests ignoredTests unreliableTests mytestlabel)
           if(TestName)
+           set(missingLabels )
+           findexpr(mfound TestName ignoreLatexErrorsTests missingLabels)
             add_test(NAME ${TestName}
               WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/${LYX_HOME}"
               COMMAND ${CMAKE_COMMAND} -DLYX_ROOT=${LIBSUB_SRC_DIR}
@@ -429,6 +436,7 @@ foreach(libsubfolderx autotests/export lib/doc lib/examples lib/templates autote
               -Dfile=${f}
               -Dinverted=${inverted}
               -DTOP_SRC_DIR=${TOP_SRC_DIR}
+             "-DIgnoreErrorMessage=${missingLabels}"
               -DPERL_EXECUTABLE=${PERL_EXECUTABLE}
               -DXMLLINT_EXECUTABLE=${XMLLINT_EXECUTABLE}
               -DENCODING=${_enc2}
index 08fd86e30bbdf7a41edc822795f7369a6def216b..3dd32d97666822455fdf157f4db996132c44aadf 100755 (executable)
 #       -Dfile=xxx \
 #       -Dinverted=[01] \
 #       -DTOP_SRC_DIR=${TOP_SRC_DIR} \
+#       -DIgnoreErrorMessage=(ON/OFF) \
 #       -DPERL_EXECUTABLE=${PERL_EXECUTABLE} \
 #       -DXMLLINT_EXECUTABLE=${XMLLINT_EXECUTABLE} \
 #       -DENCODING=xxx \
 #       -P "${TOP_SRC_DIR}/development/autotests/export.cmake"
 #
 
+message(STATUS "IgnoreErrorMessage = ${IgnoreErrorMessage}")
 set(Perl_Script "${TOP_SRC_DIR}/development/autotests/useSystemFonts.pl")
 set(Structure_Script "${TOP_SRC_DIR}/development/autotests/beginEndStructureCheck.pl")
 set(LanguageFile "${TOP_SRC_DIR}/lib/languages")
@@ -139,14 +141,20 @@ if (extension MATCHES "\\.lyx$")
   endforeach()
 else()
   if ($ENV{LYX_DEBUG_LATEX})
-    set(LatexDebugParam -dbg latex)
+    set(LyXExtraParams -dbg latex)
   else()
-    set(LatexDebugParam)
+    set(LyXExtraParams)
   endif()
-  message(STATUS "Executing ${lyx} ${LatexDebugParam} -userdir \"${LYX_TESTS_USERDIR}\" -E ${format} ${result_file_name} \"${LYX_SOURCE}\"")
+  if(IgnoreErrorMessage)
+    foreach (_em ${IgnoreErrorMessage})
+      list(APPEND LyXExtraParams --ignore-error-message ${_em})
+    endforeach()
+  endif()
+  string(REGEX REPLACE ";" " " _LyXExtraParams "${LyXExtraParams}")
+  message(STATUS "Executing ${lyx} ${_LyXExtraParams} -userdir \"${LYX_TESTS_USERDIR}\" -E ${format} ${result_file_name} \"${LYX_SOURCE}\"")
   file(REMOVE ${result_file_name})
   execute_process(
-    COMMAND ${lyx} ${LatexDebugParam} -userdir "${LYX_TESTS_USERDIR}" -E ${format} ${result_file_name} "${LYX_SOURCE}"
+    COMMAND ${lyx} ${LyXExtraParams} -userdir "${LYX_TESTS_USERDIR}" -E ${format} ${result_file_name} "${LYX_SOURCE}"
     RESULT_VARIABLE _err)
 
   #check if result file created
diff --git a/development/autotests/ignoreLatexErrorsTests b/development/autotests/ignoreLatexErrorsTests
new file mode 100644 (file)
index 0000000..42c36ba
--- /dev/null
@@ -0,0 +1,2 @@
+Sublabel: missing_glyphs
+export/doc/UserGuide_(dvi3|pdf4|pdf5)_systemF