From eede49939921c0f2741a4ac3a5b0d71d8b83f96b Mon Sep 17 00:00:00 2001 From: Tommaso Cucinotta Date: Sun, 6 Feb 2011 23:14:49 +0000 Subject: [PATCH] Allowed to set the default typing delay via environment variable. Improved documentation of usage. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37523 a592a061-630c-0410-9148-cb99ea01b6c8 --- development/autotests/README | 13 +++++++++++++ development/autotests/hello-world-in.txt | 3 +++ development/autotests/keytest.py | 5 ++++- 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/development/autotests/README b/development/autotests/README index 6f437cdc7c..62fa6c27a4 100644 --- a/development/autotests/README +++ b/development/autotests/README @@ -37,6 +37,19 @@ as argument to the run-tests.sh script, e.g.: For failed tests you get a folder with the logs that help you identify the problem. +Despite the efforts to avoid it, sometimes a test fails simply because +the key presses provided to the process are someway lost due to slow +hardware, slow window manager, too beautiful and animated desktop,... +When this happens, the tests should be run with a higher delay among +key presses. The default of 100 milliseconds can be changed by setting +the XVKBD_DELAY environment variable. + +The standard xvkbd available on your system may be used to run the +tests. However, a custom xvkbd may optionally be used that forbids the +testing framework to type into non-LyX windows and may mitigate the +issue described right above. This option can be activated by defining +the XVKBD_HACKED environment variable to any value. + SYNTAX ---------------------------------------------------------------------- diff --git a/development/autotests/hello-world-in.txt b/development/autotests/hello-world-in.txt index cda460b7f9..95b872b770 100644 --- a/development/autotests/hello-world-in.txt +++ b/development/autotests/hello-world-in.txt @@ -44,6 +44,9 @@ # \[Tab] ........ sends a Tab character # \[Return] ..... sends a Return # +# KD: n +# Changes the delay among typed charactes to n milliseconds. +# # # This example instructs LyX to type "Hello World", then exports it as # LaTeX, and verifies that the typed characters are indeed present in the diff --git a/development/autotests/keytest.py b/development/autotests/keytest.py index 138342f365..c247c01c54 100755 --- a/development/autotests/keytest.py +++ b/development/autotests/keytest.py @@ -20,7 +20,6 @@ print 'Beginning keytest.py' FNULL = open('/dev/null', 'w') -def_delay = '60' key_delay = '' class CommandSource: @@ -262,6 +261,10 @@ if xvkbd_exe is None: xvkbd_hacked = os.environ.get('XVKBD_HACKED') != None +def_delay = os.environ.get('XVKBD_DELAY') +if def_delay is None: + def_delay = '100' + file_new_command = os.environ.get('FILE_NEW_COMMAND') if file_new_command is None: file_new_command = "\Afn"