3 # This script runs all the test scripts it finds in the current folder
4 # Tests are identified as having a file name of *-in.txt
5 # For failed tests, the collected output is kept in the corresponding folder
7 export LYX_EXE=../../../src/lyx
9 if [ "$XVKBD_HACKED" != "" ]; then
10 export XVKBD_EXE=${XVKBD:-./xvkbd/xvkbd};
11 if [ ! -x $XVKBD_EXE ]; then
12 echo "You need to build XVKBD first, try: cd xvkbd && xmkmf && make"
17 export XVKBD_EXE=../$XVKBD_EXE
18 export KEYTEST=../keytest.py
20 export LYX_USERDIR=$(pwd)/$LYX_HOME/.lyx
22 export LOCALE_DIR=../locale
24 if [ ! -d ../../locale ]; then
25 echo "Some tests may require the GUI showing up in a specified language."
26 echo "In order to make it work, I'm going to run this command:"
28 cmd="ln -s `pwd`/locale ../../"
31 while [ "$ans" != "y" -a "$ans" != "n" ]; do
32 echo "Should I proceed (y/n) ?"
35 if [ "$ans" == "y" ]; then
40 if [ "$#" -eq 0 ]; then
41 TESTS=$(ls *-in.txt | sed -e 's/hello-world-in.txt\|first-time-in.txt//')
49 if [ ! -d $LYX_HOME ]; then
51 # mkdir -p $LYX_USERDIR
52 # cp preferences $LYX_USERDIR
54 echo "Initializing testing environment . . ."
55 if ! ../single-test.sh "../first-time-in.txt" > keytest-log.txt 2>&1; then
56 echo "Some error occurred: check $(pwd)"
62 # Launch the emergency STOP button
63 ./stop_autotests.tcl &
66 echo "Running test cases . . ."
68 for t in $(echo "$TESTS" | sed -e 's/-in.txt//g'); do
70 if [ ! -f "$t-in.txt" ]; then
71 echo "ERROR: File not found: $t-in.txt"
77 if ../single-test.sh "../$t-in.txt" > keytest-log.txt 2>&1; then
89 wait $pid > /dev/null 2>&1
92 if [ $failed -eq 0 ]; then
93 echo "All tests SUCCESSFUL"
95 echo "There were $failed FAILED tests";