If the test opens an existing .lyx file and crashes, it will leave
around a .emergency file. If a test with that same name is run again,
LyX will try to recover the .emergency file, which could throw
off the test.
This is implemented for both CMake and autotools.
set(ENV{PO_BUILD_DIR} "${PO_BUILD_DIR}")
set(ENV{MAX_DROP} 0)
set(ENV{MAX_LOOPS} 1)
+string(REGEX REPLACE "-in\\.(txt|sh)$" "" _jj ${KEYTEST_INFILE})
+if(EXISTS "${WORKDIR}/../${_jj}.lyx.emergency")
+ execute_process(
+ COMMAND ${CMAKE_COMMAND} -E remove -f "${WORKDIR}/../${_jj}.lyx.emergency" )
+endif()
file(GLOB _testfiles RELATIVE "${WORKDIR}" "test*.*" "#test*.*")
if(_testfiles)
# remove some leftover files from previous test
execute_process(
COMMAND ${CMAKE_COMMAND} -E remove -f ${_testfiles} )
endif()
-string(REGEX REPLACE "-in\\.(txt|sh)$" "" _jj ${KEYTEST_INFILE})
if(EXISTS "${AUTOTEST_ROOT}/${_jj}.lyx")
configure_file("${AUTOTEST_ROOT}/${_jj}.lyx" "${WORKDIR}/../${_jj}.lyx" COPYONLY)
endif()
KEYTEST_INFILE="$1";
fi
+BASE=$( echo $KEYTEST_INFILE | sed 's/-in\.\(txt\|sh\)$//')
+if [ -e $BASE.lyx.emergency ]; then
+ echo "removing $BASE.lyx.emergency"
+ rm $BASE.lyx.emergency
+fi
+
export MAX_DROP=0
if [ "$(pidof lyx)" != "" ]; then
export LYX_PID=$(pidof lyx)