Export tests in cmake build: Do not use the default userdir while

running lyx.
This commit is contained in:
Kornel Benko 2013-07-23 21:42:44 +02:00
parent f43e38fa9f
commit 33f23ae8e5
2 changed files with 9 additions and 7 deletions

View File

@ -59,7 +59,7 @@ if(Q_WS_X11)
endif()
if(Missing)
message(STATUS "Missing libraries or programs to create xvkbd: ${Missing}")
message(STATUS "Missing Libraries or programms to create xvkbd: ${Missing}")
message(STATUS "cmake build is therefore omiting autotests")
endif()
@ -81,14 +81,14 @@ if(Q_WS_X11)
foreach(_tf first-time-in.txt hello-world-in.txt ${TESTST})
string(REGEX REPLACE "-in\\.(txt|sh)" "" _t ${_tf})
add_test(NAME autotests/${_t}
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/${LYX_HOME}"
COMMAND ${CMAKE_COMMAND}
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/${LYX_HOME}"
COMMAND ${CMAKE_COMMAND}
-DAUTOTEST_ROOT=${TOP_SRC_DIR}/development/autotests
-DPO_BUILD_DIR=${TOP_BINARY_DIR}/po
-DKEYTEST_INFILE=${_tf}
-DBINDIR=$<TARGET_FILE_DIR:${_lyx}>
-DLYX=${_lyx}
-DWORKDIR=${CMAKE_CURRENT_BINARY_DIR}/${LYX_HOME}
-DLYX=${_lyx}
-DWORKDIR=${CMAKE_CURRENT_BINARY_DIR}/${LYX_HOME}
-DKEYTEST_OUTFILE=${_t}-out.txt
-DPACKAGE=${PACKAGE}
-DLOCALE_DIR=${LOCALE_DIR}
@ -137,6 +137,7 @@ foreach(libsubfolder doc examples templates)
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/${LYX_HOME}"
COMMAND ${CMAKE_COMMAND} -DLYX_ROOT=${LIBSUB_SRC_DIR}
-Dlyx=$<TARGET_FILE:${_lyx}>
-DWORKDIR=${CMAKE_CURRENT_BINARY_DIR}/${LYX_HOME}
-Dformat=lyx16x
-Dextension=16.lyx
-Dfile=${f}
@ -155,4 +156,3 @@ foreach(libsubfolder doc examples templates)
endforeach()
endforeach()

View File

@ -4,7 +4,7 @@
# Copyright (c) 2012 Kornel Benko kornel@lyx.org
#
#
# LYX_ROOT = ${TOP_SRC_DIR}/lib/doc
# LYX_ROOT = ${TOP_SRC_DIR}/lib/{doc,examples,templates}
# lyx =
# format = lyx16x|xhtml
# extension = 16.lyx|xhtml
@ -12,6 +12,7 @@
#
# Script should be called like:
# cmake -DLYX_ROOT=xxx \
# -DWORKDIR=${BUILD_DIR}/autotests/out-home
# -Dlyx=xxx \
# -Dformat=xxx \
# -Dextension=xxx \
@ -20,6 +21,7 @@
#
message(STATUS "Executing ${lyx} -E ${format} ${file}.${extension} ${LYX_ROOT}/${file}.lyx")
set(ENV{LYX_USERDIR} "${WORKDIR}/.lyx")
execute_process(COMMAND ${CMAKE_COMMAND} -E remove ${file}.${extension})
execute_process(
COMMAND ${lyx} -E ${format} ${file}.${extension} "${LYX_ROOT}/${file}.lyx"