]> git.lyx.org Git - lyx.git/blobdiff - development/autotests/keytest.py
Cmake export tests
[lyx.git] / development / autotests / keytest.py
index 82f316cce158e2a15f8b97bc95429ca8dd5a429c..b2a89c2d0d63944c101146419e0997950b9b1e58 100755 (executable)
@@ -258,9 +258,13 @@ PO_BUILD_DIR = os.environ.get('PO_BUILD_DIR')
 if not PO_BUILD_DIR is None:
   print "PO_BUILD_DIR = " + PO_BUILD_DIR + "\n"
 
+lyx = os.environ.get('LYX')
+if lyx is None:
+    lyx = "lyx"
+
 lyx_exe = os.environ.get('LYX_EXE')
 if lyx_exe is None:
-    lyx_exe = "lyx"
+    lyx_exe = lyx
 
 xvkbd_exe = os.environ.get('XVKBD_EXE')
 if xvkbd_exe is None:
@@ -326,12 +330,12 @@ while not failed:
         print "Ignoring comment line: " + c
     elif c[0:9] == 'TestBegin':
         print "\n"
-        lyx_pid=os.popen("pidof lyx").read()
+        lyx_pid=os.popen("pidof " + lyx).read()
         if lyx_pid != "":
             print "Found running instance(s) of LyX: " + lyx_pid + ": killing them all\n"
-            intr_system("killall lyx", True)
+            intr_system("killall " + lyx, True)
             time.sleep(0.5)
-            intr_system("killall -KILL lyx", True)
+            intr_system("killall -KILL " + lyx, True)
         time.sleep(0.2)
         print "Starting LyX . . ."
         if lyx_userdir is None:
@@ -339,7 +343,7 @@ while not failed:
         else:
             intr_system(lyx_exe + " -userdir " + lyx_userdir + " " + c[9:] + "&")
         while True:
-            lyx_pid=os.popen("pidof lyx").read().rstrip()
+            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 != "":
@@ -350,7 +354,7 @@ while not failed:
         print 'lyx_pid: ' + lyx_pid + '\n'
         print 'lyx_win: ' + lyx_window_name + '\n'
     elif c[0:5] == 'Sleep':
-        print "Sleeping for " + c[6:] + "\n"
+        print "Sleeping for " + c[6:] + " seconds\n"
         time.sleep(float(c[6:]))
     elif c[0:4] == 'Exec':
         cmd = c[5:].rstrip()
@@ -380,7 +384,6 @@ while not failed:
         sendKeystring(ResetCommand, lyx_pid)
     elif c[0:6] == 'Assert':
         cmd = c[7:].rstrip()
-        print "Executing " + cmd
         result = intr_system(cmd)
         failed = failed or (result != 0)
         print "result=" + str(result) + ", failed=" + str(failed)
@@ -388,7 +391,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);
@@ -404,7 +407,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