X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=development%2Fautotests%2Frun-tests.sh;h=c462603a849e9504797ce7298bb56e2e482d11d5;hb=45b61c6ecf76425d563b6fae7f3da52e3716ca5d;hp=1b3ab651c4bdfc49b7bd11b8a561fa99f3e2b8a8;hpb=3596e02d6a26752cf6c3ad5d0ff28220e12ed53a;p=lyx.git diff --git a/development/autotests/run-tests.sh b/development/autotests/run-tests.sh index 1b3ab651c4..c462603a84 100755 --- a/development/autotests/run-tests.sh +++ b/development/autotests/run-tests.sh @@ -4,23 +4,42 @@ # Tests are identified as having a file name of *-in.txt # For failed tests, the collected output is kept in the corresponding folder -if [ ! -x xvkbd/xvkbd ]; then - echo "You need to build XVKBD first, try: cd xvkbd && xmkmf && make" - exit -1; -fi - -export LYX_EXE=../../../src/lyx +#export LYX_EXE=../../../src/lyx if [ "$XVKBD_HACKED" != "" ]; then - export XVKBD_EXE=${XVKBD:-../xvkbd/xvkbd}; + export XVKBD_EXE=${XVKBD:-./xvkbd/xvkbd}; + if [ ! -x $XVKBD_EXE ]; then + echo "You need to build XVKBD first, try: cd xvkbd && xmkmf && make" + exit -1; + fi fi +export XVKBD_EXE=../$XVKBD_EXE export KEYTEST=../keytest.py LYX_HOME=out-home export LYX_USERDIR=$(pwd)/$LYX_HOME/.lyx +# Create locale links +export LOCALE_DIR=../locale + +if [ ! -d ../../locale ]; then + echo "Some tests may require the GUI showing up in a specified language." + echo "In order to make it work, I'm going to run this command:" + mkdir -p locale + cmd="ln -s `pwd`/locale ../../" + echo " $cmd" + ans="" + while [ "$ans" != "y" -a "$ans" != "n" ]; do + echo "Should I proceed (y/n) ?" + read ans; + done + if [ "$ans" == "y" ]; then + $cmd; + fi; +fi if [ "$#" -eq 0 ]; then - TESTS=$(ls *-in.txt | sed -e 's/hello-world-in.txt\|first-time-in.txt//'); + TESTS=$(ls *-in.txt | sed -e 's/hello-world-in.txt\|first-time-in.txt//') + rm -rf out-*; else TESTS=$* fi @@ -28,7 +47,9 @@ fi echo if [ ! -d $LYX_HOME ]; then - mkdir $LYX_HOME + mkdir -p $LYX_HOME +# mkdir -p $LYX_USERDIR +# cp preferences $LYX_USERDIR cd $LYX_HOME echo "Initializing testing environment . . ." if ! ../single-test.sh "../first-time-in.txt" > keytest-log.txt 2>&1; then @@ -40,6 +61,7 @@ fi # Launch the emergency STOP button ./stop_autotests.tcl & +pid=$! echo "Running test cases . . ." failed=0 @@ -63,7 +85,8 @@ for t in $(echo "$TESTS" | sed -e 's/-in.txt//g'); do fi; done -killall stop_autotests.tcl > /dev/null 2>&1 +kill $pid +wait $pid > /dev/null 2>&1 echo if [ $failed -eq 0 ]; then