Re: keytest.py

2017-05-08 Thread Kornel Benko
Am Montag, 8. Mai 2017 um 09:29:06, schrieb Tommaso Cucinotta 
> On 07/05/2017 19:46, Kornel Benko wrote:
> > Do they fail if retested separately too?
> 
> I tested again just a couple of these, one was keeping failing, another one 
> succeeded, but I had no time for a proper investigation. Also, AFAICR my 
> laptop started buzzing or smth while the overall tests batch was running, I 
> suspect some keypresses didn't really result in what they were supposed to (I 
> wasn't looking at the screen in that very moment), likely the cause of some 
> of these failures.
> 
> I just tried removing the custom xvkbd from my dir (need the attached patch 
> for that), and I've got this:

yes, please commit. I removed it from cmake some time ago too.

> Running test cases . . .
>  bug-7673b-in.txt: Ok
>   bug-7673-in.txt: Ok
>   bug-8370-in.txt: Ok
>   bug-8482-in.txt: Ok
>   bug-8540-in.txt: Ok
>   bug-8684-in.txt: Ok
>   bug-export-latex-in.txt: Ok
>  bug-math-undo-in.txt: Ok
> findadv-01-in.txt: Ok
> findadv-02-in.txt: Ok
> findadv-03-in.txt: Ok
> findadv-04-in.txt: Ok
> findadv-05-in.txt: Ok
> findadv-06-in.txt: Ok
> findadv-07-in.txt: Ok
> findadv-08-in.txt: FAILED
> findadv-09-in.txt: Ok
> findadv-10-in.txt: Ok
> findadv-11-in.txt: Ok
> findadv-12-in.txt: Ok
> findadv-13-in.txt: Ok
> findadv-14-in.txt: FAILED
> findadv-15-in.txt: Ok
> findadv-16-in.txt: Ok
> findadv-17-in.txt: Ok
> findadv-18-in.txt: Ok
> findadv-19-in.txt: Ok
> findadv-20-in.txt: Ok
> findadv-21-in.txt: FAILED
>  findadv-crash-in.txt: Ok
>   findadv-logo-in.txt: Ok
>  findadv-re-01-in.txt: Ok
>  findadv-re-02-in.txt: Ok
>  findadv-re-03-in.txt: FAILED
>  findadv-re-04-in.txt: Ok
>  findadv-re-05-in.txt: Ok
>  findadv-re-06-in.txt: FAILED
>   tabular-footnote-in.txt: Ok
> 
> There were 5 FAILED tests
> 
> However, I saw the buzzing this time: the new Ubuntu sends my screen dark 
> earlier due to inactivity,
> and I start hearing these buzz, after entering my pwd, I saw the tests were 
> still running, but I'm not sure they were affected by the screen saver ... 
> need to check whether there's a way to prevent screen saver during these 
> tests.

You can define the time after which the screen saver will act.

meanwhile I am setting '-dbg key ...' into the tests. The tests are not 
significantly slower,
but we should be able to see if any key is not processed. (They all still pass 
here)

bug-export-latex,findadv-21 failing is OK, that leaves 3 tests on your side.

> > Which QT version?
> 
> 5.7.1

Same as here.

>   T.

Kornel

signature.asc
Description: This is a digitally signed message part.


Re: keytest.py

2017-05-08 Thread Tommaso Cucinotta

On 07/05/2017 19:46, Kornel Benko wrote:

Do they fail if retested separately too?


I tested again just a couple of these, one was keeping failing, another one 
succeeded, but I had no time for a proper investigation. Also, AFAICR my laptop 
started buzzing or smth while the overall tests batch was running, I suspect 
some keypresses didn't really result in what they were supposed to (I wasn't 
looking at the screen in that very moment), likely the cause of some of these 
failures.

I just tried removing the custom xvkbd from my dir (need the attached patch for 
that), and I've got this:

Running test cases . . .
bug-7673b-in.txt: Ok
 bug-7673-in.txt: Ok
 bug-8370-in.txt: Ok
 bug-8482-in.txt: Ok
 bug-8540-in.txt: Ok
 bug-8684-in.txt: Ok
 bug-export-latex-in.txt: Ok
bug-math-undo-in.txt: Ok
   findadv-01-in.txt: Ok
   findadv-02-in.txt: Ok
   findadv-03-in.txt: Ok
   findadv-04-in.txt: Ok
   findadv-05-in.txt: Ok
   findadv-06-in.txt: Ok
   findadv-07-in.txt: Ok
   findadv-08-in.txt: FAILED
   findadv-09-in.txt: Ok
   findadv-10-in.txt: Ok
   findadv-11-in.txt: Ok
   findadv-12-in.txt: Ok
   findadv-13-in.txt: Ok
   findadv-14-in.txt: FAILED
   findadv-15-in.txt: Ok
   findadv-16-in.txt: Ok
   findadv-17-in.txt: Ok
   findadv-18-in.txt: Ok
   findadv-19-in.txt: Ok
   findadv-20-in.txt: Ok
   findadv-21-in.txt: FAILED
