commit b487e2b050eb1bbe2254a2232214262f6921c655
Author: Kornel Benko <[email protected]>
Date: Wed Jan 11 10:15:13 2017 +0100
Cmake tests: Allow ignoring some latex error messages
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 | 22 +++++++++++++++-------
development/autotests/export.cmake | 16 ++++++++++++----
development/autotests/ignoreLatexErrorsTests | 2 ++
3 files changed, 29 insertions(+), 11 deletions(-)
diff --git a/development/autotests/ExportTests.cmake
b/development/autotests/ExportTests.cmake
index 7184994..9d3e6d0 100644
--- a/development/autotests/ExportTests.cmake
+++ b/development/autotests/ExportTests.cmake
@@ -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}
diff --git a/development/autotests/export.cmake
b/development/autotests/export.cmake
index 08fd86e..3dd32d9 100755
--- a/development/autotests/export.cmake
+++ b/development/autotests/export.cmake
@@ -24,12 +24,14 @@
# -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
index 0000000..42c36ba
--- /dev/null
+++ b/development/autotests/ignoreLatexErrorsTests
@@ -0,0 +1,2 @@
+Sublabel: missing_glyphs
+export/doc/UserGuide_(dvi3|pdf4|pdf5)_systemF