2013-05-14 09:17:50 +00:00
|
|
|
# This file is part of LyX, the document processor.
|
|
|
|
# Licence details can be found in the file COPYING.
|
|
|
|
#
|
|
|
|
# Copyright (c) 2013 Kornel Benko kornel@lyx.org
|
|
|
|
#
|
|
|
|
|
2013-05-14 16:41:33 +00:00
|
|
|
set(check_layout_SOURCES)
|
2013-05-14 09:17:50 +00:00
|
|
|
foreach(_f insets/InsetLayout.cpp Color.cpp Counters.cpp Floating.cpp
|
|
|
|
FloatList.cpp FontInfo.cpp Layout.cpp LayoutFile.cpp Lexer.cpp
|
2013-05-14 16:41:33 +00:00
|
|
|
ModuleList.cpp Spacing.cpp TextClass.cpp tests/check_layout.cpp
|
2014-04-20 18:20:25 +00:00
|
|
|
tests/boost.cpp tests/dummy_functions.cpp)
|
2013-05-14 16:41:33 +00:00
|
|
|
list(APPEND check_layout_SOURCES "${TOP_SRC_DIR}/src/${_f}")
|
2013-05-14 09:17:50 +00:00
|
|
|
endforeach()
|
|
|
|
|
2014-04-21 17:14:25 +00:00
|
|
|
include_directories(${TOP_SRC_DIR}/src/support/tests)
|
|
|
|
|
2013-05-14 16:41:33 +00:00
|
|
|
add_executable(check_layout ${check_layout_SOURCES})
|
2013-05-14 13:34:15 +00:00
|
|
|
|
2013-05-12 13:43:22 +00:00
|
|
|
target_link_libraries(check_layout support
|
2013-05-15 09:28:04 +00:00
|
|
|
${Lyx_Boost_Libraries} ${QT_QTGUI_LIBRARY} ${QT_QTCORE_LIBRARY}
|
2014-06-12 17:02:29 +00:00
|
|
|
${ZLIB_LIBRARY} ${ICONV_LIBRARY})
|
2014-12-26 16:00:23 +00:00
|
|
|
if(CYGWIN)
|
|
|
|
target_link_libraries(check_layout shlwapi)
|
|
|
|
endif()
|
2014-06-12 17:02:29 +00:00
|
|
|
lyx_target_link_libraries(check_layout Magic)
|
2013-05-12 13:43:22 +00:00
|
|
|
|
2013-05-14 16:41:33 +00:00
|
|
|
add_dependencies(lyx_run_tests check_layout)
|
|
|
|
set_target_properties(check_layout PROPERTIES FOLDER "tests/src")
|
2013-05-14 09:17:50 +00:00
|
|
|
|
|
|
|
file(GLOB layout_files RELATIVE "${TOP_SRC_DIR}/lib/layouts" "${TOP_SRC_DIR}/lib/layouts/*.layout")
|
2015-05-19 11:42:33 +00:00
|
|
|
file(GLOB module_files RELATIVE "${TOP_SRC_DIR}/lib/layouts" "${TOP_SRC_DIR}/lib/layouts/*.module")
|
2013-05-14 09:17:50 +00:00
|
|
|
list(SORT layout_files)
|
2015-05-19 11:42:33 +00:00
|
|
|
list(SORT module_files)
|
|
|
|
|
|
|
|
foreach(bns ${layout_files} ${module_files})
|
|
|
|
string(REGEX REPLACE "\\.(layout|module)" "" bn ${bns})
|
|
|
|
set(_checktype ${CMAKE_MATCH_1})
|
|
|
|
if("${_checktype}" STREQUAL "module")
|
|
|
|
file(WRITE "${LYX_TESTS_USERDIR}/layouts/test${bn}.layout" "#% Do not delete the line below; configure depends on this\n")
|
|
|
|
file(APPEND "${LYX_TESTS_USERDIR}/layouts/test${bn}.layout" "# \\DeclareLaTeXClass{test${bn}}\n")
|
|
|
|
|
2015-07-12 16:59:24 +00:00
|
|
|
file(APPEND "${LYX_TESTS_USERDIR}/layouts/test${bn}.layout" "Format 55\n")
|
2015-05-19 11:42:33 +00:00
|
|
|
file(APPEND "${LYX_TESTS_USERDIR}/layouts/test${bn}.layout" "Input ${bns}\n")
|
|
|
|
add_test(NAME "check_layout/${bns}"
|
|
|
|
COMMAND env LYX_USERDIR_22x=${LYX_TESTS_USERDIR} $<TARGET_FILE:check_layout> "${LYX_TESTS_USERDIR}/layouts/test${bn}" "${CMAKE_CURRENT_BINARY_DIR}/${bn}.out${_checktype}")
|
|
|
|
else()
|
|
|
|
add_test(NAME "check_layout/${bns}"
|
|
|
|
COMMAND check_layout "${TOP_SRC_DIR}/lib/layouts/${bn}" "${CMAKE_CURRENT_BINARY_DIR}/${bn}.out${_checktype}")
|
|
|
|
endif()
|
|
|
|
settestlabel("check_layout/${bns}" "${_checktype}")
|
2013-05-14 09:17:50 +00:00
|
|
|
endforeach()
|
2014-12-28 13:20:17 +00:00
|
|
|
|
|
|
|
set(check_ExternalTransforms_SOURCES)
|
|
|
|
foreach(_f graphics/GraphicsParams.cpp insets/ExternalTransforms.cpp
|
|
|
|
Length.cpp lengthcommon.cpp tests/check_ExternalTransforms.cpp
|
|
|
|
tests/boost.cpp tests/dummy_functions.cpp)
|
|
|
|
list(APPEND check_ExternalTransforms_SOURCES ${TOP_SRC_DIR}/src/${_f})
|
|
|
|
endforeach()
|
|
|
|
|
|
|
|
include_directories(${TOP_SRC_DIR}/src/tests)
|
|
|
|
add_executable(check_ExternalTransforms ${check_ExternalTransforms_SOURCES})
|
|
|
|
|
|
|
|
target_link_libraries(check_ExternalTransforms support
|
2015-03-15 19:12:55 +00:00
|
|
|
${Lyx_Boost_Libraries} ${QT_QTGUI_LIBRARY} ${QT_QTCORE_LIBRARY})
|
2015-05-06 16:59:26 +00:00
|
|
|
lyx_target_link_libraries(check_ExternalTransforms Magic)
|
2014-12-28 13:20:17 +00:00
|
|
|
|
|
|
|
add_dependencies(lyx_run_tests check_ExternalTransforms)
|
2015-01-07 20:13:50 +00:00
|
|
|
set_target_properties(check_ExternalTransforms PROPERTIES FOLDER "tests/src")
|
2014-12-29 10:33:47 +00:00
|
|
|
target_link_libraries(check_ExternalTransforms ${ICONV_LIBRARY})
|
2014-12-28 13:20:17 +00:00
|
|
|
|
|
|
|
add_test(NAME "check_ExternalTransforms"
|
|
|
|
COMMAND ${CMAKE_COMMAND} -DCommand=$<TARGET_FILE:check_ExternalTransforms>
|
|
|
|
"-DInput=${TOP_SRC_DIR}/src/tests/regfiles/ExternalTransforms"
|
|
|
|
"-DOutput=${CMAKE_CURRENT_BINARY_DIR}/ExternalTransforms_data"
|
|
|
|
-P "${TOP_SRC_DIR}/src/support/tests/supporttest.cmake")
|
|
|
|
add_dependencies(lyx_run_tests check_ExternalTransforms)
|
|
|
|
|
2015-07-12 16:08:41 +00:00
|
|
|
set(check_ExternalTransforms_SOURCES)
|
|
|
|
foreach(_f graphics/GraphicsParams.cpp insets/ExternalTransforms.cpp
|
|
|
|
Length.cpp lengthcommon.cpp tests/check_ExternalTransforms.cpp
|
|
|
|
tests/boost.cpp tests/dummy_functions.cpp)
|
|
|
|
list(APPEND check_ExternalTransforms_SOURCES ${TOP_SRC_DIR}/src/${_f})
|
|
|
|
endforeach()
|
|
|
|
|
|
|
|
include_directories(${TOP_SRC_DIR}/src/tests)
|
2015-07-12 16:59:24 +00:00
|
|
|
set(check_Length_SOURCES)
|
|
|
|
foreach(_f Length.cpp lengthcommon.cpp tests/check_Length.cpp tests/boost.cpp tests/dummy_functions.cpp)
|
|
|
|
list(APPEND check_Length_SOURCES ${TOP_SRC_DIR}/src/${_f})
|
|
|
|
endforeach()
|
2015-07-12 16:08:41 +00:00
|
|
|
add_executable(check_Length ${check_Length_SOURCES})
|
|
|
|
|
|
|
|
target_link_libraries(check_Length support
|
|
|
|
${Lyx_Boost_Libraries} ${QT_QTGUI_LIBRARY} ${QT_QTCORE_LIBRARY})
|
|
|
|
lyx_target_link_libraries(check_Length Magic)
|
|
|
|
|
|
|
|
add_dependencies(lyx_run_tests check_Length)
|
|
|
|
set_target_properties(check_Length PROPERTIES FOLDER "tests/src")
|
|
|
|
target_link_libraries(check_Length ${ICONV_LIBRARY})
|
|
|
|
|
|
|
|
add_test(NAME "check_Length"
|
|
|
|
COMMAND ${CMAKE_COMMAND} -DCommand=$<TARGET_FILE:check_Length>
|
|
|
|
"-DInput=${TOP_SRC_DIR}/src/tests/regfiles/Length"
|
|
|
|
"-DOutput=${CMAKE_CURRENT_BINARY_DIR}/Length_data"
|
|
|
|
-P "${TOP_SRC_DIR}/src/support/tests/supporttest.cmake")
|
|
|
|
add_dependencies(lyx_run_tests check_Length)
|
|
|
|
|