findadv-crash-in.txt: Ok
 findadv-logo-in.txt: Ok
findadv-re-01-in.txt: Ok
findadv-re-02-in.txt: Ok
findadv-re-03-in.txt: FAILED
findadv-re-04-in.txt: Ok
findadv-re-05-in.txt: Ok
findadv-re-06-in.txt: FAILED
 tabular-footnote-in.txt: Ok

There were 5 FAILED tests

However, I saw the buzzing this time: the new Ubuntu sends my screen dark 
earlier due to inactivity, and I start hearing these buzz, after entering my 
pwd, I saw the tests were still running, but I'm not sure they were affected by 
the screen saver ... need to check whether there's a way to prevent screen 
saver during these tests.


Which QT version?


5.7.1

T.

diff --git a/development/autotests/run-tests.sh b/development/autotests/run-tests.sh
index 25d29340..23ab41cf 100755
--- a/development/autotests/run-tests.sh
+++ b/development/autotests/run-tests.sh
@@ -7,13 +7,13 @@
 export LYX_ROOT=../../..
 export LYX_EXE=$LYX_ROOT/src/lyx
 
-if [ "$XVKBD_HACKED" != "" ]; then
-export XVKBD_EXE=${XVKBD:-./xvkbd/xvkbd};
-if [ ! -x $XVKBD_EXE ]; then
-	echo "You need to build XVKBD first, try: cd xvkbd && xmkmf && make"
-	exit -1;
-fi
-fi
+# if [ "$XVKBD_HACKED" != "" ]; then
+# export XVKBD_EXE=${XVKBD:-./xvkbd/xvkbd};
+# if [ ! -x $XVKBD_EXE ]; then
+# 	echo "You need to build XVKBD first, try: cd xvkbd && xmkmf && make"
+# 	exit -1;
+# fi
+# fi
 
 if [ "$(which wmctrl)" == "" ]; then
 echo "You need to install wmctrl first, try:"
@@ -29,7 +29,7 @@ fi
 
 PROGRAM_SUFFIX=$(grep -e '#define PACKAGE ' ../../config.h | sed -e 's/#define PACKAGE "lyx\(.*\)"/\1/')
 
-export XVKBD_EXE=../$XVKBD_EXE
+export XVKBD_EXE=xvkbd
 export KEYTEST=../keytest.py
 LYX_HOME=out-home
 export LYX_USERDIR=$(pwd)/$LYX_HOME/.lyx$PROGRAM_SUFFIX


Re: keytest.py

2017-05-07 Thread Kornel Benko
Am Sonntag, 7. Mai 2017 um 19:35:08, schrieb Tommaso Cucinotta <tomm...@lyx.org>
> On 07/05/2017 14:35, Kornel Benko wrote:
> > Am Sonntag, 7. Mai 2017 um 02:46:31, schrieb Tommaso Cucinotta 
> > <tomm...@lyx.org>
> >> On 06/05/2017 14:15, Kornel Benko wrote:
> >>> Hi Tommaso,
> >>> could you please test this version?
> >>
> >> sure, as soon as I get back to a successful compile of LyX on Ubuntu 17.04 
> >> :(!
> >> (see separate thread)
> >>
> >>T.
> >>
> >
> > OK.
> > I am committing. I feel confident that nothing is going wrong with alpha 
> > release. And since
> > I am probably the only one (apart from you) testing keytests now, it seems 
> > to not bother anyone.
> 
> Ubuntu 17.04 (perhaps my hw is slower [8 y.o. Latitude E6400], so it gives 
> more troubles :-) ):
> 
> findadv-07-in.txt: FAILED
> findadv-08-in.txt: Ok
> findadv-09-in.txt: Ok
> findadv-10-in.txt: Ok
> findadv-11-in.txt: Ok
> findadv-12-in.txt: Ok
> findadv-13-in.txt: FAILED
> findadv-14-in.txt: Ok
> findadv-15-in.txt: FAILED
> findadv-16-in.txt: FAILED
> findadv-17-in.txt: Ok
> findadv-18-in.txt: Ok
> findadv-19-in.txt: Ok
> findadv-20-in.txt: Ok
> findadv-21-in.txt: FAILED
>  findadv-crash-in.txt: Ok
>   findadv-logo-in.txt: FAILED
>  findadv-re-01-in.txt: FAILED
>  findadv-re-02-in.txt: Ok
>  findadv-re-03-in.txt: FAILED
>  findadv-re-04-in.txt: FAILED
>  findadv-re-05-in.txt: Ok
>  findadv-re-06-in.txt: FAILED
>   tabular-footnote-in.txt: Ok
> 
> There were 10 FAILED tests
> 
>   T.

