commit 7eb64211b02701c58d1ff87f0ef918a634776c2f
Author: Tommaso Cucinotta <[email protected]>
Date:   Wed Jan 25 03:13:14 2017 +0100

    Revert "Long time no use of the autotests machinery, needs an update."
    Pushed by mistake ... not finished yet ... apologies.
    
    This reverts commit be79d2cda8a80787e0ac054cd32d672a1c0243b1.
---
 development/autotests/keytest.py         |   19 ++++++++++---------
 development/autotests/single-test.sh     |    6 +-----
 development/autotests/stop_autotests.tcl |    2 +-
 3 files changed, 12 insertions(+), 15 deletions(-)

diff --git a/development/autotests/keytest.py b/development/autotests/keytest.py
index 608ce73..27b6d48 100755
--- a/development/autotests/keytest.py
+++ b/development/autotests/keytest.py
@@ -151,13 +151,22 @@ class CommandSourceFromFile(CommandSource):
         self.i = self.i + 1
         return line
 
-
 def lyx_exists():
     if lyx_pid is None:
         return False
     fname = '/proc/' + lyx_pid + '/status'
     return os.path.exists(fname)
 
+def lyx_sleeping():
+    fname = '/proc/' + lyx_pid + '/status'
+    f = open(fname, 'r')
+    lines = f.readlines()
+    sleeping = lines[1].find('(sleeping)') > 0
+
+    # print 'LYX_STATE', lines[1] , 'SLEEPING=', sleeping
+
+    return sleeping
+
 
 # Interruptible os.system()
 def intr_system(cmd, ignore_err = False):
@@ -170,12 +179,6 @@ def intr_system(cmd, ignore_err = False):
     return ret
 
 
-# Return true if LyX (identified via lyx_pid) is sleeping
-def lyx_sleeping():
-    fname = '/proc/' + lyx_pid + '/status'
-    return intr_system("grep 'State.*sleeping' " + fname)
-
-
 def sendKeystring(keystr, LYX_PID):
 
     # print "sending keystring "+keystr+"\n"
@@ -348,10 +351,8 @@ while not failed:
         count = 5
         while count > 0:
             lyx_pid=os.popen("pidof " + lyx).read().rstrip()
-            print 'lyx_pid=' + lyx_pid, '\n'
             if lyx_pid != "":
                 lyx_window_name=os.popen("wmctrl -l -p | grep ' " + 
str(lyx_pid) +  " ' | cut -d ' ' -f 1").read().rstrip()
-                print 'lyx_win=' + lyx_window_name, '\n'
                 if lyx_window_name != "":
                     break
             else:
diff --git a/development/autotests/single-test.sh 
b/development/autotests/single-test.sh
index bb0ed2a..3cf509a 100755
--- a/development/autotests/single-test.sh
+++ b/development/autotests/single-test.sh
@@ -26,10 +26,6 @@ if [ "$(pidof lyx)" != "" ]; then
     export LYX_PID=$(pidof lyx)
     export LYX_WINDOW_NAME=$(wmctrl -l -p | grep " $LYX_PID " | cut -d ' ' -f 
1);
 fi
-
-echo LYX_PID=$LYX_PID
-echo LYX_WINDOW_NAME=$LYX_WINDOW_NAME
-
 export MAX_LOOPS=1
 export LYX_EXE=${LYX_EXE:-../../src/lyx}
 
@@ -39,4 +35,4 @@ else
     export XVKBD_EXE=${XVKBD_EXE:-xvkbd};
 fi
 
-python -m trace --trace $KEYTEST
+$KEYTEST
diff --git a/development/autotests/stop_autotests.tcl 
b/development/autotests/stop_autotests.tcl
index 7822826..5b15c68 100755
--- a/development/autotests/stop_autotests.tcl
+++ b/development/autotests/stop_autotests.tcl
@@ -1,4 +1,4 @@
-#!/usr/bin/wish
+#!/usr/bin/wish8.5
 
 wm attributes . -topmost 1
 

Reply via email to