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()
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)
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")
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()
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()