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
|
|
|
|
#
|
|
|
|
|
2013-08-22 22:31:54 +00:00
|
|
|
set(LYX_HOME "out-home")
|
|
|
|
set(LOCALE_DIR "${CMAKE_CURRENT_BINARY_DIR}/locale")
|
2013-08-26 20:02:20 +00:00
|
|
|
file(MAKE_DIRECTORY "${LOCALE_DIR}" "${CMAKE_CURRENT_BINARY_DIR}/${LYX_HOME}")
|
2013-08-22 22:31:54 +00:00
|
|
|
|
2014-05-25 11:50:18 +00:00
|
|
|
if(QT_USES_X11)
|
2013-07-04 17:01:51 +00:00
|
|
|
set(Missing)
|
2013-07-23 18:42:31 +00:00
|
|
|
set(XVFBDLIBS)
|
2012-12-12 17:23:25 +00:00
|
|
|
# Make sure, the needed programs are in PATH
|
|
|
|
find_program(PCREGREP_EXE "pcregrep")
|
2013-07-04 17:01:51 +00:00
|
|
|
if (NOT PCREGREP_EXE)
|
|
|
|
list(APPEND Missing "pcregrep")
|
|
|
|
endif()
|
2012-12-12 17:23:25 +00:00
|
|
|
find_program(WMCTRL_EXE "wmctrl")
|
2013-07-04 17:01:51 +00:00
|
|
|
if(NOT WMCTRL_EXE)
|
|
|
|
list(APPEND Missing "wmctrl")
|
|
|
|
endif()
|
2012-12-12 17:23:25 +00:00
|
|
|
# This is needed to build xvkbd
|
|
|
|
# Programs pcregrep wmctrl and xvkbd are used in subsequent scripts
|
|
|
|
# while testing
|
2013-07-04 17:01:51 +00:00
|
|
|
|
|
|
|
# Check for needed libraries for xvkbd
|
|
|
|
# do not add autotests, if any of them is lacking
|
|
|
|
|
2012-12-11 15:00:59 +00:00
|
|
|
find_package(X11)
|
2013-07-04 17:01:51 +00:00
|
|
|
if(NOT X11_FOUND)
|
|
|
|
list(APPEND Missing "X11")
|
|
|
|
endif()
|
|
|
|
find_package(PkgConfig)
|
|
|
|
if(PKG_CONFIG_FOUND)
|
2013-07-12 09:21:13 +00:00
|
|
|
foreach(_lb "xaw7" "xmu" "xtst")
|
|
|
|
pkg_check_modules(${_lb}LIB ${_lb})
|
|
|
|
if(${_lb}LIB_LIBRARIES)
|
|
|
|
list(APPEND XVFBDLIBS ${${_lb}LIB_LIBRARIES})
|
|
|
|
else()
|
|
|
|
list(APPEND Missing ${_lb})
|
|
|
|
endif()
|
|
|
|
endforeach()
|
2013-07-04 17:01:51 +00:00
|
|
|
else()
|
2013-07-12 09:21:13 +00:00
|
|
|
foreach(_lb "Xaw7" "Xmu")
|
|
|
|
find_library(${_lb}LIB ${_lb})
|
|
|
|
if(${_lb}LIB)
|
|
|
|
list(APPEND XVFBDLIBS ${${_lb}LIB})
|
|
|
|
else()
|
|
|
|
list(APPEND Missing ${_lb})
|
|
|
|
endif()
|
|
|
|
endforeach()
|
2013-07-04 17:01:51 +00:00
|
|
|
foreach(_lb Xt XTest X11)
|
|
|
|
if(X11_${_lb}_LIB)
|
2013-07-12 09:21:13 +00:00
|
|
|
list(APPEND XVFBDLIBS ${X11_${_lb}_LIB})
|
2013-07-04 17:01:51 +00:00
|
|
|
else()
|
2013-07-12 09:21:13 +00:00
|
|
|
list(APPEND Missing ${_lb})
|
2013-07-04 17:01:51 +00:00
|
|
|
endif()
|
|
|
|
endforeach()
|
|
|
|
endif()
|
2013-07-23 18:42:31 +00:00
|
|
|
if (XVFBDLIBS)
|
|
|
|
list(REMOVE_DUPLICATES XVFBDLIBS)
|
|
|
|
endif()
|
2013-07-04 17:01:51 +00:00
|
|
|
|
|
|
|
if(Missing)
|
2013-07-23 20:39:03 +00:00
|
|
|
message(STATUS "Missing Libraries or programs to create xvkbd: ${Missing}")
|
2013-08-21 11:34:26 +00:00
|
|
|
message(STATUS "cmake build is therefore omitting keytests")
|
2013-07-04 17:01:51 +00:00
|
|
|
endif()
|
|
|
|
|
2017-04-28 09:42:50 +00:00
|
|
|
find_program(XVKBD_EXE NAMES "xvkbd")
|
|
|
|
if (XVKBD_EXE MATCHES "NOTFOUND")
|
|
|
|
message(STATUS "Missing xvkbd, omitting keytests")
|
|
|
|
list(APPEND Missing "xvkbd")
|
|
|
|
endif()
|
|
|
|
|
2016-07-13 08:51:58 +00:00
|
|
|
if(Missing OR NOT LYX_ENABLE_KEYTESTS)
|
2014-09-03 10:25:28 +00:00
|
|
|
set(_runtest FALSE)
|
|
|
|
else()
|
2013-08-21 11:34:26 +00:00
|
|
|
project(keytest)
|
2012-12-11 14:17:04 +00:00
|
|
|
|
2017-04-28 09:42:50 +00:00
|
|
|
#add_subdirectory(xvkbd)
|
2012-12-11 14:17:04 +00:00
|
|
|
|
2014-09-03 10:25:28 +00:00
|
|
|
set(_runtest TRUE)
|
2012-12-11 15:00:59 +00:00
|
|
|
set(KEYTEST "${CMAKE_CURRENT_SOURCE_DIR}/keytest.py")
|
|
|
|
file(GLOB TESTST RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "*-in.txt")
|
|
|
|
file(GLOB TESTSS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "*-in.sh")
|
2014-09-03 10:35:40 +00:00
|
|
|
set(_firsttxt first-time-in.txt hello-world-in.txt)
|
2014-09-03 10:25:28 +00:00
|
|
|
foreach(_f ${_firsttxt})
|
|
|
|
list(FIND TESTST ${_f} _ff)
|
|
|
|
if(NOT _ff GREATER -1)
|
|
|
|
set(_runtest FALSE)
|
2014-09-03 10:35:40 +00:00
|
|
|
break()
|
2014-09-03 10:25:28 +00:00
|
|
|
endif()
|
|
|
|
endforeach()
|
|
|
|
list(REMOVE_ITEM TESTST ${_firsttxt})
|
2012-12-11 15:00:59 +00:00
|
|
|
list(SORT TESTST)
|
2014-09-03 10:25:28 +00:00
|
|
|
endif()
|
|
|
|
if(_runtest)
|
|
|
|
foreach(_tf ${_firsttxt} ${TESTST})
|
2012-12-11 15:00:59 +00:00
|
|
|
string(REGEX REPLACE "-in\\.(txt|sh)" "" _t ${_tf})
|
2013-08-21 11:34:26 +00:00
|
|
|
add_test(NAME keytest/${_t}
|
2013-07-23 19:42:44 +00:00
|
|
|
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/${LYX_HOME}"
|
|
|
|
COMMAND ${CMAKE_COMMAND}
|
2013-08-25 09:41:10 +00:00
|
|
|
-DLYX_TESTS_USERDIR=${LYX_TESTS_USERDIR}
|
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}>
|
2013-07-23 19:42:44 +00:00
|
|
|
-DLYX=${_lyx}
|
2017-04-28 09:42:50 +00:00
|
|
|
-DXVKBD_EXE=${XVKBD_EXE}
|
2013-07-23 19:42:44 +00:00
|
|
|
-DWORKDIR=${CMAKE_CURRENT_BINARY_DIR}/${LYX_HOME}
|
2013-08-21 11:34:26 +00:00
|
|
|
-DLYX_USERDIR_VER=${LYX_USERDIR_VER}
|
2012-12-11 14:17:04 +00:00
|
|
|
-DKEYTEST_OUTFILE=${_t}-out.txt
|
2012-12-12 13:54:38 +00:00
|
|
|
-DPACKAGE=${PACKAGE}
|
2015-03-17 16:36:47 +00:00
|
|
|
-DFRONTEND=${LYX_USE_QT}
|
2012-12-12 13:54:38 +00:00
|
|
|
-DLOCALE_DIR=${LOCALE_DIR}
|
2012-12-11 14:17:04 +00:00
|
|
|
-P ${TOP_SRC_DIR}/development/autotests/single-test.cmake)
|
2013-09-07 06:58:21 +00:00
|
|
|
settestlabel(keytest/${_t} "key")
|
|
|
|
set_tests_properties(keytest/${_t} PROPERTIES RUN_SERIAL ON)
|
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
|
|
|
|
2014-06-21 19:15:54 +00:00
|
|
|
if (LYX_ENABLE_EXPORT_TESTS)
|
2014-06-22 00:43:06 +00:00
|
|
|
include(${TOP_SRC_DIR}/development/autotests/ExportTests.cmake)
|
2014-03-16 08:57:31 +00:00
|
|
|
endif()
|
2018-01-01 13:03:51 +00:00
|
|
|
include(${TOP_SRC_DIR}/development/autotests/VcsTests.cmake)
|