Latitude E6400 should be fast enough (2.27GHz).
Maybe setting def_delay at line keytest.py:374 to some higher value helps?

Do they fail if retested separately too?
Which QT version?

Kornel

signature.asc
Description: This is a digitally signed message part.


Re: keytest.py

2017-05-07 Thread Tommaso Cucinotta

On 07/05/2017 14:35, Kornel Benko wrote:

Am Sonntag, 7. Mai 2017 um 02:46:31, schrieb Tommaso Cucinotta 

On 06/05/2017 14:15, Kornel Benko wrote:

Hi Tommaso,
could you please test this version?


sure, as soon as I get back to a successful compile of LyX on Ubuntu 17.04 :(!
(see separate thread)

T.



OK.
I am committing. I feel confident that nothing is going wrong with alpha 
release. And since
I am probably the only one (apart from you) testing keytests now, it seems to 
not bother anyone.


Ubuntu 17.04 (perhaps my hw is slower [8 y.o. Latitude E6400], so it gives more 
troubles :-) ):

   findadv-07-in.txt: FAILED
   findadv-08-in.txt: Ok
   findadv-09-in.txt: Ok
   findadv-10-in.txt: Ok
   findadv-11-in.txt: Ok
   findadv-12-in.txt: Ok
   findadv-13-in.txt: FAILED
   findadv-14-in.txt: Ok
   findadv-15-in.txt: FAILED
   findadv-16-in.txt: FAILED
   findadv-17-in.txt: Ok
   findadv-18-in.txt: Ok
   findadv-19-in.txt: Ok
   findadv-20-in.txt: Ok
   findadv-21-in.txt: FAILED
findadv-crash-in.txt: Ok
 findadv-logo-in.txt: FAILED
findadv-re-01-in.txt: FAILED
findadv-re-02-in.txt: Ok
findadv-re-03-in.txt: FAILED
findadv-re-04-in.txt: FAILED
findadv-re-05-in.txt: Ok
findadv-re-06-in.txt: FAILED
 tabular-footnote-in.txt: Ok

There were 10 FAILED tests

T.


Re: keytest.py

2017-04-28 Thread Kornel Benko
Am Dienstag, 25. April 2017 um 11:48:14, schrieb Kornel Benko <kor...@lyx.org>
> Am Dienstag, 25. April 2017 um 09:33:24, schrieb Kornel Benko <kor...@lyx.org>
> ...
> > -xvpar.extend(["-window", lyx_window_name, "-delay", actual_delay, 
> > "-text", keystr])
> > +#xvpar.extend(["-window", lyx_window_name, "-delay", actual_delay, 
> > "-text", keystr])
> > +xvpar.extend(["-delay", actual_delay,  "-text", keystr])
>
> Using only this part, I still get 3 extra Tab emits. All tests pass, but
> the test-times increases in following cases:
>
> 12: +6
> logo: +9
> re-05: +10
>

Although I adopted the change (getting rid of '"-window", lyx_window_name' 
parameter for xvkbd), further tests
showed that the mentioned errors are back. Inserting the parameter again, tests 
pass.

Tested back and forth, this behaviour was reliable.
Also the using of (now not needed) parameter '-wait_idle' for xvkbd_hacked can 
be removed.

    Korneldiff --git a/development/autotests/keytest.py b/development/autotests/keytest.py
index f9e64bd..7dd86a6 100755
--- a/development/autotests/keytest.py
+++ b/development/autotests/keytest.py
@@ -207,7 +207,6 @@ def lyx_dead():
 def sendKeystringLocal(keystr, LYX_PID):

 # print "sending keystring "+keystr+"\n"
-
 if not re.match(".*\w.*", keystr):
 print('print .' + keystr + '.\n')
 keystr = 'a'
@@ -239,10 +238,7 @@ def sendKeystringLocal(keystr, LYX_PID):
 xvpar.extend(["-no-jump-pointer"])
 else:
 xvpar.extend(["-xsendevent"])
-if xvkbd_hacked:
-xvpar.extend(["-wait_idle", lyx_pid])
-#xvpar.extend(["-window", lyx_window_name, "-delay", actual_delay, "-text", keystr])
-xvpar.extend(["-delay", actual_delay, "-text", keystr])
+xvpar.extend(["-window", lyx_window_name, "-delay", actual_delay, "-text", keystr])

 print("Sending \"" + keystr + "\"\n")
 subprocess.call(xvpar, stdout = FNULL, stderr = FNULL)
