X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=development%2Fautotests%2Fcheck_load.cmake;h=0a0d35154bdf9d8082db9827bfe8f18b2b2e1a73;hb=0a040d18ad5bc065fba5b9e834d90d72cac332fb;hp=5311a80df1cae4a5e8f12157e73c3af6c44a6961;hpb=788e2b1ac8ae98c47a6551ecd70d6bfe0491294d;p=lyx.git diff --git a/development/autotests/check_load.cmake b/development/autotests/check_load.cmake index 5311a80df1..0a0d35154b 100644 --- a/development/autotests/check_load.cmake +++ b/development/autotests/check_load.cmake @@ -14,10 +14,11 @@ # -DLYXFILE=xxx \ # -DLYX_USERDIR_VER=${LYX_USERDIR_VER} \ # -DPARAMS_DIR="${TOP_SRC_DIR}/development/autotests" \ +# -Dinverted=${inverted} # -P "${TOP_SRC_DIR}/development/autotests/check_load.cmake" # -message(STATUS "Executing ${lyx} -batch ${LYXFILE}") +message(STATUS "Executing ${lyx} -batch -userdir \"${LYX_TESTS_USERDIR}\" ${LYXFILE}") set(ENV{${LYX_USERDIR_VER}} "${LYX_TESTS_USERDIR}") set(ENV{LANG} "en") # to get all error-messages in english @@ -27,30 +28,20 @@ execute_process( ERROR_VARIABLE lyxerr) message(STATUS "Error code of lyx = ${_err}") -string(COMPARE NOTEQUAL ${_err} 0 _erg) -if(lyxerr) - file(STRINGS "${PARAMS_DIR}/filterCheckWarnings" ignoreRegexp) - # Split lyxerr into lines - string(REGEX REPLACE "[\n]+" ";" foundErrors ${lyxerr}) - foreach(_l ${foundErrors}) - message(STATUS "Checking line: \"${_l}\"") - set(found 0) - foreach(_r ${ignoreRegexp}) - string(REGEX MATCHALL "${_r}" _match ${_l}) - if(_match) - set(found 1) - break() - endif() - endforeach() - if(NOT found) - # It is error, because the error-line does not match - # any ignoring expression - set(_erg 1) - endif() - endforeach() +# +# Ignore messages between "reconfiguring user directory" and "LyX: Done!" +# (Reconfigure-messages are not symptom of an error) +include(${PARAMS_DIR}/CheckLoadErrors.cmake) +if (NOT _err) + CheckLoadErrors(lyxerr "${PARAMS_DIR}" _err) endif() +if(inverted) + string(COMPARE EQUAL ${_err} 0 _erg) +else() + string(COMPARE NOTEQUAL ${_err} 0 _erg) +endif() if(_erg) # We print here the whole error output, even the ignored part message(FATAL_ERROR "lyx gave warnings/errors:\n${lyxerr}")