]> git.lyx.org Git - features.git/blob - src/tex2lyx/test/CMakeLists.txt
tex2lyx tests adapted to cmake build
[features.git] / src / tex2lyx / test / CMakeLists.txt
1 # This file is part of LyX, the document processor.
2 # Licence details can be found in the file COPYING.
3 #
4 # Copyright (c) 2012 Kornel Benko, <kornel@lyx.org>
5 #
6
7 project(test)
8
9 set(_test_depend "test.ltx")
10 set(_test_output)
11 #foreach(_arg runtests.py DummyDocument.tex test.ltx foo.eps foo.png)
12 #  configure_file("${TOP_SRC_DIR}/src/tex2lyx/test/${_arg}" "${CMAKE_CURRENT_BINARY_DIR}/${_arg}" COPYONLY)
13 #endforeach(_arg)
14
15 foreach(_arg test-structure test-insets box-color-size-space-align CJK XeTeX-polyglossia)
16   list(APPEND _test_depend "${TOP_SRC_DIR}/src/tex2lyx/test/${_arg}.tex")
17   list(APPEND _test_output "${CMAKE_CURRENT_BINARY_DIR}/${_arg}.lyx.tex")
18   list(APPEND _test_output "${CMAKE_CURRENT_BINARY_DIR}/${_arg}.lyx.lyx")
19 endforeach(_arg)
20
21 ADD_CUSTOM_COMMAND(
22   OUTPUT ${_test_output}
23   COMMAND ${LYX_PYTHON_EXECUTABLE}
24   ARGS "${TOP_SRC_DIR}/src/tex2lyx/test/runtests.py" "${TOP_BINARY_DIR}/bin/${_tex2lyx}" "${TOP_SRC_DIR}/lib/scripts" "${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" "${TOP_BINARY_DIR}/bin/${_tex2lyx}" "${TOP_SRC_DIR}/lib/scripts" "${CMAKE_CURRENT_BINARY_DIR}"
28 )
29
30 ADD_CUSTOM_TARGET(test DEPENDS ${_tex2lyx} ${_lyx} ${_test_output})
31