mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-09 18:31:04 +00:00
autotests: Enable the suffixed lyx to run the test too.
(Hard coded 'lyx' replaced with real lyx-exe-file-name)
This commit is contained in:
parent
66ac0bbd8a
commit
9481d4182e
@ -37,6 +37,7 @@ if(Q_WS_X11)
|
||||
-DPO_BUILD_DIR=${TOP_BINARY_DIR}/po
|
||||
-DKEYTEST_INFILE=${_tf}
|
||||
-DBINDIR=$<TARGET_FILE_DIR:${_lyx}>
|
||||
-DLYX=${_lyx}
|
||||
-DWORKDIR=${CMAKE_CURRENT_BINARY_DIR}/${LYX_HOME}
|
||||
-DKEYTEST_OUTFILE=${_t}-out.txt
|
||||
-DPACKAGE=${PACKAGE}
|
||||
|
@ -258,9 +258,13 @@ PO_BUILD_DIR = os.environ.get('PO_BUILD_DIR')
|
||||
if not PO_BUILD_DIR is None:
|
||||
print "PO_BUILD_DIR = " + PO_BUILD_DIR + "\n"
|
||||
|
||||
lyx = os.environ.get('LYX')
|
||||
if lyx is None:
|
||||
lyx = "lyx"
|
||||
|
||||
lyx_exe = os.environ.get('LYX_EXE')
|
||||
if lyx_exe is None:
|
||||
lyx_exe = "lyx"
|
||||
lyx_exe = lyx
|
||||
|
||||
xvkbd_exe = os.environ.get('XVKBD_EXE')
|
||||
if xvkbd_exe is None:
|
||||
@ -326,12 +330,12 @@ while not failed:
|
||||
print "Ignoring comment line: " + c
|
||||
elif c[0:9] == 'TestBegin':
|
||||
print "\n"
|
||||
lyx_pid=os.popen("pidof lyx").read()
|
||||
lyx_pid=os.popen("pidof " + lyx).read()
|
||||
if lyx_pid != "":
|
||||
print "Found running instance(s) of LyX: " + lyx_pid + ": killing them all\n"
|
||||
intr_system("killall lyx", True)
|
||||
intr_system("killall " + lyx, True)
|
||||
time.sleep(0.5)
|
||||
intr_system("killall -KILL lyx", True)
|
||||
intr_system("killall -KILL " + lyx, True)
|
||||
time.sleep(0.2)
|
||||
print "Starting LyX . . ."
|
||||
if lyx_userdir is None:
|
||||
@ -339,7 +343,7 @@ while not failed:
|
||||
else:
|
||||
intr_system(lyx_exe + " -userdir " + lyx_userdir + " " + c[9:] + "&")
|
||||
while True:
|
||||
lyx_pid=os.popen("pidof lyx").read().rstrip()
|
||||
lyx_pid=os.popen("pidof " + lyx).read().rstrip()
|
||||
if lyx_pid != "":
|
||||
lyx_window_name=os.popen("wmctrl -l -p | grep ' " + str(lyx_pid) + " ' | cut -d ' ' -f 1").read().rstrip()
|
||||
if lyx_window_name != "":
|
||||
|
@ -15,6 +15,7 @@
|
||||
# -DKEYTEST_INFILE=xxxx \
|
||||
# -DKEYTEST_OUTFILE=xxx \
|
||||
# -DBINDIR=xxx \
|
||||
# -DLYX=xxx \
|
||||
# -DWORKDIR=xxx \
|
||||
# -DLOCALE_DIR=xxx \
|
||||
# -DPO_BUILD_DIR=xxx \
|
||||
@ -23,7 +24,7 @@
|
||||
|
||||
set(KEYTEST "${AUTOTEST_ROOT}/keytest.py")
|
||||
|
||||
execute_process(COMMAND pidof lyx OUTPUT_VARIABLE LYX_PID RESULT_VARIABLE pidstat OUTPUT_VARIABLE pidres)
|
||||
execute_process(COMMAND pidof ${LYX} OUTPUT_VARIABLE LYX_PID RESULT_VARIABLE pidstat OUTPUT_VARIABLE pidres)
|
||||
message(STATUS "pidres = ${pidres}")
|
||||
if (NOT pidstat)
|
||||
# lyx already running, remove trailing '\n' from pid
|
||||
@ -44,7 +45,7 @@ else()
|
||||
set(LYX_WINDOW_NAME "")
|
||||
endif()
|
||||
|
||||
set(LYX_EXE "${BINDIR}/lyx")
|
||||
set(LYX_EXE "${BINDIR}/${LYX}")
|
||||
set(XVKBD_EXE "${BINDIR}/xvkbd")
|
||||
|
||||
# Environments needed by keytest.py
|
||||
@ -55,6 +56,7 @@ set(ENV{LYX_USERDIR} ${WORKDIR})
|
||||
set(ENV{LYX_PID} ${pidres})
|
||||
set(ENV{LYX_WINDOW_NAME} ${LYX_WINDOW_NAME})
|
||||
set(ENV{LYX_EXE} ${LYX_EXE})
|
||||
set(ENV{LYX} ${LYX})
|
||||
set(ENV{XVKBD_EXE} ${XVKBD_EXE})
|
||||
set(ENV{KEYTEST_INFILE} "${AUTOTEST_ROOT}/${KEYTEST_INFILE}")
|
||||
set(ENV{KEYTEST_OUTFILE} "${WORKDIR}/${KEYTEST_OUTFILE}")
|
||||
|
Loading…
Reference in New Issue
Block a user