Il 01/02/2011 01:44, Pavel Sanda ha scritto:
if autotest are to be used by wider audience then we should not
depend on switches to other languages (unless we are testing exactly
this).
Just thinking aloud: I design my test cases by exploiting the italian
set-up, and I'd like that, if you try those test-cases, they be executed
with an Italian set-up as well (because, if I execute that in German or
France, then the key bindings would change and make it fail). I thought
setting LANG would have been sufficient, but probably it is not.
Equally, you can design other scripts with your own set-up, and still on
my machine it would be executed in your native language.
If you're really sure you wrote a test-case which does not depend on any
specific LANG settings, e.g., you're doing every action by LFUN, then
you can skip entirely a "Lang" command at the beginning of it :-).
I mean, setting the Lang doesn't seem me to preclude at all the
possibilities. Just need to fix what else is needed in order to have the
test run properly on a non-Italian machine (I have to find an English
installation somewhere and try).
i also think it would be much more robust to use lfuns like buffer-save
than alt+f + s and so on...
That is still possible, but it achieves a different goal: if you
dispatch the LFUN, you test the LFUN in itself. If you emulate the user
behavior, then you test the LFUN combined with the GUI code. For
example, qt4/FindAndReplace.cpp contains code for cycling through
documents, that dispatches multiple LFUNs for searching across them, in
reaction to a single user interaction (Find Next). These are 2 different
types of test and both of them make sense, AFAICS. Still, in the current
scripts you can base everything on \Axwhatever, if you wish.
Unfortunately, in the supplied args to the FINDADV LFUN, there are the
search and replace buffers :-(, which are entire LyX documents. It would
be far more burdening to provide those .lyx contents in the script,
rather than typing the few key presses that create them from scratch
using the GUI :-).
There is only a minor issue coming to my mind: if you start LyX without
any filename, it won't react to "Alt+x", and it will not allow you to
dispatch LFUN via the mini-buffer :-). I guess a proper use of the
lyxserver would allow this, instead. You would issue a "\Cn" (Ctrl+n) or
"\Afn" (menu File->New) to create a new document and start the test, but
are we really sure that in every language these sequences will create a
new document ?
I don't know whether you share at least partially the above.
T.