lyx2lyx tests: Check for possible endless expansion

If, after the 10th iteration, the exported lyx16x file still
differs from the one in the previous iteration, the test
is marked as failing, even if still loadable.
This commit is contained in:
Kornel Benko 2018-01-22 14:43:50 +01:00
parent 3a3fc55556
commit 40e32d4d27

View File

@ -97,7 +97,7 @@ set(ENV{LANG} "en_US.UTF-8") # to get all error-messages in english
if (extension MATCHES "\\.lyx$")
include(${TOP_SRC_DIR}/development/autotests/CheckLoadErrors.cmake)
get_md5sum(LYX_SOURCE source_md5sum _err)
foreach(_lv RANGE 1 5)
foreach(_lv RANGE 1 20)
set(result_file_base "${result_file_base}.${LYX_FORMAT_NUM}")
set(result_file_name "${result_file_base}.lyx")
file(REMOVE "${result_file_name}" "${result_file_name}.emergency" )
@ -135,6 +135,13 @@ if (extension MATCHES "\\.lyx$")
if(result_md5sum STREQUAL ${source_md5sum})
message(STATUS "Source(${LYX_SOURCE}) and dest(${result_file_name}) are equal")
break()
else()
message(STATUS "Source(${LYX_SOURCE}) and dest(${result_file_name}) are still different")
if (_lv GREATER 10)
set(_err 1)
message(STATUS "Possible endless loop encountered")
break()
endif()
endif()
set(source_md5sum ${result_md5sum})
set(LYX_SOURCE ${result_file_name})