@@ -337,7 +333,6 @@ xvkbd_exe = os.environ.get('XVKBD_EXE')
 if xvkbd_exe is None:
 xvkbd_exe = "xvkbd"

-xvkbd_hacked = os.environ.get('XVKBD_HACKED') != None
 qt_frontend = os.environ.get('QT_FRONTEND')
 if qt_frontend is None:
 qt_frontend = 'QT4'
@@ -470,17 +465,17 @@ while not failed:
 print("result=" + str(result) + ", failed=" + str(failed))
 elif c[0:7] == 'TestEnd':
 #time.sleep(0.5)
-if not lyx_exists():
+if lyx_dead():
 print("LyX instance not found because of crash or assert !\n")
 failed = True
 else:
 print("Forcing quit of lyx instance: " + str(lyx_pid) + "...\n")
 # \Ax Enter command line is sometimes blocked
 	# \[Escape] works after this
-	sendKeystringLocal("\Ax\[Escape]", lyx_pid)
+	sendKeystring("\Ax\[Escape]", lyx_pid)
 	# now we should be outside any dialog
 	# and so the function lyx-quit should work
-sendKeystringLocal("\Cq", lyx_pid)
+sendKeystring("\Cq", lyx_pid)
 time.sleep(0.5)
 if lyx_sleeping():
 # probably waiting for Save/Discard/Abort, we select 'Discard'


signature.asc
Description: This is a digitally signed message part.


Re: keytest.py

2017-04-25 Thread Kornel Benko
Am Dienstag, 25. April 2017 um 09:33:24, schrieb Kornel Benko 
...
> -xvpar.extend(["-window", lyx_window_name, "-delay", actual_delay, 
> "-text", keystr])
> +#xvpar.extend(["-window", lyx_window_name, "-delay", actual_delay, 
> "-text", keystr])
> +xvpar.extend(["-delay", actual_delay,  "-text", keystr])

Using only this part, I still get 3 extra Tab emits. All tests pass, but
the test-times increases in following cases:

12: +6
logo: +9
re-05: +10

Kornel

signature.asc
Description: This is a digitally signed message part.


Re: keytest.py

2017-04-25 Thread Kornel Benko
Am Dienstag, 25. April 2017 um 00:05:52, schrieb Tommaso Cucinotta 
<tomm...@lyx.org>
> Hi,
>
> On 23/04/2017 16:29, Kornel Benko wrote:
> >> \Cq\[Escape]
>
> can't remember why I had the window name explicit in keytest. Do you mind
> trying out the attached one, that removes that ?
>
> The window name forces keys to be sent to the main LyX window, so whenever
> there's a dialog, keytest.py fails to send the key to the dialog, so it's
> impossible to dismiss it or anything. Leaving out that parameter, it seems
> now keys reach the right window with focus within the process.
>
> Also, I'm trying again to close tests with
>
>\Cq\[Tab]\[Enter]
>
> which chooses the middle "Discard" button in case a dialog asking to save
> shows up.

Yes, but it also emits Tab Enter on the active console,
which cases reactions on that console. (Tab in tcsh shows the content of the 
working directory,
in my case I got 6 times the list displayed)

Also, some tests do not receive Cq (at least it looks like waiting to be killed 
at test end)

One test failed

Comparing test time differences:

01:  +4 with patch
08:  +11
12:  +10, extra emit
13:  +9
15:  +3
16:  +4
logo:  +9, extra emit
re-02:  +20
re-04:  failed
re-05:  +9, extra emit
re-06:  +10, extra emit

(The extra emits can stems probably from the previous test-case, I cannot 
decide here exactly)

> Thanks,
>
>   T.

Kornel

signature.asc
Description: This is a digitally signed message part.
1.54 amd64.kornel 8:44 > ctest -R keytest/findadv
Test project /BUILD/BUILDMint17/BuildLyxGitQt5.7main-gcc6.2
  Start 215: keytest/findadv-01
 1/27 Test #215: keytest/findadv-01 ...   Passed   14.40 sec
  Start 216: keytest/findadv-02
 2/27 Test #216: keytest/findadv-02 ...   Passed   15.71 sec
  Start 217: keytest/findadv-03
 3/27 Test #217: keytest/findadv-03 ...   Passed   18.93 sec
  Start 218: keytest/findadv-04
 4/27 Test #218: keytest/findadv-04 ...   Passed   13.57 sec
  Start 219: keytest/findadv-05
 5/27 Test #219: keytest/findadv-05 ...   Passed   20.01 sec
  Start 220: keytest/findadv-06
 6/27 Test #220: keytest/findadv-06 ...   Passed   26.77 sec
  Start 221: keytest/findadv-07
 7/27 Test #221: keytest/findadv-07 ...   Passed   25.18 sec
  Start 222: keytest/findadv-08
 8/27 Test #222: keytest/findadv-08 ...   Passed   58.06 sec
  Start 223: keytest/findadv-09
 9/27 Test #223: keytest/findadv-09 ...   Passed   25.92 sec
  Start 224: keytest/findadv-10
