2012-12-11 14:17:04 +00:00
|
|
|
# This file is part of LyX, the document processor.
|
|
|
|
# Licence details can be found in the file COPYING.
|
|
|
|
#
|
|
|
|
# Copyright (c) 2012 Kornel Benko kornel@lyx.org
|
|
|
|
#
|
|
|
|
|
2012-12-12 17:23:25 +00:00
|
|
|
if(Q_WS_X11)
|
|
|
|
# Make sure, the needed programs are in PATH
|
|
|
|
find_program(PCREGREP_EXE "pcregrep")
|
|
|
|
find_program(WMCTRL_EXE "wmctrl")
|
|
|
|
# This is needed to build xvkbd
|
|
|
|
# Programs pcregrep wmctrl and xvkbd are used in subsequent scripts
|
|
|
|
# while testing
|
2012-12-11 15:00:59 +00:00
|
|
|
find_package(X11)
|
2012-12-12 17:23:25 +00:00
|
|
|
if(X11_FOUND AND PCREGREP_EXE AND WMCTRL_EXE)
|
2012-12-13 11:38:38 +00:00
|
|
|
#message(STATUS "PCREGREP_EXE and WMCTRL_EXE found")
|
2012-12-11 15:00:59 +00:00
|
|
|
project(autotests)
|
2012-12-11 14:17:04 +00:00
|
|
|
|
2012-12-11 15:00:59 +00:00
|
|
|
add_subdirectory(xvkbd)
|
2012-12-11 14:17:04 +00:00
|
|
|
|
2012-12-11 15:00:59 +00:00
|
|
|
set(KEYTEST "${CMAKE_CURRENT_SOURCE_DIR}/keytest.py")
|
|
|
|
set(LYX_HOME "out-home")
|
|
|
|
set(LYX_USERDIR "${CMAKE_CURRENT_BINARY_DIR}/${LYX_HOME}/.lyx")
|
|
|
|
set(LOCALE_DIR "${CMAKE_CURRENT_BINARY_DIR}/locale")
|
|
|
|
file(GLOB TESTST RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "*-in.txt")
|
|
|
|
file(GLOB TESTSS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "*-in.sh")
|
|
|
|
list(REMOVE_ITEM TESTST hello-world-in.txt first-time-in.txt)
|
|
|
|
list(SORT TESTST)
|
|
|
|
file(MAKE_DIRECTORY "${LYX_USERDIR}" "${LOCALE_DIR}")
|
2012-12-11 14:17:04 +00:00
|
|
|
|
2012-12-11 15:00:59 +00:00
|
|
|
foreach(_tf first-time-in.txt hello-world-in.txt ${TESTST})
|
|
|
|
string(REGEX REPLACE "-in\\.(txt|sh)" "" _t ${_tf})
|
2012-12-13 14:35:04 +00:00
|
|
|
add_test(NAME "autotests/${_t}"
|
2012-12-11 15:00:59 +00:00
|
|
|
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/${LYX_HOME}"
|
|
|
|
COMMAND ${CMAKE_COMMAND}
|
2012-12-11 14:17:04 +00:00
|
|
|
-DAUTOTEST_ROOT=${TOP_SRC_DIR}/development/autotests
|
2012-12-12 13:54:38 +00:00
|
|
|
-DPO_BUILD_DIR=${TOP_BINARY_DIR}/po
|
2012-12-11 14:17:04 +00:00
|
|
|
-DKEYTEST_INFILE=${_tf}
|
2012-12-14 11:23:17 +00:00
|
|
|
-DBINDIR=$<TARGET_FILE_DIR:${_lyx}>
|
2012-12-11 14:17:04 +00:00
|
|
|
-DWORKDIR=${CMAKE_CURRENT_BINARY_DIR}/${LYX_HOME}
|
|
|
|
-DKEYTEST_OUTFILE=${_t}-out.txt
|
2012-12-12 13:54:38 +00:00
|
|
|
-DPACKAGE=${PACKAGE}
|
|
|
|
-DLOCALE_DIR=${LOCALE_DIR}
|
2012-12-11 14:17:04 +00:00
|
|
|
-P ${TOP_SRC_DIR}/development/autotests/single-test.cmake)
|
2012-12-11 15:00:59 +00:00
|
|
|
endforeach()
|
|
|
|
endif()
|
2012-12-11 14:17:04 +00:00
|
|
|
endif()
|
2012-12-13 11:38:38 +00:00
|
|
|
|
|
|
|
file(GLOB lyx_files RELATIVE "${TOP_SRC_DIR}/lib/doc" "${TOP_SRC_DIR}/lib/doc/*.lyx")
|
|
|
|
foreach(f ${lyx_files})
|
|
|
|
# Strip extension
|
|
|
|
string(REGEX REPLACE "\\.lyx$" "" f ${f})
|
2012-12-13 14:35:04 +00:00
|
|
|
add_test(NAME autotests/export_${f}_lyx16
|
2012-12-13 11:38:38 +00:00
|
|
|
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/${LYX_HOME}"
|
|
|
|
COMMAND ${CMAKE_COMMAND} -DLYX_ROOT=${TOP_SRC_DIR}/lib/doc
|
2012-12-14 11:23:17 +00:00
|
|
|
-Dlyx=$<TARGET_FILE:${_lyx}>
|
2012-12-13 11:38:38 +00:00
|
|
|
-Dformat=lyx16x
|
|
|
|
-Dextension=16.lyx
|
|
|
|
-Dfile=${f}
|
|
|
|
-P "${TOP_SRC_DIR}/development/autotests/export.cmake")
|
2012-12-13 14:35:04 +00:00
|
|
|
add_test(NAME autotests/export_${f}_xhtml
|
2012-12-13 11:38:38 +00:00
|
|
|
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/${LYX_HOME}"
|
|
|
|
COMMAND ${CMAKE_COMMAND} -DLYX_ROOT=${TOP_SRC_DIR}/lib/doc
|
2012-12-14 11:23:17 +00:00
|
|
|
-Dlyx=$<TARGET_FILE:${_lyx}>
|
2012-12-13 11:38:38 +00:00
|
|
|
-Dformat=xhtml
|
|
|
|
-Dextension=xhtml
|
|
|
|
-Dfile=${f}
|
|
|
|
-P "${TOP_SRC_DIR}/development/autotests/export.cmake")
|
|
|
|
endforeach()
|
|
|
|
|
|
|
|
|