commit bce1d94b427125392b13f88a9f83cc25b428425d
Author: Kornel Benko <[email protected]>
Date: Fri Jan 20 16:51:38 2023 +0100
Cmake tests for xhtml: Check only for errors
For now, do not handle warnings in output from call to
simplehtml_validity.py.
---
development/autotests/export.cmake | 35 +++++++++++++++++++++++------------
1 files changed, 23 insertions(+), 12 deletions(-)
diff --git a/development/autotests/export.cmake
b/development/autotests/export.cmake
index 0dedb48..85195c6 100755
--- a/development/autotests/export.cmake
+++ b/development/autotests/export.cmake
@@ -117,7 +117,8 @@ function(get_md5sum msource mresult mreserr)
endfunction()
macro(Summary _err _msg)
- if (${_err})
+ #message(STATUS "Summary called with err=${_err}, msg=${_msg}")
+ if (_err)
MATH(EXPR NO_FAILES "${NO_FAILES}+1")
list(APPEND _TestResultMessage "Error: ${_msg}")
else()
@@ -125,25 +126,35 @@ macro(Summary _err _msg)
endif()
endmacro()
+macro(validate_output output outputfile errmsg errx)
+ if (NOT "${output}" STREQUAL "")
+ file(WRITE "${outputfile}" "${output}")
+ MATH(EXPR NO_FAILES "${NO_FAILES}+1")
+ Summary(${errx} "Validating \"${outputfile}\", ${errmsg}")
+ endif()
+endmacro()
+
macro(check_xhtml_validate xhtml_file)
message(STATUS "Calling ${LYX_PYTHON_EXECUTABLE}
\"${TOP_SRC_DIR}/development/autotests/simplehtml_validity.py\"
\"${TempDir}/${xhtml_file}\"")
set(_outputfile "${TempDir}/${xhtml_file}.validate_out")
+ set(_errorfile "${TempDir}/${xhtml_file}.validate_err")
execute_process(
COMMAND ${LYX_PYTHON_EXECUTABLE}
"${TOP_SRC_DIR}/development/autotests/simplehtml_validity.py"
"${TempDir}/${xhtml_file}"
WORKING_DIRECTORY "${TempDir}"
OUTPUT_VARIABLE xmlout
ERROR_VARIABLE xmlerr
RESULT_VARIABLE _err)
- file(WRITE "${_outputfile}" ${xmlout})
- Summary(_err "Validating \"${_outputfile}\"")
- if (_err)
- MATH(EXPR NO_FAILES "${NO_FAILES}+1")
- endif()
if (NOT "${xmlout}" STREQUAL "")
- message(STATUS "${xmlout}")
- set(_err -1)
- Summary(_err "Non empty output \"${_outputfile}\" with
\"symplehtml_validity.py\"")
+ if ("${xmlout}" MATCHES "Error: ")
+ validate_output("${xmlout}" "${_outputfile}" "found errors" -5)
+ endif()
+ endif()
+ validate_output("${xmlerr}" "${_errorfile}" "Not emty" -6)
+ if (NO_FAILES EQUAL 0 AND ${_err} EQUAL 254)
+ # Ignore this result, validate the outputs only instead
+ set(_err 0)
endif()
+ Summary(${_err} "Calling simplehtml_validity.py, result=${_err}")
endmacro()
macro(check_xhtml_xmllint xhtml_file)
@@ -158,7 +169,7 @@ macro(check_xhtml_xmllint xhtml_file)
ERROR_VARIABLE xmlerr
RESULT_VARIABLE _err)
file(WRITE "${_outputfile}" ${xmlout})
- Summary(_err "Checking \"${TempDir}/${xhtml_file}\" with
${XMLLINT_EXECUTABLE}")
+ Summary(${_err} "Checking \"${TempDir}/${xhtml_file}\" with
${XMLLINT_EXECUTABLE}")
if (NOT _err)
# check if parser output contains error messages
message(STATUS "Check the output: ${PERL_EXECUTABLE}
${TOP_SRC_DIR}/development/autotests/examineXmllintOutput.pl")
@@ -167,7 +178,7 @@ macro(check_xhtml_xmllint xhtml_file)
WORKING_DIRECTORY "${TempDir}"
OUTPUT_VARIABLE xmlout
RESULT_VARIABLE _err)
- Summary(_err "Parse messages of ${XMLLINT_EXECUTABLE} for errors")
+ Summary(${_err} "Parse messages of ${XMLLINT_EXECUTABLE} for errors")
else()
message(STATUS "Errors from xmllint: ${xmlerr}")
endif()
@@ -175,7 +186,7 @@ macro(check_xhtml_xmllint xhtml_file)
if (NOT "${xmlout}" STREQUAL "")
message(STATUS "${xmlout}")
set(_err -1)
- Summary(_err "Non empty output \"${_outputfile}\" of
\"${XMLLINT_EXECUTABLE}\"")
+ Summary(${_err} "Non empty output \"${_outputfile}\" of
\"${XMLLINT_EXECUTABLE}\"")
endif()
endif()
endmacro()
--
lyx-cvs mailing list
[email protected]
http://lists.lyx.org/mailman/listinfo/lyx-cvs