10/27 Test #224: keytest/findadv-10 ...   Passed   20.92 sec
  Start 225: keytest/findadv-11
11/27 Test #225: keytest/findadv-11 ...   Passed   17.71 sec
  Start 226: keytest/findadv-12

12/27 Test #226: keytest/findadv-12 ...   Passed   19.71 sec
  Start 227: keytest/findadv-13
13/27 Test #227: keytest/findadv-13 ...   Passed   22.81 sec
  Start 228: keytest/findadv-14
14/27 Test #228: keytest/findadv-14 ...   Passed   43.38 sec
  Start 229: keytest/findadv-15
15/27 Test #229: keytest/findadv-15 ...   Passed   51.07 sec
  Start 230: keytest/findadv-16
16/27 Test #230: keytest/findadv-16 ...   Passed   29.33 sec
  Start 231: keytest/findadv-17
17/27 Test #231: keytest/findadv-17 ...   Passed   21.67 sec
  Start 232: keytest/findadv-18
18/27 Test #232: keytest/findadv-18 ...   Passed   10.52 sec
  Start 233: keytest/findadv-19
19/27 Test #233: keytest/findadv-19 ...   Passed   12.19 sec
  Start 234: keytest/findadv-20
20/27 Test #234: keytest/findadv-20 ...   Passed   25.19 sec
  Start 235: keytest/findadv-logo

21/27 Test #235: keytest/findadv-logo .   Passed   33.39 sec
  Start 236: keytest/findadv-re-01
22/27 Test #236: keytest/findadv-re-01    Passed   40.17 sec
  Start 237: keytest/findadv-re-02
23/27 Test #237: keytest/findadv-re-02    Passed   60.06 sec
  Start 238: keytest/findadv-re-03
24/27 Test #238: keytest/findadv-re-03    Passed   41.69 sec
  Start 239: keytest/findadv-re-04
25/27 Test #239: keytest/findadv-re-04 ***Failed2.36 sec
  Start 240: keytest/findadv-re-05

26/27 Test #240: keytest/findadv-re-05    Passed   22.97 sec
  Start 241: keytest/findadv-re-06
27/27 Test #241: keytest/findadv-re-06    Passed   23.57 sec

96% tests passed, 1 tests failed out of 27

Label Time Summary:
key= 717.27 sec (27 tests)

Total Test time (real) = 719.61 sec

The following tests FAILED:
239 - keytest/findadv-re-04 (Failed)
Errors while running CTest

1.58 amd64.kornel 9:06 > ctest -R keytest/findadv
Test project /BUILD/BUILDM

Re: keytest.py

2017-04-24 Thread Tommaso Cucinotta

Hi,

On 23/04/2017 16:29, Kornel Benko wrote:

\Cq\[Escape]


can't remember why I had the window name explicit in keytest. Do you mind
trying out the attached one, that removes that ?

The window name forces keys to be sent to the main LyX window, so whenever
there's a dialog, keytest.py fails to send the key to the dialog, so it's
impossible to dismiss it or anything. Leaving out that parameter, it seems
now keys reach the right window with focus within the process.

Also, I'm trying again to close tests with

  \Cq\[Tab]\[Enter]

which chooses the middle "Discard" button in case a dialog asking to save
shows up.

Thanks,

T.
diff --git a/development/autotests/keytest.py b/development/autotests/keytest.py
index 97166847..361d4079 100755
--- a/development/autotests/keytest.py
+++ b/development/autotests/keytest.py
@@ -241,7 +241,8 @@ def sendKeystring(keystr, LYX_PID):
 xvpar.extend(["-xsendevent"])
 if xvkbd_hacked:
 xvpar.extend(["-wait_idle", lyx_pid])
-xvpar.extend(["-window", lyx_window_name, "-delay", actual_delay, "-text", keystr])
+#xvpar.extend(["-window", lyx_window_name, "-delay", actual_delay, "-text", keystr])
+xvpar.extend(["-delay", actual_delay, "-text", keystr])
 
 subprocess.call(xvpar, stdout = FNULL, stderr = FNULL)
 
@@ -441,7 +442,7 @@ while not failed:
 	sendKeystring("\Ax\[Escape]", lyx_pid)
 	# now we should be outside any dialog
 	# and so the function lyx-quit should work
