Make tests for QT5 and QT4 work.

Changing *-in.txt due to erroneous shortcuts in it.po
keytest.py, single-test.cmake and CMakeLists.txt now
provide a frontend hint for xvkbd.
This commit is contained in:
Kornel Benko 2015-03-17 17:36:47 +01:00
parent ba0b847040
commit 034d5632a2
17 changed files with 64 additions and 56 deletions

View File

@ -105,6 +105,7 @@ if(QT_USES_X11)
-DLYX_USERDIR_VER=${LYX_USERDIR_VER}
-DKEYTEST_OUTFILE=${_t}-out.txt
-DPACKAGE=${PACKAGE}
-DFRONTEND=${LYX_USE_QT}
-DLOCALE_DIR=${LOCALE_DIR}
-P ${TOP_SRC_DIR}/development/autotests/single-test.cmake)
settestlabel(keytest/${_t} "key")

View File

@ -1,23 +1,23 @@
# Basic test for format-aware searching
#
Lang it_IT.utf8
Lang sk_SK.utf8
TestBegin test.lyx -dbg find > lyx-log.txt 2>&1
KK: foo \Cefoo foo\Ce foo\C\[Home]
KK: \Cs
KK: \CF
# Uncheck ignore format
KK: \Az\Ag\Ae
KK: \At\Ai\Ah
KK: \Ce
KK: foo\[Return]
TestEnd
Lang C
Assert pcregrep -M 'Putting selection at .*idx: 0 par: 0 pos: 4\n with len: 3' lyx-log.txt
Lang it_IT.utf8
Lang sk_SK.utf8
TestBegin test.lyx -dbg find > lyx-log.txt 2>&1
KK: \CF
# Uncheck ignore format
KK: \Az\Ag\Ae
KK: \At\Ai\Ah
KK: \Ce
KK: foo\[Return]\[Return]
TestEnd

View File

@ -1,6 +1,6 @@
# Test for searching with regular expressions
Lang it_IT.utf8
Lang sk_SK.utf8
TestBegin test.lyx -dbg find > lyx-log.txt 2>&1
KK: \Apb
KK: one\[Return]
@ -9,18 +9,18 @@ KK: three\C\[Home]
KK: \Cs
KK: \CF
# Uncheck ignore format
KK: \Az\Ag\Ae
KK: \At\Ai\Ah
KK: \Apb
KK: \Axregexp-mode\[Return][a-z]* \[Return]
TestEnd
Lang C
Assert pcregrep -M 'Putting selection at .*idx: 0 par: 0 pos: 0\n with len: 3' lyx-log.txt
Lang it_IT.utf8
Lang sk_SK.utf8
TestBegin test.lyx -dbg find > lyx-log.txt 2>&1
KK: \CF
# Uncheck ignore format
KK: \Az\Ag\Ae
KK: \At\Ai\Ah
KK: \Apb
KK: \Axregexp-mode\[Return][a-z]* \[Return]\[Return]
TestEnd

View File

@ -1,24 +1,24 @@
# Test for searching the special LyX and LaTeX words
# when ignoring format
Lang it_IT.utf8
Lang sk_SK.utf8
TestBegin test.lyx -dbg find > lyx-log.txt 2>&1
KK: This is LyX,\[Return]
KK: a WYSIWYG LaTeX editor.\C\[Home]
KK: \Cs
KK: \CF
# Uncheck ignore format (depends on IT language)
KK: \Az\Ag\Ae
KK: \At\Ai\Ah
KK: LyX\[Return]
TestEnd
Lang C
Assert pcregrep -M 'Putting selection at .*idx: 0 par: 0 pos: 8\n with len: 3' lyx-log.txt
Lang it_IT.utf8
Lang sk_SK.utf8
TestBegin test.lyx -dbg find > lyx-log.txt 2>&1
KK: \CF
# Uncheck ignore format
KK: \Az\Ag\Ae
KK: \At\Ai\Ah
KK: LaTeX\[Return]
TestEnd
Lang C

View File

