1 # This file is part of LyX, the document processor.
2 # Licence details can be found in the file COPYING.
4 # Copyright (c) 2012 Kornel Benko, <kornel@lyx.org>
9 #file(GLOB _tex_tests RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/*.ltx" "${CMAKE_CURRENT_SOURCE_DIR}/*.tex")
11 #list(REMOVE_ITEM _tex_tests DummyDocument.tex)
13 set(_tex_tests test.ltx
14 box-color-size-space-align.tex
20 test-refstyle-theorems.tex
27 set(runtestsScript "${TOP_SRC_DIR}/src/tex2lyx/test/runtests.py")
28 set(scriptDir "${TOP_SRC_DIR}/lib/scripts")
30 foreach(_fl ${_tex_tests})
32 add_test(NAME tex2lyx/roundtrip/${_fl}
33 WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
34 COMMAND ${CMAKE_COMMAND}
35 -DLYX_TESTS_USERDIR=${LYX_TESTS_USERDIR}
36 -DLYX_USERDIR_VER=${LYX_USERDIR_VER}
37 -DLYX_PYTHON_EXECUTABLE=${LYX_PYTHON_EXECUTABLE}
38 -DPY_SCRIPT=${runtestsScript}
39 -DTEX2LYX_EXE=$<TARGET_FILE:${_tex2lyx}>
40 -DSCRIPT_DIR=${scriptDir}
41 -DWORKDIR=${CMAKE_CURRENT_BINARY_DIR}
43 -P ${TOP_SRC_DIR}/src/tex2lyx/test/runtests.cmake)
44 set_tests_properties(tex2lyx/roundtrip/${_fl} PROPERTIES RESOURCE_LOCK "runtests.lock" LABELS "roundtrip")
45 add_test(NAME tex2lyx/cmplyx/${_fl}
46 WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
47 COMMAND ${CMAKE_COMMAND}
48 -DLYX_TESTS_USERDIR=${LYX_TESTS_USERDIR}
49 -DLYX_USERDIR_VER=${LYX_USERDIR_VER}
50 -DLYX_PYTHON_EXECUTABLE=${LYX_PYTHON_EXECUTABLE}
51 -DPY_SCRIPT=${runtestsScript}
52 -DFIRST_PARAM=uselyx2lyx
53 -DTEX2LYX_EXE=$<TARGET_FILE:${_tex2lyx}>
54 -DSCRIPT_DIR=${scriptDir}
55 -DWORKDIR=${CMAKE_CURRENT_BINARY_DIR}
57 -P ${TOP_SRC_DIR}/src/tex2lyx/test/runtests.cmake)
58 set_tests_properties(tex2lyx/cmplyx/${_fl} PROPERTIES RESOURCE_LOCK "runtests.lock" LABELS "cmplyx")
61 add_dependencies(lyx_run_tests ${_tex2lyx} ${_lyx})
65 COMMAND ${CMAKE_COMMAND} -E touch LyxTestFiles
66 COMMAND env LYX_USERDIR_VER=${LYX_USERDIR_VER}
67 ${LYX_PYTHON_EXECUTABLE} "${runtestsScript}" $<TARGET_FILE:${_tex2lyx}> "${scriptDir}" "${CMAKE_CURRENT_SOURCE_DIR}"
68 WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
69 DEPENDS ${_tex2lyx} ${_lyx}
72 add_custom_target(updatetex2lyxtests DEPENDS LyxTestFiles)