-sendKeystring("\Cq", lyx_pid)
+sendKeystring("\Cq\[Tab]\[Enter]", lyx_pid)
 time.sleep(0.5)
 if lyx_sleeping():
 # probably waiting for Save/Discard/Abort, we select 'Discard'


Re: keytest.py

2017-04-23 Thread Kornel Benko
Am Sonntag, 23. April 2017 um 16:20:48, schrieb Tommaso Cucinotta 

> On 23/04/2017 10:34, Kornel Benko wrote:
> > Prefixing \[Escape] with \Ax does the trick :), e.g.  "\Ax\[Escape]\Cq" 
> > (without \Cs)
> > Sometimes we need to not save the buffer.
> 
> what was the \Ax for, then ?

Normally it is for entering the status line.

> And, if it's for dismissing the (save?) dialog, then shouldn't it be like:
> 
> \Cq\[Escape]
> 
> ?

There are some cases where \Cq is not accepted. We have to leave the dialog 
first (e.g. with escape)
But sometimes also Escape is blocked. Only after the thist \Ax (which may or 
may not be blocked) is Escape accepted.


>   T.

Kornel

signature.asc
Description: This is a digitally signed message part.


Re: keytest.py

2017-04-23 Thread Tommaso Cucinotta

On 23/04/2017 10:34, Kornel Benko wrote:

Prefixing \[Escape] with \Ax does the trick :), e.g.  "\Ax\[Escape]\Cq" 
(without \Cs)
Sometimes we need to not save the buffer.


what was the \Ax for, then ?
And, if it's for dismissing the (save?) dialog, then shouldn't it be like:

\Cq\[Escape]

?

T.



keytest.py

2017-04-21 Thread Kornel Benko
With this patch all findadv tests pass now.

This is result of collaboration with Tommaso. Not important for alpha,
but also no side effects to the rest.

Kornel



signature.asc
Description: This is a digitally signed message part.
diff --git a/development/autotests/bug-export-latex-in.txt b/development/autotests/bug-export-latex-in.txt
index b45c815..9b6ae27 100644
--- a/development/autotests/bug-export-latex-in.txt
+++ b/development/autotests/bug-export-latex-in.txt
@@ -7,6 +7,8 @@ TestBegin -dbg files test.lyx > lyx-log.txt 2>&1
 KK: \Axinfo-insert icon math-mode\[Return]
 KK: \Axbuffer-export luatex\[Return]
 KK: \[Tab]\[Return]
+KK: \Axbuffer-write\[Return]
+KK: \[Tab]\[Return]
 TestEnd
 Lang C
 Assert ! pcregrep -M "support/FileName.cpp .* creating path '/.*/lib/images'" lyx-log.txt
diff --git a/development/autotests/keytest.py b/development/autotests/keytest.py
index 3a60927..f6551e9 100755
--- a/development/autotests/keytest.py
+++ b/development/autotests/keytest.py
@@ -169,12 +169,39 @@ def intr_system(cmd, ignore_err = False):
 raise BaseException("command failed:" + cmd)
 return ret
 
+statreg = re.compile(r'^State:.*\(([a-z]+)\)')
+
+def lyx_status(pid):
+  if lyx_pid is None:
+return "dead"
+  fname = '/proc/' + pid + '/status'
+  try:
+f = open(fname)
+for line in f:
+  m = statreg.match(line)
+  if m:
+status = m.group(1)
+f.close()
+return status
+f.close()
+  except IOError as e:
+ print "I/O error({0}): {1}".format(e.errno, e.strerror)
+ return "dead"
+  except:
+print "Unexpected error:", sys.exc_info()[0]
+  return "dead"
 
 # 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, True)
+return lyx_status(lyx_pid) == "sleeping"
+
+# Return true if LyX (identified via lyx_pid) is zombie
+def lyx_zombie():
+return lyx_status(lyx_pid) == "zombie"
 
+def lyx_dead():
+status = lyx_status(lyx_pid)
+return (status == "dead") or (status == "zombie")
 
 def sendKeystring(keystr, LYX_PID):
 
@@ -365,6 +392,7 @@ while not failed:
 failed = True
 print 'lyx_pid: ' + lyx_pid + '\n'
 print 'lyx_win: ' + lyx_window_name + '\n'
+sendKeystring("\C\[Home]", lyx_pid)
 elif c[0:5] == 'Sleep':
 print "Sleeping for " + c[6:] + " seconds\n"
 time.sleep(float(c[6:]))
@@ -400,15 +428,20 @@ while not failed:
 failed = failed or (result != 0)
 print "result=" + str(result) + ", failed=" + str(failed)
 elif c[0:7] == 'TestEnd':