@ -12,12 +12,12 @@ TestEnd
Lang C
Assert pcregrep -M 'Putting selection at .*idx: 0 par: 0 pos: 0\n.*idx: 0 par: 0 pos: 0\n.*idx: 1 par: 0 pos: 0\n with len: 1' lyx-log.txt
Lang it_IT.utf8
Lang sk_SK.utf8
TestBegin test.lyx -dbg find > lyx-log.txt 2>&1
KK: \C\[Home]
KK: \CF
# Uncheck ignore format
KK: \Az\Ag\Ae
KK: \At\Ai\Ah
KK: \Cm
KK: v\[Return]
TestEnd

View File

@ -1,24 +1,24 @@
# Finding displayed maths with ignore-format on&off (might affect #7596)
#
Lang it_IT.utf8
Lang sk_SK.utf8
TestBegin test.lyx -dbg find > lyx-log.txt 2>&1
KK: \Axmath-display\[Return]
KK: x^2 +x^2\C\[Home]
KK: \Cs
KK: \CF
# Uncheck ignore format
KK: \Az\Ag\Ae
KK: \At\Ai\Ah
KK: \Axmath-display\[Return]
KK: x^2\[Return]
TestEnd
Lang C
Assert pcregrep -M 'Putting selection at .*idx: 0 par: 0 pos: 0\n.*idx: 0 par: 0 pos: 0\n with len: 1' lyx-log.txt
Lang it_IT.utf8
Lang sk_SK.utf8
TestBegin test.lyx -dbg find > lyx-log.txt 2>&1
KK: \CF
# Uncheck ignore format
KK: \Az\Ag\Ae
KK: \At\Ai\Ah
KK: \Axmath-display\[Return]
KK: x^2\[Return]\[Return]
TestEnd

View File

@ -1,24 +1,24 @@
# Finding numbered maths with ignore-format on&off (might affect #7596)
#
Lang it_IT.utf8
Lang sk_SK.utf8
TestBegin test.lyx -dbg find > lyx-log.txt 2>&1
KK: \CM\Axmath-number-toggle\[Return]
KK: x^2 +x^2\C\[Home]
KK: \Cs
KK: \CF
# Uncheck ignore format
KK: \Az\Ag\Ae
KK: \At\Ai\Ah
KK: \CM\Axmath-number-toggle\[Return]
KK: x^2\[Return]
TestEnd
Lang C
Assert pcregrep -M 'Putting selection at .*idx: 0 par: 0 pos: 0\n.*idx: 0 par: 0 pos: 0\n with len: 1' lyx-log.txt
Lang it_IT.utf8
Lang sk_SK.utf8
TestBegin test.lyx -dbg find > lyx-log.txt 2>&1
KK: \CF
# Uncheck ignore format
KK: \Az\Ag\Ae
KK: \At\Ai\Ah
KK: \CM\Axmath-number-toggle\[Return]
KK: x^2\[Return]\[Return]
TestEnd

View File

@ -1,25 +1,25 @@
# Verify matches in *-environments with ignore-format off
# (gather environment comes in the *-form after mutate)
#
Lang it_IT.utf8
Lang sk_SK.utf8
TestBegin test.lyx -dbg find > lyx-log.txt 2>&1
KK: \CM\Axmath-mutate gather\[Return]
KK: x^2 +x^2\C\[Home]
KK: \Cs
KK: \CF
# Uncheck ignore format
KK: \Az\Ag\Ae
KK: \At\Ai\Ah
KK: \CM\Axmath-mutate gather\[Return]
KK: x^2\[Return]
TestEnd
Lang C
Assert pcregrep -M 'Putting selection at .*idx: 0 par: 0 pos: 0\n.*idx: 0 par: 0 pos: 0\n with len: 1' lyx-log.txt
Lang it_IT.utf8
Lang sk_SK.utf8
TestBegin test.lyx -dbg find > lyx-log.txt 2>&1
KK: \CF
# Uncheck ignore format
KK: \Az\Ag\Ae
KK: \At\Ai\Ah
KK: \CM\Axmath-mutate gather\[Return]
KK: x^2\[Return]\[Return]
TestEnd

View File

