]> git.lyx.org Git - lyx.git/blobdiff - development/autotests/keytest.py
Fixup commit ff42fe
[lyx.git] / development / autotests / keytest.py
index a510a3faafd8bc10d895b0909e791682ece9fc2d..7cae6843e55a173c1206aed45fd67f97bbd8e4e4 100755 (executable)
@@ -342,15 +342,22 @@ while not failed:
             intr_system(lyx_exe + c[9:] + "&")
         else:
             intr_system(lyx_exe + " -userdir " + lyx_userdir + " " + c[9:] + "&")
-        while True:
+        count = 5
+        while count > 0:
             lyx_pid=os.popen("pidof " + lyx).read().rstrip()
             if lyx_pid != "":
                 lyx_window_name=os.popen("wmctrl -l -p | grep ' " + str(lyx_pid) +  " ' | cut -d ' ' -f 1").read().rstrip()
                 if lyx_window_name != "":
                     break
+            else:
+                count = count - 1
             print 'lyx_win: ' + lyx_window_name + '\n'
             print "Waiting for LyX to show up . . ."
             time.sleep(1)
+        if count <= 0:
+            print 'Timeout: could not start ' + lyx_exe, '\n'
+            sys.stdout.flush()
+            failed = True
         print 'lyx_pid: ' + lyx_pid + '\n'
         print 'lyx_win: ' + lyx_window_name + '\n'
     elif c[0:5] == 'Sleep':
@@ -391,7 +398,7 @@ while not failed:
         time.sleep(0.5)
         if not lyx_exists():
             print "LyX instance not found because of crash or assert !\n"
-            failed = true
+            failed = True
         else:
             print "Terminating lyx instance: " + str(lyx_pid) + "\n"
             intr_system("kill -9 " + str(lyx_pid), True);
@@ -407,7 +414,7 @@ while not failed:
         lang = c[5:].rstrip()
         print "Setting LANG=" + lang + "\n"
         os.environ['LANG'] = lang
-        os.environ['LANGUAGE'] = lang
+        os.environ['LC_ALL'] = lang
 # If it doesn't exist, create a link <locale_dir>/<country-code>/LC_MESSAGES/lyx<version-suffix>.mo
 # pointing to the corresponding .gmo file. Needed to let lyx find the right translation files.
 # See http://www.mail-archive.com/lyx-devel@lists.lyx.org/msg165613.html