-time.sleep(0.5)
+#time.sleep(0.5)
 if not lyx_exists():
 print "LyX instance not found because of crash or assert !\n"
 failed = True
 else:
-print "Terminating lyx instance: " + str(lyx_pid) + "\n"
-intr_system("kill -9 " + str(lyx_pid), True);
-while lyx_exists():
-print "Waiting for lyx to die...\n"
+print "Forcing quit of lyx instance: " + str(lyx_pid) + "...\n"
+# intr_system("kill -9 " + str(lyx_pid), True);
+sendKeystring("\Cq", lyx_pid)
+lcount = 0
+while not lyx_dead():
+lcount = lcount + 1
+if lcount > 20:
+print "LyX still up, killing process and waiting for it to die...\n"
+intr_system("kill -9 " + str(lyx_pid), True);
 time.sleep(0.5)
 cmd = c[8:].rstrip()
 print "Executing " + cmd


[PATCH] keytest.py: do not print the same thing twice

2013-02-04 Thread Scott Kostyshak
keytest.py now only prints one time the command that it is executing for
an assert. The command is already printed in the function responsible
for executing it, so it is not necessary to print the command before
calling that function.
---
 development/autotests/keytest.py |1 -
 1 file changed, 1 deletion(-)

diff --git a/development/autotests/keytest.py b/development/autotests/keytest.py
index a48f856..a510a3f 100755
--- a/development/autotests/keytest.py
+++ b/development/autotests/keytest.py
@@ -384,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)
-- 
1.7.9.5



Re: [PATCH] keytest.py: do not print the same thing twice

2013-02-04 Thread Kornel Benko
Am Montag, 4. Februar 2013 um 03:07:13, schrieb Scott Kostyshak 
skost...@lyx.org
 keytest.py now only prints one time the command that it is executing for
 an assert. The command is already printed in the function responsible
 for executing it, so it is not necessary to print the command before
 calling that function.
 ---
  development/autotests/keytest.py |1 -
  1 file changed, 1 deletion(-)
 
 diff --git a/development/autotests/keytest.py 
 b/development/autotests/keytest.py
 index a48f856..a510a3f 100755
 --- a/development/autotests/keytest.py
 +++ b/development/autotests/keytest.py
 @@ -384,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)
 -- 
 1.7.9.5

Good catch. I always was wondering, while the command was displayed twice in 
the logs.

Kornel

signature.asc
Description: This is a digitally signed message part.


Re: [PATCH] keytest.py: do not print the same thing twice

2013-02-04 Thread Scott Kostyshak
On Mon, Feb 4, 2013 at 3:11 AM, Kornel Benko kor...@lyx.org wrote:
 Am Montag, 4. Februar 2013 um 03:07:13, schrieb Scott Kostyshak
 skost...@lyx.org

 keytest.py now only prints one time the command that it is executing for

 an assert. The command is already printed in the function responsible

 for executing it, so it is not necessary to print the command before

 calling that function.

 ---

 development/autotests/keytest.py | 1 -

 1 file changed, 1 deletion(-)



 diff --git a/development/autotests/keytest.py
 b/development/autotests/keytest.py

 index a48f856..a510a3f 100755

 --- a/development/autotests/keytest.py

 +++ b/development/autotests/keytest.py

 @@ -384,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)

 --

 1.7.9.5



 Good catch. I always was wondering, while the command was displayed twice in
 the logs.

The reason I investigated it was that I was worried it was actually
running the command twice. Good thing that wasn't the case.

Fixed at e609787a.

Thanks,

Scott


[PATCH] keytest.py: do not print the same thing twice

2013-02-04 Thread Scott Kostyshak
keytest.py now only prints one time the command that it is executing for
an assert. The command is already printed in the function responsible
for executing it, so it is not necessary to print the command before
calling that function.
---
 development/autotests/keytest.py |1 -
 1 file changed, 1 deletion(-)

diff --git a/development/autotests/keytest.py b/development/autotests/keytest.py
index a48f856..a510a3f 100755
--- a/development/autotests/keytest.py
+++ b/development/autotests/keytest.py
@@ -384,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)
-- 
1.7.9.5



Re: [PATCH] keytest.py: do not print the same thing twice

2013-02-04 Thread Kornel Benko
Am Montag, 4. Februar 2013 um 03:07:13, schrieb Scott Kostyshak 
<skost...@lyx.org>
> keytest.py now only prints one time the command that it is executing for
> an assert. The command is already printed in the function responsible
> for executing it, so it is not necessary to print the command before
> calling that function.
> ---
>  development/autotests/keytest.py |1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/development/autotests/keytest.py 
> b/development/autotests/keytest.py
> index a48f856..a510a3f 100755
> --- a/development/autotests/keytest.py
> +++ b/development/autotests/keytest.py
> @@ -384,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)
> -- 
> 1.7.9.5