@ -10,11 +10,11 @@ TestEnd
Lang C
Assert pcregrep -M 'Putting selection at .*idx: 0 par: 0 pos: 0\n.*idx: 0 par: 0 pos: 1\n with len: 2' lyx-log.txt
Lang it_IT.utf8
Lang sk_SK.utf8
TestBegin test.lyx -dbg find > lyx-log.txt 2>&1
KK: \CF
# Uncheck ignore format
KK: \Az\Ag\Ae
KK: \At\Ai\Ah
KK: \Cm\\beta\\alpha \[Return]
TestEnd
Lang C

View File

@ -10,11 +10,11 @@ TestEnd
Lang C
Assert pcregrep -M 'Putting selection at .*idx: 0 par: 0 pos: 1\n with len: 1' lyx-log.txt
#
Lang it_IT.utf8
Lang sk_SK.utf8
TestBegin test.lyx -dbg find > lyx-log.txt 2>&1
KK: \CF
# Uncheck ignore format
KK: \Az\Ag\Ae
KK: \At\Ai\Ah
KK: \Axregexp-mode\[Return]\\(\[Return]
TestEnd
Lang C
@ -30,11 +30,11 @@ TestEnd
Lang C
Assert pcregrep -M 'Putting selection at .*idx: 0 par: 0 pos: 3\n with len: 1' lyx-log.txt
#
Lang it_IT.utf8
Lang sk_SK.utf8
TestBegin test.lyx -dbg find > lyx-log.txt 2>&1
KK: \CF
# Uncheck ignore format
KK: \Az\Ag\Ae
KK: \At\Ai\Ah
KK: \Axregexp-mode\[Return]\\[\[Return]
TestEnd
Lang C

View File

@ -10,11 +10,11 @@ TestEnd
Lang C
Assert pcregrep -M 'Putting selection at .*idx: 0 par: 0 pos: 0\n with len: 1' lyx-log.txt
#
Lang it_IT.utf8
Lang sk_SK.utf8
TestBegin test.lyx -dbg find > lyx-log.txt 2>&1
KK: \CF
# Uncheck ignore format
KK: \Az\Ag\Ae
KK: \At\Ai\Ah
KK: \Axregexp-mode\[Return]\\\\\[Return]
TestEnd
Lang C
@ -30,11 +30,11 @@ TestEnd
Lang C
Assert pcregrep -M 'Putting selection at .*idx: 0 par: 0 pos: 7\n with len: 1' lyx-log.txt
#
Lang it_IT.utf8
Lang sk_SK.utf8
TestBegin test.lyx -dbg find > lyx-log.txt 2>&1
KK: \CF
# Uncheck ignore format
KK: \Az\Ag\Ae
KK: \At\Ai\Ah
KK: \Axregexp-mode\[Return]%\[Return]
TestEnd
Lang C
@ -50,11 +50,11 @@ TestEnd
Lang C
Assert pcregrep -M 'Putting selection at .*idx: 0 par: 0 pos: 8\n with len: 1' lyx-log.txt
#
Lang it_IT.utf8
Lang sk_SK.utf8
TestBegin test.lyx -dbg find > lyx-log.txt 2>&1
KK: \CF
# Uncheck ignore format
KK: \Az\Ag\Ae
KK: \At\Ai\Ah
KK: \Axregexp-mode\[Return]\\^\[Return]
TestEnd
Lang C

View File

@ -10,11 +10,11 @@ TestEnd
Lang C
Assert pcregrep -M 'Putting selection at .*idx: 0 par: 0 pos: 5\n with len: 1' lyx-log.txt
#
Lang it_IT.utf8
Lang sk_SK.utf8
TestBegin test.lyx -dbg find > lyx-log.txt 2>&1
KK: \CF
# Uncheck ignore format
KK: \Az\Ag\Ae
KK: \At\Ai\Ah
KK: \Axregexp-mode\[Return]\\{\[Return]
TestEnd
Lang C
@ -30,11 +30,11 @@ TestEnd
Lang C
Assert pcregrep -M 'Putting selection at .*idx: 0 par: 0 pos: 6\n with len: 1' lyx-log.txt
#
Lang it_IT.utf8
Lang sk_SK.utf8
TestBegin test.lyx -dbg find > lyx-log.txt 2>&1
KK: \CF
# Uncheck ignore format
KK: \Az\Ag\Ae
KK: \At\Ai\Ah
KK: \Axregexp-mode\[Return]\\}\[Return]
TestEnd
Lang C

View File

@ -1,12 +1,12 @@
# Finding styles with regexp
Lang it_IT.utf8
Lang sk_SK.utf8
TestBegin test.lyx -dbg find > lyx-log.txt 2>&1
KK: Hello \CeHello\C\[Home]
KK: \Cs
KK: \CF
# Uncheck ignore format (depends on IT language)
KK: \Az\Ag\Ae
KK: \At\Ai\Ah
KK: \Ce\Axregexp-mode\[Return].*\[Return]
TestEnd
Lang C

View File

@ -1,11 +1,11 @@
# Finding regexps within \frac{}
Lang it_IT.utf8
Lang sk_SK.utf8
TestBegin test.lyx -dbg find > lyx-log.txt 2>&1
KK: \Cm\\frac 1-x\[Down]1+x^2 \C\[Home]
KK: \CF
# Uncheck ignore format (depends on IT language)
KK: \Az\Ag\Ae
KK: \At\Ai\Ah
KK: \Cm\\frac \Axregexp-mode\[Return].* \[Down]1+x^2 \[Return]
TestEnd
Lang C

View File

@ -55,9 +55,8 @@
# LaTeX, and verifies that the typed characters are indeed present in the
# exported document.
#
TestBegin test.lyx > lyx-log.txt 2>&1
TestBegin test.lyx -dbg key > lyx-log.txt 2>&1
KK: Hello World
KK: \Cs
KK: \Ax
KK: buffer-export latex\[Return]
KK: \Axbuffer-export latex\[Return]
TestEnd grep "Hello World" test.tex

View File

@ -209,20 +209,23 @@ def sendKeystring(keystr, LYX_PID):
actual_delay = key_delay
if actual_delay == '':
actual_delay = def_delay
if not xvkbd_hacked:
subprocess.call([xvkbd_exe, "-xsendevent", "-window", lyx_window_name,
"-delay", actual_delay, "-text", keystr], stdout = FNULL, stderr = FNULL)
xvpar = [xvkbd_exe]
if qt_frontend == 'QT5':
xvpar.extend(["-no-jump-pointer"])
else:
subprocess.call([xvkbd_exe, "-no_root", "-wait_idle", lyx_pid,
"-xsendevent", "-window", lyx_window_name,
"-delay", actual_delay, "-text", keystr], stdout = FNULL, stderr = FNULL)
xvpar.extend(["-xsendevent"])
if xvkbd_hacked:
xvpar.extend(["-wait_idle", lyx_pid])
xvpar.extend(["-window", lyx_window_name, "-delay", actual_delay, "-text", keystr])
subprocess.call(xvpar, stdout = FNULL, stderr = FNULL)
def system_retry(num_retry, cmd):
i = 0
rtn = intr_system(cmd)
while ( ( i < num_retry ) and ( rtn != 0) ):
i = i + 1
rtn = intr_system(cmd)
rtn = intr_system(cmd)
time.sleep(1)
if ( rtn != 0 ):
print "Command Failed: "+cmd
@ -271,6 +274,9 @@ 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'
locale_dir = os.environ.get('LOCALE_DIR')
if locale_dir is None:

View File

@ -23,6 +23,7 @@
# -DLOCALE_DIR=xxx \
# -DPO_BUILD_DIR=xxx \
# -DPACKAGE=xxx \
# -DFRONTEND=Qt? \
# -P ${AUTOTEST_ROOT}/single-test.cmake
set(KEYTEST "${AUTOTEST_ROOT}/keytest.py")
@ -74,6 +75,7 @@ if(use_hacked)
else()
set(XVKBD_EXE "/usr/bin/xvkbd")
endif()
set(ENV{QT_FRONTEND} ${FRONTEND})
if(EXISTS "${LYX_TESTS_USERDIR}/session")
execute_process(COMMAND ${CMAKE_COMMAND} -E remove -f "${LYX_TESTS_USERDIR}/session")