The branch, master, has been updated.

- Log -----------------------------------------------------------------

commit 12a4b3aee99fde9243c6aa8f96b20cc5a585cc31
Author: Scott Kostyshak <skost...@lyx.org>
Date:   Sun Jan 27 06:21:18 2013 -0500

    autotests: clean up .emergency file of input .lyx
    
    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.

diff --git a/development/autotests/single-test.cmake 
b/development/autotests/single-test.cmake
index 89a6fdd..3f452cc 100755
--- a/development/autotests/single-test.cmake
+++ b/development/autotests/single-test.cmake
@@ -67,13 +67,17 @@ set(ENV{KEYTEST_OUTFILE} "${WORKDIR}/${KEYTEST_OUTFILE}")
 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()
diff --git a/development/autotests/single-test.sh 
b/development/autotests/single-test.sh
index 72b8eeb..3cf509a 100755
--- a/development/autotests/single-test.sh
+++ b/development/autotests/single-test.sh
@@ -15,6 +15,12 @@ if [ "$1" != "" ]; then
     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)

-----------------------------------------------------------------------

Summary of changes:
 development/autotests/single-test.cmake |    6 +++++-
 development/autotests/single-test.sh    |    6 ++++++
 2 files changed, 11 insertions(+), 1 deletions(-)


hooks/post-receive
-- 
The LyX Source Repository

Reply via email to