Good catch. I always was wondering, while the command was displayed twice in 
the logs.

Kornel

signature.asc
Description: This is a digitally signed message part.


Re: [PATCH] keytest.py: do not print the same thing twice

2013-02-04 Thread Scott Kostyshak
On Mon, Feb 4, 2013 at 3:11 AM, Kornel Benko <kor...@lyx.org> wrote:
> Am Montag, 4. Februar 2013 um 03:07:13, schrieb Scott Kostyshak
> <skost...@lyx.org>
>
>> keytest.py now only prints one time the command that it is executing for
>
>> an assert. The command is already printed in the function responsible
>
>> for executing it, so it is not necessary to print the command before
>
>> calling that function.
>
>> ---
>
>> development/autotests/keytest.py | 1 -
>
>> 1 file changed, 1 deletion(-)
>
>>
>
>> diff --git a/development/autotests/keytest.py
>> b/development/autotests/keytest.py
>
>> index a48f856..a510a3f 100755
>
>> --- a/development/autotests/keytest.py
>
>> +++ b/development/autotests/keytest.py
>
>> @@ -384,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)
>
>> --
>
>> 1.7.9.5
>
>
>
> Good catch. I always was wondering, while the command was displayed twice in
> the logs.

The reason I investigated it was that I was worried it was actually
running the command twice. Good thing that wasn't the case.

Fixed at e609787a.

Thanks,

Scott


Re: keytest.py, undocumented controls

2013-01-25 Thread Scott Kostyshak
On Sat, Jan 12, 2013 at 4:35 AM, Kornel Benko kor...@lyx.org wrote:
 Hi Tommaso,

 I wanted to check the description of controls in hello-world-in.txt with the
 script keytest.py.

 So far, there exist some non-described controls

 Sleep

 Loop

 RaiseLyx

 .

 OK, 'Sleep' was easy.

 But what should 'Loop' do? At least in keytest.py there you can find:

 ...

 elif c == 'Loop':

 outfile.close()

 ...

 ...

 elif c == 'Loop':

 RaiseWindow()

 ...

 For me it looks like the second check will never be reached. This two
 sequences should somehow merge IMHO.

 Still I don't understand the desired usage.



 Kornel

Do Loop and RaiseLyx still need to be documented?

Scott


Re: keytest.py, undocumented controls

2013-01-25 Thread Scott Kostyshak
On Sat, Jan 12, 2013 at 4:35 AM, Kornel Benko <kor...@lyx.org> wrote:
> Hi Tommaso,
>
> I wanted to check the description of controls in hello-world-in.txt with the
> script keytest.py.
>
> So far, there exist some non-described controls
>
> Sleep
>
> Loop
>
> RaiseLyx
>
> .
>
> OK, 'Sleep' was easy.
>
> But what should 'Loop' do? At least in keytest.py there you can find:
>
> ...
>
> elif c == 'Loop':
>
> outfile.close()
>
> ...
>
> ...
>
> elif c == 'Loop':
>
> RaiseWindow()
>
> ...
>
> For me it looks like the second check will never be reached. This two
> sequences should somehow merge IMHO.
>
> Still I don't understand the desired usage.
>
>
>
> Kornel

Do "Loop" and "RaiseLyx" still need to be documented?

Scott


keytest.py, undocumented controls

2013-01-12 Thread Kornel Benko
Hi Tommaso,
I wanted to check the description of controls in hello-world-in.txt with the 
script keytest.py.
So far, there exist some non-described controls
Sleep
Loop
RaiseLyx
.
OK, 'Sleep' was easy.
But what should 'Loop' do? At least in keytest.py there you can find:
...
elif c == 'Loop':
outfile.close()
...
...
elif c == 'Loop':
RaiseWindow()
...
For me it looks like the second check will never be reached. This two sequences 
should somehow merge IMHO.
Still I don't understand the desired usage.

Kornel

signature.asc
Description: This is a digitally signed message part.


keytest.py, undocumented controls

2013-01-12 Thread Kornel Benko
Hi Tommaso,
I wanted to check the description of controls in hello-world-in.txt with the 
script keytest.py.
So far, there exist some non-described controls
Sleep
Loop
RaiseLyx
.
OK, 'Sleep' was easy.
But what should 'Loop' do? At least in keytest.py there you can find:
...
elif c == 'Loop':
outfile.close()
...
...
elif c == 'Loop':
RaiseWindow()
...
For me it looks like the second check will never be reached. This two sequences 
should somehow merge IMHO.
Still I don't understand the desired usage.

Kornel

signature.asc
Description: This is a digitally signed message part.