]> git.lyx.org Git - features.git/commitdiff
Added the creation of a custom .lyx folder inside `pwd`/home/.lyx at
authorTommaso Cucinotta <tommaso@lyx.org>
Tue, 1 Feb 2011 22:08:07 +0000 (22:08 +0000)
committerTommaso Cucinotta <tommaso@lyx.org>
Tue, 1 Feb 2011 22:08:07 +0000 (22:08 +0000)
the beginning of the tests (which reconfigures LyX and takes some time),
followed by all of the tests using it. This way, we get only the default
configuration of LyX as a base, without being affected by individual users
custom configurations.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37408 a592a061-630c-0410-9148-cb99ea01b6c8

development/autotests/first-time-in.txt [new file with mode: 0644]
development/autotests/keytest.py
development/autotests/run-tests.sh

diff --git a/development/autotests/first-time-in.txt b/development/autotests/first-time-in.txt
new file mode 100644 (file)
index 0000000..e540385
--- /dev/null
@@ -0,0 +1,4 @@
+Lang en_US.utf8
+TestBegin test.lyx > lyx-log.txt 2>&1
+KK: \[Left]\[Return]
+TestEnd
index ca475d756dff4afc8147adef6682efaa884fafd1..bb715ff0a7778bf3d898f651a84edb501a586365 100755 (executable)
@@ -234,6 +234,7 @@ outfilename = os.environ.get('KEYTEST_OUTFILE')
 max_drop = os.environ.get('MAX_DROP')
 lyx_window_name = os.environ.get('LYX_WINDOW_NAME')
 screenshot_out = os.environ.get('SCREENSHOT_OUT')
+lyx_userdir = os.environ.get('LYX_USERDIR')
 
 max_loops = os.environ.get('MAX_LOOPS')
 if max_loops is None:
@@ -299,10 +300,13 @@ while not failed:
             os.system("killall lyx")
         time.sleep(0.2)
         print "Starting LyX . . ."
-        os.system(lyx_exe + c[9:] + "&")
+        if lyx_userdir is None:
+            os.system(lyx_exe + c[9:] + "&")
+        else:
+            os.system(lyx_exe + " -userdir " + lyx_userdir + " " + c[9:] + "&")
         while True:
             lyx_pid=os.popen("pidof lyx").read().rstrip()
-            lyx_window_name=os.popen("wmctrl -l | grep 'lyx$\\|LyX:' | sed -e 's/.*\\([Ll]y[Xx].*\\)$/\\1/'").read().rstrip()
+            lyx_window_name=os.popen("wmctrl -l -p | grep ' " + str(lyx_pid) +  " ' | cut -d ' ' -f 1").read().rstrip()
             if lyx_window_name != "":
                 break
             print 'lyx_win: ' + lyx_window_name + '\n'
index ba4067d1f7d60668f0ce8fa5ffceb7dd41d7559f..766f4c1a70ea2a62cf155495dd4d01aa18a3b34a 100755 (executable)
@@ -6,21 +6,38 @@
 
 export LYX_EXE=../../../src/lyx
 export KEYTEST=../keytest.py
+export LYX_USERDIR=$(pwd)/home/.lyx
 
 if [ "$#" -eq 0 ]; then
-    TESTS=$(ls *-in.txt);
+    TESTS=$(ls *-in.txt | sed -e 's/hello-world-in.txt\|first-time-in.txt//');
 else
     TESTS=$*
 fi
 
 echo
+
+if [ ! -d home ]; then
+    mkdir home
+    cd home
+    echo "Initializing testing environment . . ."
+    if ! ../single-test.sh "../first-time-in.txt" > keytest-log.txt 2>&1; then
+       echo "Some error occurred: check $(pwd)"
+       exit -1;
+    fi
+    cd ..
+fi
+
 echo "Running test cases . . ."
 failed=0
 for t in $(echo "$TESTS" | sed -e 's/-in.txt//g'); do
+    printf "%40s: " $t
+    if [ ! -f "$t-in.txt" ]; then
+       echo "ERROR: File not found: $t-in.txt"
+       exit -1;
+    fi
     rm -rf "out-$t"
     mkdir "out-$t"
     cd "out-$t"
-    printf "%40s: " $t
     if ../single-test.sh "../$t-in.txt" > keytest-log.txt 2>&1; then
        echo Ok
        cd ..