From 9481d4182e225012632cc36a7cbc77e4beaf3d0e Mon Sep 17 00:00:00 2001 From: Kornel Benko Date: Sat, 5 Jan 2013 10:07:37 +0100 Subject: [PATCH] autotests: Enable the suffixed lyx to run the test too. (Hard coded 'lyx' replaced with real lyx-exe-file-name) --- development/autotests/CMakeLists.txt | 1 + development/autotests/keytest.py | 14 +++++++++----- development/autotests/single-test.cmake | 6 ++++-- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/development/autotests/CMakeLists.txt b/development/autotests/CMakeLists.txt index 3901ffdbd3..d611307e3a 100644 --- a/development/autotests/CMakeLists.txt +++ b/development/autotests/CMakeLists.txt @@ -37,6 +37,7 @@ if(Q_WS_X11) -DPO_BUILD_DIR=${TOP_BINARY_DIR}/po -DKEYTEST_INFILE=${_tf} -DBINDIR=$ + -DLYX=${_lyx} -DWORKDIR=${CMAKE_CURRENT_BINARY_DIR}/${LYX_HOME} -DKEYTEST_OUTFILE=${_t}-out.txt -DPACKAGE=${PACKAGE} diff --git a/development/autotests/keytest.py b/development/autotests/keytest.py index 82f316cce1..f403fdc99e 100755 --- a/development/autotests/keytest.py +++ b/development/autotests/keytest.py @@ -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 != "": diff --git a/development/autotests/single-test.cmake b/development/autotests/single-test.cmake index 15b96ea863..d09bc5afa7 100755 --- a/development/autotests/single-test.cmake +++ b/development/autotests/single-test.cmake @@ -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}") -- 2.39.2