mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-03 16:31:13 +00:00
Cmake export tests: Expand summary messages
Summary log messages are now used also for xhtml exports
This commit is contained in:
parent
e973f3abf9
commit
05fb3114d5
@ -100,6 +100,14 @@ function(get_md5sum msource mresult mreserr)
|
||||
set(${mreserr} ${mres_err} PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
macro(Summary _err _msg)
|
||||
if (${_err})
|
||||
list(APPEND _TestResultMessage "Error: ${_msg}")
|
||||
else()
|
||||
list(APPEND _TestResultMessage "OK: ${_msg}")
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
set(ENV{${LYX_USERDIR_VER}} "${LYX_TESTS_USERDIR}")
|
||||
set(ENV{LANG} "en_US.UTF-8") # to get all error-messages in english
|
||||
#set(ENV{LC_ALL} "C")
|
||||
@ -117,36 +125,27 @@ if (extension MATCHES "\\.lyx$")
|
||||
COMMAND ${lyx} -userdir "${LYX_TESTS_USERDIR}" -E ${format} ${result_file_name} "${LYX_SOURCE}"
|
||||
RESULT_VARIABLE _err
|
||||
ERROR_VARIABLE lyxerr)
|
||||
set(_mymsg "Converting \"${LYX_SOURCE}\" to format ${format}")
|
||||
Summary(_err "Converting \"${LYX_SOURCE}\" to format ${format}")
|
||||
if(_err)
|
||||
list(APPEND _TestResultMessage "Error: ${_mymsg}")
|
||||
break()
|
||||
else()
|
||||
list(APPEND _TestResultMessage "OK: ${_mymsg}")
|
||||
if(NOT EXISTS "${result_file_name}")
|
||||
message(STATUS "Expected result file \"${result_file_name}\" does not exist")
|
||||
list(APPEND _TestResultMessage "Error: The conversion of \"${LYX_SOURCE}\" to format ${format} did not create result file \"${result_file_name}\"")
|
||||
set(_err -1)
|
||||
Summary(_err "Expected result file \"${result_file_name}\" does not exist")
|
||||
break()
|
||||
else()
|
||||
message(STATUS "Expected result file \"${result_file_name}\" exists")
|
||||
execute_process(
|
||||
COMMAND ${PERL_EXECUTABLE} ${Structure_Script} "${result_file_name}"
|
||||
RESULT_VARIABLE _err)
|
||||
set(_mymsg "Structure of the intermediate file \"${result_file_name}\"")
|
||||
Summary(_err "Structure of the intermediate file \"${result_file_name}\"")
|
||||
if(_err)
|
||||
list(APPEND _TestResultMessage "Error: ${_mymsg} seems to be broken")
|
||||
break()
|
||||
else()
|
||||
list(APPEND _TestResultMessage "OK: ${_mymsg}")
|
||||
endif()
|
||||
checkLoadErrors(lyxerr "${TOP_SRC_DIR}/development/autotests" _err)
|
||||
set(_mymsg "Examination of error/warning messages of the conversion of \"${LYX_SOURCE}\" to format ${format}")
|
||||
Summary(_err "Examination of error/warning messages of the conversion of \"${LYX_SOURCE}\" to format ${format}")
|
||||
if(_err)
|
||||
list(APPEND _TestResultMessage "Error: ${_mymsg}")
|
||||
break()
|
||||
else()
|
||||
list(APPEND _TestResultMessage "OK: ${_mymsg}")
|
||||
endif()
|
||||
message(STATUS "Create the corresponding .tex file \"${used_tex_file}\"")
|
||||
execute_process(
|
||||
@ -155,13 +154,10 @@ if (extension MATCHES "\\.lyx$")
|
||||
endif()
|
||||
endif()
|
||||
get_md5sum(result_file_name result_md5sum _err)
|
||||
set(_mymsg "Getting md5sum of \"${result_file_name}\"")
|
||||
Summary(_err "Getting md5sum of \"${result_file_name}\"")
|
||||
if(_err)
|
||||
# Somehow the created file is not readable?
|
||||
list(APPEND _TestResultMessage "Error: ${_mymsg}")
|
||||
break()
|
||||
else()
|
||||
list(APPEND _TestResultMessage "OK: ${_mymsg}")
|
||||
endif()
|
||||
# Check if result file identical to source file
|
||||
if(result_md5sum STREQUAL ${source_md5sum})
|
||||
@ -178,12 +174,7 @@ if (extension MATCHES "\\.lyx$")
|
||||
COMMAND ${lyx} -userdir "${LYX_TESTS_USERDIR}" -E default "${result_file_name}.default" "${result_file_name}"
|
||||
RESULT_VARIABLE _err
|
||||
ERROR_VARIABLE lyxerr)
|
||||
set(_mymsg "Test-compilation of \"${result_file_name}\" to format default")
|
||||
if (_err)
|
||||
list(APPEND _TestResultMessage "Error: ${_mymsg}")
|
||||
else()
|
||||
list(APPEND _TestResultMessage "OK: ${_mymsg}")
|
||||
endif()
|
||||
Summary(_err "Test-compilation of \"${result_file_name}\" to format default")
|
||||
break()
|
||||
else()
|
||||
list(APPEND _TestResultMessage "Warning: \"${LYX_SOURCE}\" and \"${result_file_name}\" differ")
|
||||
@ -191,7 +182,7 @@ if (extension MATCHES "\\.lyx$")
|
||||
if (_lv GREATER 10)
|
||||
set(_err 1)
|
||||
message(STATUS "Possible endless loop encountered")
|
||||
list(APPEND _TestResultMessage "Error: Test-Loop exceeded the count of 10, Possible endless loop")
|
||||
Summary(_err "Test-Loop exceeded the count of 10, Possible endless loop")
|
||||
break()
|
||||
endif()
|
||||
endif()
|
||||
@ -215,12 +206,13 @@ else()
|
||||
execute_process(
|
||||
COMMAND ${lyx} ${LyXExtraParams} -userdir "${LYX_TESTS_USERDIR}" -E ${format} ${result_file_name} "${LYX_SOURCE}"
|
||||
RESULT_VARIABLE _err)
|
||||
|
||||
#check if result file created
|
||||
Summary(_err "Exporting \"${LYX_SOURCE}\" to format ${format}")
|
||||
if (NOT _err)
|
||||
#check if result file created
|
||||
if (NOT EXISTS "${result_file_name}")
|
||||
message(STATUS "Expected result file \"${result_file_name}\" does not exist")
|
||||
set(_err -1)
|
||||
Summary(_err "Expected result file \"${result_file_name}\" does not exists")
|
||||
else()
|
||||
message(STATUS "Expected result file \"${result_file_name}\" exists")
|
||||
if (format MATCHES "xhtml")
|
||||
@ -233,6 +225,7 @@ else()
|
||||
ERROR_VARIABLE xmlerr
|
||||
RESULT_VARIABLE _err)
|
||||
file(WRITE "${result_file_name}.sax_out" ${xmlout})
|
||||
Summary(_err "Checking \"${result_file_name}\" with ${XMLLINT_EXECUTABLE}")
|
||||
if (NOT _err)
|
||||
# check if sax-parser output contains error messages
|
||||
message(STATUS "Check the output: ${PERL_EXECUTABLE} ${TOP_SRC_DIR}/development/autotests/examineXmllintOutput.pl")
|
||||
@ -240,11 +233,13 @@ else()
|
||||
COMMAND ${PERL_EXECUTABLE} "${TOP_SRC_DIR}/development/autotests/examineXmllintOutput.pl" "${result_file_name}.sax_out"
|
||||
OUTPUT_VARIABLE xmlout
|
||||
RESULT_VARIABLE _err)
|
||||
Summary(_err "Parse messages of ${XMLLINT_EXECUTABLE} for errors")
|
||||
endif()
|
||||
if (NOT _err)
|
||||
if (NOT "${xmlout}" STREQUAL "")
|
||||
message(STATUS "${xmlout}")
|
||||
set(_err -1)
|
||||
Summary(_err "Non empty output of \"${XMLLINT_EXECUTABLE}\"")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
Loading…
Reference in New Issue
Block a user