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 set(_test_depend "test.ltx")
12 foreach(_arg test-structure test-insets test-modules box-color-size-space-align CJK XeTeX-polyglossia)
13 list(APPEND _test_depend "${TOP_SRC_DIR}/src/tex2lyx/test/${_arg}.tex")
14 list(APPEND _test_output "${CMAKE_CURRENT_BINARY_DIR}/${_arg}.lyx.tex")
15 list(APPEND _test_output "${CMAKE_CURRENT_BINARY_DIR}/${_arg}.lyx.lyx")
19 OUTPUT ${_test_output}
20 COMMAND ${LYX_PYTHON_EXECUTABLE}
21 ARGS "${TOP_SRC_DIR}/src/tex2lyx/test/runtests.py"
22 $<TARGET_FILE:${_tex2lyx}>
23 "${TOP_SRC_DIR}/lib/scripts"
24 "${CMAKE_CURRENT_BINARY_DIR}"
25 WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
26 DEPENDS ${_tex2lyx} ${_test_depend}
27 COMMENT "${LYX_PYTHON_EXECUTABLE}" "${TOP_SRC_DIR}/src/tex2lyx/test/runtests.py"
28 "${TOP_BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/${_tex2lyx}"
29 "${TOP_SRC_DIR}/lib/scripts"
30 "${CMAKE_CURRENT_BINARY_DIR}"
33 #ADD_CUSTOM_TARGET(test DEPENDS ${_tex2lyx} ${_lyx} ${_test_output})
35 add_test(NAME tex2lyx/create_lyx
36 COMMAND "${CMAKE_COMMAND}" --build ${CMAKE_BINARY_DIR} --target ${_lyx})
38 add_test(NAME tex2lyx/create_tex2lyx
39 COMMAND "${CMAKE_COMMAND}" --build ${CMAKE_BINARY_DIR} --target ${_tex2lyx})
40 set_tests_properties(tex2lyx/create_tex2lyx PROPERTIES DEPENDS tex2lyx/create_lyx)
42 foreach(_fl test.ltx test-structure.tex test-insets.tex test-modules.tex box-color-size-space-align.tex CJK.tex XeTeX-polyglossia.tex)
43 add_test(NAME tex2lyx/roundtrip/${_fl}
44 WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
45 COMMAND ${LYX_PYTHON_EXECUTABLE} "${TOP_SRC_DIR}/src/tex2lyx/test/runtests.py"
46 "${TOP_BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/${_tex2lyx}"
47 "${TOP_SRC_DIR}/lib/scripts"
48 "${CMAKE_CURRENT_BINARY_DIR}"
50 set_tests_properties(tex2lyx/roundtrip/${_fl} PROPERTIES DEPENDS tex2lyx/create_tex2lyx)